|
@@ -2,10 +2,11 @@ import router from './router'
|
|
|
import { useNProgress } from '@/hooks/web/useNProgress'
|
|
|
import { useTitle } from '@/hooks/web/useTitle'
|
|
|
import { getToken, getIsEnterprise } from '@/utils/auth'
|
|
|
-import { useDictStore } from '@/store/dict'
|
|
|
+// import { useDictStore } from '@/store/dict'
|
|
|
import { useUserStore } from '@/store/user'
|
|
|
import Confirm from '@/plugins/confirm'
|
|
|
import dialogExtend from '@/plugins/dialogExtend'
|
|
|
+import { useMallStore } from '@/store/mall'
|
|
|
|
|
|
const { start, done } = useNProgress()
|
|
|
// loginType:1.enterprise: 企业路由
|
|
@@ -14,6 +15,12 @@ const { start, done } = useNProgress()
|
|
|
// 3.personalCommon: 无需登录也能访问的页面
|
|
|
// 路由守卫
|
|
|
router.beforeEach(async (to, from, next) => {
|
|
|
+ // 获取商城装修模版
|
|
|
+ const mallStore = useMallStore()
|
|
|
+ if (!localStorage.getItem('mallTemplate')) {
|
|
|
+ await mallStore.getMallDiyTemplate()
|
|
|
+ }
|
|
|
+
|
|
|
localStorage.setItem('routerTest', to.path) // 本地环境保存代码热更新会导致路径缺失问题
|
|
|
const tokenIndex = getIsEnterprise() ? 1: 2
|
|
|
start()
|