diff --git a/Yi.BBS.Vue3/package-lock.json b/Yi.BBS.Vue3/package-lock.json index 1b88bd6c..7ac0aef1 100644 --- a/Yi.BBS.Vue3/package-lock.json +++ b/Yi.BBS.Vue3/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "@element-plus/icons-vue": "^2.1.0", "axios": "^1.3.4", + "echarts": "^5.4.2", "element-plus": "^2.2.32", "highlight": "^0.2.4", "marked": "^4.2.12", @@ -1876,6 +1877,15 @@ "node": ">=12" } }, + "node_modules/echarts": { + "version": "5.4.2", + "resolved": "https://registry.npmmirror.com/echarts/-/echarts-5.4.2.tgz", + "integrity": "sha512-2W3vw3oI2tWJdyAz+b8DuWS0nfXtSDqlDmqgin/lfzbkB01cuMEN66KWBlmur3YMp5nEDEEt5s23pllnAzB4EA==", + "dependencies": { + "tslib": "2.3.0", + "zrender": "5.4.3" + } + }, "node_modules/electron-to-chromium": { "version": "1.4.311", "resolved": "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.4.311.tgz", @@ -3366,6 +3376,11 @@ "node": ">=8.0" } }, + "node_modules/tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + }, "node_modules/ufo": { "version": "1.1.0", "resolved": "https://registry.npmmirror.com/ufo/-/ufo-1.1.0.tgz", @@ -3836,6 +3851,14 @@ "version": "0.4.0", "resolved": "https://registry.npmmirror.com/yarm/-/yarm-0.4.0.tgz", "integrity": "sha512-yCoX5QCA5Upb+VP7/UBuNGBz7MO5oWyc6degv5AifeGnakpaHeNwE/SNOPMefFKpQBionZyUeRdBo63Dl+awDQ==" + }, + "node_modules/zrender": { + "version": "5.4.3", + "resolved": "https://registry.npmmirror.com/zrender/-/zrender-5.4.3.tgz", + "integrity": "sha512-DRUM4ZLnoaT0PBVvGBDO9oWIDBKFdAVieNWxWwK0niYzJCMwGchRk21/hsE+RKkIveH3XHCyvXcJDkgLVvfizQ==", + "dependencies": { + "tslib": "2.3.0" + } } }, "dependencies": { @@ -5246,6 +5269,15 @@ "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", "dev": true }, + "echarts": { + "version": "5.4.2", + "resolved": "https://registry.npmmirror.com/echarts/-/echarts-5.4.2.tgz", + "integrity": "sha512-2W3vw3oI2tWJdyAz+b8DuWS0nfXtSDqlDmqgin/lfzbkB01cuMEN66KWBlmur3YMp5nEDEEt5s23pllnAzB4EA==", + "requires": { + "tslib": "2.3.0", + "zrender": "5.4.3" + } + }, "electron-to-chromium": { "version": "1.4.311", "resolved": "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.4.311.tgz", @@ -6413,6 +6445,11 @@ "is-number": "^7.0.0" } }, + "tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + }, "ufo": { "version": "1.1.0", "resolved": "https://registry.npmmirror.com/ufo/-/ufo-1.1.0.tgz", @@ -6776,6 +6813,14 @@ "version": "0.4.0", "resolved": "https://registry.npmmirror.com/yarm/-/yarm-0.4.0.tgz", "integrity": "sha512-yCoX5QCA5Upb+VP7/UBuNGBz7MO5oWyc6degv5AifeGnakpaHeNwE/SNOPMefFKpQBionZyUeRdBo63Dl+awDQ==" + }, + "zrender": { + "version": "5.4.3", + "resolved": "https://registry.npmmirror.com/zrender/-/zrender-5.4.3.tgz", + "integrity": "sha512-DRUM4ZLnoaT0PBVvGBDO9oWIDBKFdAVieNWxWwK0niYzJCMwGchRk21/hsE+RKkIveH3XHCyvXcJDkgLVvfizQ==", + "requires": { + "tslib": "2.3.0" + } } } } diff --git a/Yi.BBS.Vue3/package.json b/Yi.BBS.Vue3/package.json index 331b5631..fc0b4646 100644 --- a/Yi.BBS.Vue3/package.json +++ b/Yi.BBS.Vue3/package.json @@ -10,6 +10,7 @@ "dependencies": { "@element-plus/icons-vue": "^2.1.0", "axios": "^1.3.4", + "echarts": "^5.4.2", "element-plus": "^2.2.32", "highlight": "^0.2.4", "marked": "^4.2.12", diff --git a/Yi.BBS.Vue3/src/components/CommentInfo.vue b/Yi.BBS.Vue3/src/components/CommentInfo.vue index 67c98f99..fc262af8 100644 --- a/Yi.BBS.Vue3/src/components/CommentInfo.vue +++ b/Yi.BBS.Vue3/src/components/CommentInfo.vue @@ -14,13 +14,14 @@ - +
- 发表评论 + 发表评论 其他 - - + +
+
@@ -31,13 +32,13 @@ {{ item.creationTime }} - 4 - 回复 - 删除 + 0 + 回复 + 删除
- 回复 + 回复
@@ -57,12 +58,12 @@ 0 - 回复 - 删除 + 回复 + 删除
- 回复 + 回复
diff --git a/Yi.BBS.Vue3/src/components/DisscussCard.vue b/Yi.BBS.Vue3/src/components/DisscussCard.vue index 25dd0922..9466d325 100644 --- a/Yi.BBS.Vue3/src/components/DisscussCard.vue +++ b/Yi.BBS.Vue3/src/components/DisscussCard.vue @@ -1,86 +1,152 @@ \ No newline at end of file diff --git a/Yi.BBS.Vue3/src/components/echars/VisitsLineChart.vue b/Yi.BBS.Vue3/src/components/echars/VisitsLineChart.vue new file mode 100644 index 00000000..c4b82539 --- /dev/null +++ b/Yi.BBS.Vue3/src/components/echars/VisitsLineChart.vue @@ -0,0 +1,51 @@ + + \ No newline at end of file diff --git a/Yi.BBS.Vue3/src/directive/permission/hasDiscussPermi.js b/Yi.BBS.Vue3/src/directive/permission/hasDiscussPermi.js new file mode 100644 index 00000000..7de23c8f --- /dev/null +++ b/Yi.BBS.Vue3/src/directive/permission/hasDiscussPermi.js @@ -0,0 +1,29 @@ + /** + * v-hasDiscussPermi 操作权限处理 + */ + + import useUserStore from '@/stores/user' + + //传一个值,一个主题id的创建者id,判断当前主题是否为自己创建,拥有*:*:*,直接跳过 + export default { + mounted(el, binding, vnode) { + const { value } = binding + const all_permission = "*:*:*"; + const permissions = useUserStore().permissions + const userId = useUserStore().id + if (value && value instanceof Array && value.length > 0) { + const permissionFlag = value + + const hasPermissions = permissions.some(permission => { + return all_permission === permission || permissionFlag==userId + }) + + if (!hasPermissions) { + el.parentNode && el.parentNode.removeChild(el) + } + } else { + throw new Error(`请设置操作主题用户签值`) + } + } + } + \ No newline at end of file diff --git a/Yi.BBS.Vue3/src/stores/user.js b/Yi.BBS.Vue3/src/stores/user.js index 8f8c194c..b0970a91 100644 --- a/Yi.BBS.Vue3/src/stores/user.js +++ b/Yi.BBS.Vue3/src/stores/user.js @@ -53,7 +53,8 @@ const useUserStore = defineStore('user', // this.permissions=["*:*:*"] this.name = user.nick this.icon = avatar; - this.userName=user.userName + this.userName=user.userName; + this.id=user.id; resolve(res) }).catch(error => { reject(error) diff --git a/Yi.BBS.Vue3/src/utils/request.js b/Yi.BBS.Vue3/src/utils/request.js index 887100ee..9e2c64e5 100644 --- a/Yi.BBS.Vue3/src/utils/request.js +++ b/Yi.BBS.Vue3/src/utils/request.js @@ -39,7 +39,9 @@ const response=error.response.data; //业务异常+应用异常,统一处理 switch(response.code) { - + case 401: + ElMessage.error('登录已过期') + break; case 403: ElMessage.error(response.message) break; diff --git a/Yi.BBS.Vue3/src/views/Article.vue b/Yi.BBS.Vue3/src/views/Article.vue index 7b088198..533ac54c 100644 --- a/Yi.BBS.Vue3/src/views/Article.vue +++ b/Yi.BBS.Vue3/src/views/Article.vue @@ -5,7 +5,7 @@ - +