Files
gloabl_award_front/src/router/router-config.ts

20 lines
447 B
TypeScript
Raw Normal View History

2026-02-06 15:10:17 +08:00
import router from './index'
router.beforeEach((to, from, next) => {
const path = to.path
const list = {
2026-04-20 17:18:35 +08:00
cn: 'CHINESE_SIMPLIFIED',
en: 'ENGLISH'
}
2026-04-20 17:18:35 +08:00
if (path.startsWith('/cn') || (to.params.lang === 'cn')) {
localStorage.setItem('loginLanguage', 'CHINESE_SIMPLIFIED')
} else if (path.startsWith('/en') || (to.params.lang === 'en')) {
localStorage.setItem('loginLanguage', 'ENGLISH')
}
next()
2026-02-06 15:10:17 +08:00
})
router.afterEach(() => {
})