Skip to content

Commit e81f11c

Browse files
authored
feat: change default router link (#2613)
* feat: change default router link * feat: change default router link
1 parent 455668d commit e81f11c

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

examples/sites/src/router.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { createRouter, createWebHistory } from 'vue-router'
22
import Layout from '@/views/layout/layout.vue'
3-
import { LANG_KEY, LANG_PATH_MAP, ZH_CN_LANG, CURRENT_THEME_KEY, THEME_ROUTE_MAP, SMB_THEME } from './const'
4-
import { $local } from './tools/storage'
3+
import { LANG_PATH_MAP, ZH_CN_LANG, THEME_ROUTE_MAP, DEFAULT_THEME } from './const'
54

65
const Components = () => import('@/views/components/components.vue')
76
const Docs = () => import('@/views/docs/docs.vue')
@@ -35,10 +34,8 @@ let routes = [
3534
{
3635
path: '/:pathMatch(.*)*',
3736
redirect: () => {
38-
const lang = $local[LANG_KEY]
39-
const langPath = LANG_PATH_MAP[lang] || LANG_PATH_MAP[ZH_CN_LANG]
40-
const themeKey = localStorage.getItem(CURRENT_THEME_KEY)
41-
const theme = THEME_ROUTE_MAP[themeKey] || THEME_ROUTE_MAP[SMB_THEME]
37+
const langPath = LANG_PATH_MAP[ZH_CN_LANG]
38+
const theme = THEME_ROUTE_MAP[DEFAULT_THEME]
4239
return { path: `${context}${langPath}/${theme}/overview` }
4340
}
4441
}

0 commit comments

Comments
 (0)