fix: 修复xss漏洞。

This commit is contained in:
webb
2024-04-28 23:26:04 +08:00
parent cc62f98a9f
commit 4396c53d79
3 changed files with 52 additions and 4 deletions

View File

@@ -12,7 +12,8 @@
</template>
<script>
import { mapState } from 'vuex'
import {mapState} from 'vuex'
import {defenseXSS} from 'simple-mind-map/src/utils/xss'
/**
* @Author: 王林
@@ -60,7 +61,7 @@ export default {
this.words = 0
this.num = 0
this.walk(data)
countEl.innerHTML = this.textStr
countEl.innerHTML = defenseXSS(this.textStr)
this.words = countEl.textContent.length
},
@@ -101,7 +102,7 @@ export default {
background: #262a2e;
.item {
color: hsla(0,0%,100%,.6);
color: hsla(0, 0%, 100%, .6);
}
}