12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- import { useUserStore } from '../store'
- import { storeToRefs } from 'pinia'
- import { computed } from 'vue'
- import { path } from 'node:path'
- export const usePermissions = () => {
- const userStore = useUserStore()
- const { isLogined, isDesigner, userInfo } = storeToRefs(userStore)
- const routes = [
- { path: '/pages/mine/homepage/index', meta: { canNotLogin: false, canNotDesigner: true } },
- {
- path: '/pages/material/mini-class/index',
- meta: { canNotLogin: false, canNotDesigner: true, toLogin: true },
- },
- {
- path: '/pages/material/recommend/index',
- meta: { canNotLogin: false, canNotDesigner: false, toLogin: true },
- },
- {
- path: '/pages/publish/moment/index',
- meta: { canNotLogin: false, canNotDesigner: false, toLogin: true },
- },
- {
- path: '/pages/messages/index',
- meta: { canNotLogin: false, canNotDesigner: true, toLogin: true },
- },
- {
- path: '/pages/mine/setting/index',
- meta: { canNotLogin: false, canNotDesigner: true, toLogin: true },
- },
- {
- path: '/pages/mine/homepage/statistics/index',
- meta: { canNotLogin: false, canNotDesigner: true, toLogin: true },
- },
- {
- path: '/pages/mine/points/index',
- meta: { canNotLogin: false, canNotDesigner: true, toLogin: true },
- },
- {
- path: '/pages/mine/coupons/index',
- meta: { canNotLogin: false, canNotDesigner: true, toLogin: true },
- },
- {
- path: '/pages/mine/orders/index',
- meta: { canNotLogin: false, canNotDesigner: true, toLogin: true },
- },
- {
- path: '/pages/mine/agents/index',
- meta: { canNotLogin: false, canNotDesigner: true, toLogin: true },
- },
- {
- path: '/pages/mine/invite/index',
- meta: { canNotLogin: false, canNotDesigner: false, toLogin: true },
- },
- {
- path: '/pages/mall/confirm-order/index',
- meta: { canNotLogin: false, canNotDesigner: true, toLogin: true },
- },
- ]
- const features = computed(() => ({
- /**
- * 1分钟了解筑巢荟
- */
- about: isDesigner.value,
- toDesignerHomePage: isLogined.value,
- checkInAtStoreTask: isDesigner.value,
- shareMoment: isLogined.value && isDesigner.value && userInfo.value.level.level > 1,
- /**
- * 微信代运营兑换
- */
- // wechatAgentExchange: isLogined.value,
- /**
- * 案例拍摄兑换
- */
- }))
- return { isLogined, isDesigner, routes, features }
- }
|