Browse Source

fix:1. 图片弹窗背景色改为纯黑;2. 路由守卫增加对于login的判断;

dxj
李朋徽 1 year ago
parent
commit
6d3d0918b5
  1. 9
      src/design/index.scss
  2. 3
      src/hooks/useMqtt.ts
  3. 9
      src/router/guard.ts

9
src/design/index.scss

@ -77,6 +77,15 @@ html[data-theme="dark"] {
}
}
// ant 图片预览遮罩
.ant-image-preview-mask {
background-color: rgba($color: #000000, $alpha: 1) !important;
}
// markdown 图片预览遮罩
.medium-zoom-overlay {
background: rgba($color: #000000, $alpha: 1) !important;
}
// 保持 windi 一样的全局样式减少升级带来的影响
ul {
padding: 0;

3
src/hooks/useMqtt.ts

@ -40,7 +40,8 @@ export function useMqtt() {
if (message.conversationId !== messageStore.getConversationData.id) {
return
}
console.log(message.message_content.length)
// console.log(message)
// console.log(topicKey, message.message_content.length)
if (message.message_type === MessageStatusEnum.ACTICON) {
// 这里主要是知识库的数据更新,因为知识库回答是每次都是一个字,并不是通常的不断叠加,需要前端手动叠加

9
src/router/guard.ts

@ -13,13 +13,18 @@ const WHITE_NAME_LIST: string[] = [
function createRouterGuards(router: Router) {
const userStore = useUserStore()
// 前置
router.beforeEach(async (to, _from, next) => {
router.beforeEach(async (to, from, next) => {
const isErrorPage = router.getRoutes().findIndex(item => item.name === to.name)
if (isErrorPage === -1)
next({ name: PageEnum.ERROR_PAGE_NAME_404 })
if (userStore.getToken) {
next()
if (WHITE_NAME_LIST.includes(to.name as string)) {
next({ name: from.name as string })
}
else {
next()
}
}
else {
if (WHITE_NAME_LIST.includes(to.name as string))

Loading…
Cancel
Save