3 Коміти 49074e8872 ... f8cd3682b0

Автор SHA1 Опис Дата
  EvilDragon f8cd3682b0 fix: .. 1 місяць тому
  EvilDragon 7d1e53d70f Merge remote-tracking branch 'own/main' into main 1 місяць тому
  EvilDragon b74552ef34 feat: 添加登录和认证提示信息,优化权限逻辑 1 місяць тому

+ 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: '请先完成认证',
+    },
+  },
 }