Forráskód Böngészése

Merge branch 'main' of http://39.106.91.179:3000/hunter/designer-hub into main

purui 1 hónapja
szülő
commit
b11cb9b574

+ 3 - 0
packages/app/src/composables/permissions.ts

@@ -1,3 +1,4 @@
+import { messages } from '../core/libs/messages'
 import { useRouter } from '../core/utils/router'
 import { useUserStore } from '../store'
 import { storeToRefs } from 'pinia'
@@ -99,10 +100,12 @@ export const usePermissions = () => {
     const feature = features.find((item) => item.name === name)
     if (feature) {
       if (!feature.meta.canNotLogin && !isLogined.value) {
+        uni.showToast({ title: messages.components.toast.pleaseLogin, icon: 'none' })
         useRouter().push('/pages/login/index')
         return
       }
       if (!feature.meta.canNotDesigner && !isDesigner.value) {
+        uni.showToast({ title: messages.components.toast.pleaseAuthentication, icon: 'none' })
         useRouter().push('/pages/mine/authentication/index')
         return
       }

+ 6 - 0
packages/app/src/core/libs/messages.ts

@@ -14,4 +14,10 @@ export const messages = {
       attachmentErrorText: '请上传附件',
     },
   },
+  components: {
+    toast: {
+      pleaseLogin: '请先登录',
+      pleaseAuthentication: '请先完成认证',
+    },
+  },
 }