diff --git a/Yi.BBS.Vue3/src/App.vue b/Yi.BBS.Vue3/src/App.vue index cf631c70..a4a6f782 100644 --- a/Yi.BBS.Vue3/src/App.vue +++ b/Yi.BBS.Vue3/src/App.vue @@ -7,10 +7,21 @@ \ No newline at end of file diff --git a/Yi.BBS.Vue3/src/components/DisscussCard.vue b/Yi.BBS.Vue3/src/components/DisscussCard.vue index 9466d325..f2e96544 100644 --- a/Yi.BBS.Vue3/src/components/DisscussCard.vue +++ b/Yi.BBS.Vue3/src/components/DisscussCard.vue @@ -41,8 +41,8 @@
{{ discuss.creationTime }}
- - + + 浏览数:{{ discuss.seeNum ?? 0 }} @@ -69,6 +69,7 @@ import { h, ref, toRef, onMounted ,reactive} from 'vue' import { useRouter } from 'vue-router' import AvatarInfo from './AvatarInfo.vue'; +import AgreeInfo from './AgreeInfo.vue' import { operate } from '@/apis/agreeApi' const props = defineProps(['discuss','badge']) diff --git a/Yi.BBS.Vue3/src/components/UserSelectInfo.vue b/Yi.BBS.Vue3/src/components/UserSelectInfo.vue new file mode 100644 index 00000000..cfc6df6d --- /dev/null +++ b/Yi.BBS.Vue3/src/components/UserSelectInfo.vue @@ -0,0 +1,129 @@ + + + \ No newline at end of file diff --git a/Yi.BBS.Vue3/src/layout/AppHeader.vue b/Yi.BBS.Vue3/src/layout/AppHeader.vue index 513b80e9..3d3bc0f5 100644 --- a/Yi.BBS.Vue3/src/layout/AppHeader.vue +++ b/Yi.BBS.Vue3/src/layout/AppHeader.vue @@ -8,7 +8,7 @@ > + {{configStore.name}} 主页 @@ -56,6 +56,8 @@ import AvatarInfo from '@/components/AvatarInfo.vue' import { ref } from 'vue' import { useRouter } from 'vue-router' import useUserStore from '@/stores/user.js' +import useConfigStore from "@/stores/config"; +const configStore= useConfigStore(); const router = useRouter() const userStore =useUserStore(); const activeIndex = ref('1') diff --git a/Yi.BBS.Vue3/src/stores/config.js b/Yi.BBS.Vue3/src/stores/config.js new file mode 100644 index 00000000..5d1c0c7d --- /dev/null +++ b/Yi.BBS.Vue3/src/stores/config.js @@ -0,0 +1,22 @@ +import {getAll} from '@/apis/configApi' +import { defineStore } from 'pinia' +const useConfigStore = defineStore('config', + { + state: () => ({ + data: [] + }), + getters: { + name:(state)=>state.data.filter(s=> s.configKey=='bbs.site.name').map(x=>x.configValue)[0], + author:(state)=>state.data.filter(s=> s.configKey=='bbs.site.author').map(x=>x.configValue)[0], + icp:(state)=>state.data.filter(s=> s.configKey=='bbs.site.icp').map(x=>x.configValue)[0], + bottom:(state)=>state.data.filter(s=>s.configKey=='bbs.site.bottom').map(x=>x.configValue)[0] + }, + actions: { + // 登录 + async getConfig() { + const response = await getAll(); + this.data = response.data.items; + }, + }, + }) +export default useConfigStore; diff --git a/Yi.BBS.Vue3/src/utils/request.js b/Yi.BBS.Vue3/src/utils/request.js index 9e2c64e5..ed4b6120 100644 --- a/Yi.BBS.Vue3/src/utils/request.js +++ b/Yi.BBS.Vue3/src/utils/request.js @@ -20,11 +20,15 @@ const myaxios = axios.create({ // } // }], }) + + + // 请求拦截器 myaxios.interceptors.request.use(function (config) { if (getToken()) { config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 } + return config; }, function (error) { return Promise.reject(error); diff --git a/Yi.BBS.Vue3/src/views/Article.vue b/Yi.BBS.Vue3/src/views/Article.vue index 533ac54c..aa607e5a 100644 --- a/Yi.BBS.Vue3/src/views/Article.vue +++ b/Yi.BBS.Vue3/src/views/Article.vue @@ -49,7 +49,7 @@ - 4 + 0 分享 操作 @@ -134,7 +134,7 @@ import CommentInfo from "@/components/CommentInfo.vue"; import BottomInfo from '@/components/BottomInfo.vue' import TreeArticleInfo from "@/components/TreeArticleInfo.vue"; import { useRoute, useRouter } from "vue-router"; - +import AgreeInfo from '@/components/AgreeInfo.vue' import { get as discussGet, del as discussDel } from "@/apis/discussApi.js"; import { all as articleall, del as articleDel, get as articleGet } from "@/apis/articleApi.js"; //数据定义 diff --git a/Yi.BBS.Vue3/src/views/Discuss.vue b/Yi.BBS.Vue3/src/views/Discuss.vue index 0a4f267c..03bc6733 100644 --- a/Yi.BBS.Vue3/src/views/Discuss.vue +++ b/Yi.BBS.Vue3/src/views/Discuss.vue @@ -213,4 +213,9 @@ display: flex; .collapse-list >>> .el-collapse-item__header { border-bottom-color: #F0F2F5 !important; } + +.el-divider +{ + margin: 0.5rem 0; +} \ No newline at end of file diff --git a/Yi.BBS.Vue3/src/views/EditArticle.vue b/Yi.BBS.Vue3/src/views/EditArticle.vue index 84992439..5a47f2ac 100644 --- a/Yi.BBS.Vue3/src/views/EditArticle.vue +++ b/Yi.BBS.Vue3/src/views/EditArticle.vue @@ -18,6 +18,10 @@ 部分用户可见 + + + + @@ -59,6 +63,7 @@