Skip to content

Commit

Permalink
fix: 🐛 前端警告
Browse files Browse the repository at this point in the history
  • Loading branch information
tk authored and nsnail committed Dec 23, 2024
1 parent ac4bb50 commit 9c81ce6
Show file tree
Hide file tree
Showing 17 changed files with 26 additions and 41 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ biz-infra-->infra
| JavaScript | JavaScript解析器 | [Terser](https://github.com/terser/terser) |
| JavaScript | 代码质量检查 | [ESLint](https://github.com/eslint/eslint) |
| JavaScript | 代码格式化工具 | [Prettier](https://github.com/prettier/prettier) |
| JavaScript | 标准加密库 | [crypto-js](https://github.com/brix/crypto-js) |
| JavaScript | 标准加密库 | [crypto-js](https://github.com/brix/crypto-js) |
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
"path": "node_modules/cz-git"
}
}
}
}
10 changes: 5 additions & 5 deletions src/frontend/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
},
"dependencies": {
"@element-plus/icons-vue": "2.3.1",
"ace-builds": "1.36.5",
"aieditor": "1.2.8",
"ace-builds": "1.37.1",
"aieditor": "1.3.3",
"axios": "1.7.9",
"crypto-js": "4.2.0",
"echarts": "5.5.1",
"element-plus": "2.9.0",
"element-plus": "2.9.1",
"json-bigint": "1.0.0",
"markdown-it": "14.1.0",
"markdown-it-emoji": "3.0.0",
Expand All @@ -34,9 +34,9 @@
"@vitejs/plugin-vue": "5.2.1",
"prettier": "3.4.2",
"prettier-plugin-organize-attributes": "1.0.0",
"sass": "1.82.0",
"sass": "1.83.0",
"terser": "5.37.0",
"vite": "5.1.8"
"vite": "6.0.5"
},
"browserslist": [
"> 1%",
Expand Down
9 changes: 0 additions & 9 deletions src/frontend/admin/src/components/naVerifition/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,8 @@ export default {
position: relative;
background: var(--el-bg-color);
text-align: center;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
border: 1px solid var(--el-border-color);
-webkit-border-radius: 4px;
}
.verify-bar-area .verify-move-block {
Expand All @@ -236,8 +233,6 @@ export default {
left: 0;
background: var(--el-bg-color);
cursor: pointer;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
Expand All @@ -252,16 +247,12 @@ export default {
left: -1px;
background: var(--el-bg-color);
cursor: pointer;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
border: 1px solid gainsboro;
}
.verify-img-panel {
margin: 0;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
border-radius: 3px;
position: relative;
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/admin/src/components/scFileExport/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default {
},
linkFile(url, fileName, data = {}) {
let a = document.createElement('a')
a.style = 'display: none'
a.style.display = 'none'
a.target = '_blank'
//a.download = fileName
a.href = url + this.toQueryString(data)
Expand All @@ -153,7 +153,7 @@ export default {
this.downLoadProgress = 0
let url = URL.createObjectURL(res)
let a = document.createElement('a')
a.style = 'display: none'
a.style.display = 'none'
a.target = '_blank'
a.download = fileName
a.href = url
Expand Down
1 change: 0 additions & 1 deletion src/frontend/admin/src/components/scFileSelect/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,6 @@ export default {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
-webkit-text-overflow: ellipsis;
text-align: center;
}
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/admin/src/components/scTable/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ export default {
if (!data) return
const textarea = document.createElement('textarea')
textarea.readOnly = 'readonly'
textarea.readOnly = true
textarea.style.position = 'absolute'
textarea.style.left = '-9999px'
textarea.value = data
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/admin/src/directives/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
el.$value = binding.value
el.handler = () => {
const textarea = document.createElement('textarea')
textarea.readOnly = 'readonly'
textarea.readOnly = true
textarea.style.position = 'absolute'
textarea.style.left = '-9999px'
textarea.value = el.$value
Expand Down
3 changes: 1 addition & 2 deletions src/frontend/admin/src/layout/components/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ export default {
this.cursor.index += this.result.length
}
e.preventDefault()
return
}
},
inputChange(value) {
Expand Down Expand Up @@ -160,7 +159,7 @@ export default {
if (item.type === 'link') {
setTimeout(() => {
let a = document.createElement('a')
a.style = 'display: none'
a.style.display = 'none'
a.target = '_blank'
a.href = item.path
document.body.appendChild(a)
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/admin/src/layout/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
<ul>
<li v-for="item in menu" :class="pmenu.path === item.path ? 'active' : ''" :key="item" @click="showMenu(item)">
<el-icon>
<component :is="item.meta.icon || el - icon - menu" />
<component :is="item.meta.icon || 'el-icon-menu'" />
</el-icon>
<p>{{ item.meta.title }}</p>
</li>
Expand Down
8 changes: 4 additions & 4 deletions src/frontend/admin/src/utils/avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ export default {
const svg = document.createElement('svg')
svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg')

svg.setAttribute('width', 50)
svg.setAttribute('height', 50)
svg.setAttribute('width', '50')
svg.setAttribute('height', '50')

// <rect> background
const rect = document.createElement('rect')
rect.setAttribute('fill', color)
rect.setAttribute('x', 0)
rect.setAttribute('y', 0)
rect.setAttribute('x', '0')
rect.setAttribute('y', '0')
rect.setAttribute('width', '100%')
rect.setAttribute('height', '100%')

Expand Down
4 changes: 2 additions & 2 deletions src/frontend/admin/src/utils/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ axios.interceptors.response.use(
} else if ([401, 403].includes(error.response.status)) {
// 如果token不存在,说明用户是第一次访问,直接跳转到登录页面
if (!tool.cookie.get('ACCESS-TOKEN') && window.location.href.indexOf('guest') < 0) {
tool.data.set('LOGIN_REDIRECT', window.location.href)
await tool.data.set('LOGIN_REDIRECT', window.location.href)
await router.replace({ path: '/guest/login' })
return
}
Expand All @@ -149,7 +149,7 @@ axios.interceptors.response.use(
done()
},
})
tool.data.set('LOGIN_REDIRECT', window.location.href)
await tool.data.set('LOGIN_REDIRECT', window.location.href)
await router.replace({ path: '/guest/login' })
})
}
Expand Down
9 changes: 3 additions & 6 deletions src/frontend/admin/src/utils/tool.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,8 @@ tool.data = {
content: data,
datetime: parseInt(datetime) === 0 ? 0 : new Date().getTime() + parseInt(datetime) * 1000,
}
const ret = localStorage.setItem(key, JSON.stringify(cacheValue))
localStorage.setItem(key, JSON.stringify(cacheValue))
await this.uploadConfig()
return ret
},
get(key) {
try {
Expand All @@ -126,14 +125,12 @@ tool.data = {
}
},
async remove(key) {
const ret = localStorage.removeItem(key)
localStorage.removeItem(key)
await this.uploadConfig()
return ret
},
async clear() {
const ret = localStorage.clear()
localStorage.clear()
await this.uploadConfig()
return ret
},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default {
return false
}
const redirect = this.$TOOL.data.get('LOGIN_REDIRECT') ?? '/'
this.$TOOL.data.remove('LOGIN_REDIRECT')
await this.$TOOL.data.remove('LOGIN_REDIRECT')
window.location.href = redirect
},
},
Expand Down
1 change: 0 additions & 1 deletion src/frontend/admin/src/views/guest/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
role="img"
viewBox="0 0 512 512"
width="1em"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg">
<path
d="M478.33 433.6l-90-218a22 22 0 0 0-40.67 0l-90 218a22 22 0 1 0 40.67 16.79L316.66 406h102.67l18.33 44.39A22 22 0 0 0 458 464a22 22 0 0 0 20.32-30.4zM334.83 362L368 281.65L401.17 362z"
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/admin/src/views/home/work/components/myapp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<template #item="{ element }">
<li :style="{ background: element.meta.color || 'var(--el-text-color-secondary)' }">
<el-icon>
<component :is="element.meta.icon || el - icon - menu" />
<component :is="element.meta.icon || 'el-icon-menu'" />
</el-icon>
<p>{{ element.meta.title }}</p>
</li>
Expand All @@ -44,7 +44,7 @@
<template #item="{ element }">
<li :style="{ background: element.meta.color || 'var(--el-text-color-secondary)' }">
<el-icon>
<component :is="element.meta.icon || el - icon - menu" />
<component :is="element.meta.icon || 'el-icon-menu'" />
</el-icon>
<p>{{ element.meta.title }}</p>
</li>
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/admin/src/views/sys/doc/list/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export default {
},
async share(row) {
const textarea = document.createElement('textarea')
textarea.readOnly = 'readonly'
textarea.readOnly = true
textarea.style.position = 'absolute'
textarea.style.left = '-9999px'
textarea.value = window.location.origin + `/guest/view-doc/${row.id}`
Expand Down

0 comments on commit 9c81ce6

Please sign in to comment.