1
This commit is contained in:
@@ -1,11 +1,5 @@
|
||||
import { getBreadCrumbList, getHomeRoute } from '../utils/tools'
|
||||
|
||||
// 注意:这里的 paramSetupServer 需要在使用时注入
|
||||
let paramSetupServerInstance = null
|
||||
|
||||
export const setParamSetupServer = (server) => {
|
||||
paramSetupServerInstance = server
|
||||
}
|
||||
import paramSetupServer from '../api/system_high/paramSetupServer'
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
@@ -37,23 +31,20 @@ export default {
|
||||
logoUrl: defaultLogo
|
||||
}
|
||||
|
||||
if (!paramSetupServerInstance) {
|
||||
commit('setSysTitle', formModel)
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
let res1 = await paramSetupServerInstance.getOne('sys_title')
|
||||
if (res1.data) {
|
||||
let res1 = await paramSetupServer.getOne('sys_title')
|
||||
if (res1 && res1.data) {
|
||||
formModel.title = res1.data.value
|
||||
document.title = res1.data.value
|
||||
}
|
||||
let res2 = await paramSetupServerInstance.getOne('sys_logo')
|
||||
if (res2.data) {
|
||||
let res2 = await paramSetupServer.getOne('sys_logo')
|
||||
if (res2 && res2.data) {
|
||||
formModel.logoUrl = res2.data.value
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to get sys title:', error)
|
||||
console.warn('获取系统标题失败,使用默认标题:', error || '接口调用失败')
|
||||
// 使用默认标题
|
||||
document.title = formModel.title
|
||||
}
|
||||
|
||||
commit('setSysTitle', formModel)
|
||||
|
||||
Reference in New Issue
Block a user