优化游戏实时对局页面样式
This commit is contained in:
@@ -44,12 +44,13 @@ router.beforeEach((to, from, next) => {
|
||||
.join('/')
|
||||
}
|
||||
const config = useConfig()
|
||||
const langCode = config.lang.defaultLang === 'zh' ? 'zh-cn' : config.lang.defaultLang
|
||||
if (to.path in langAutoLoadMap) {
|
||||
loadPath.push(...langAutoLoadMap[to.path as keyof typeof langAutoLoadMap])
|
||||
}
|
||||
let prefix = ''
|
||||
if (isAdminApp(to.fullPath)) {
|
||||
prefix = './backend/' + config.lang.defaultLang
|
||||
prefix = './backend/' + langCode
|
||||
|
||||
// 去除 path 中的 /admin
|
||||
const adminPath = to.path.slice(to.path.indexOf(adminBaseRoutePath) + adminBaseRoutePath.length)
|
||||
@@ -58,7 +59,7 @@ router.beforeEach((to, from, next) => {
|
||||
loadPath.push(prefix + toCamelPath(adminPath) + '.ts')
|
||||
}
|
||||
} else {
|
||||
prefix = './frontend/' + config.lang.defaultLang
|
||||
prefix = './frontend/' + langCode
|
||||
loadPath.push(prefix + to.path + '.ts')
|
||||
}
|
||||
|
||||
@@ -80,7 +81,7 @@ router.beforeEach((to, from, next) => {
|
||||
loadPath = uniq(loadPath)
|
||||
|
||||
for (const key in loadPath) {
|
||||
loadPath[key] = loadPath[key].replaceAll('${lang}', config.lang.defaultLang)
|
||||
loadPath[key] = loadPath[key].replaceAll('${lang}', langCode)
|
||||
if (loadPath[key] in window.loadLangHandle) {
|
||||
window.loadLangHandle[loadPath[key]]().then((res: { default: anyObj }) => {
|
||||
const pathName = loadPath[key].slice(loadPath[key].lastIndexOf(prefix) + (prefix.length + 1), loadPath[key].lastIndexOf('.'))
|
||||
|
||||
Reference in New Issue
Block a user