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