Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-lab
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-lab
Commits
40e3ffa1
提交
40e3ffa1
authored
9月 23, 2026
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 更新useAppConfig函数,支持从localStorage获取用户信息并动态配置应用标题
上级
2279cb6c
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
8 行增加
和
6 行删除
+8
-6
useAppConfig.ts
src/composables/useAppConfig.ts
+5
-5
user.ts
src/stores/user.ts
+2
-0
axios.ts
src/utils/axios.ts
+1
-1
没有找到文件。
src/composables/useAppConfig.ts
浏览文件 @
40e3ffa1
import
{
urls
}
from
'@/utils/env'
import
{
urls
}
from
'@/utils/env'
import
{
useUserStore
}
from
'@/stores/user'
export
function
useAppConfig
(
hasUser
=
true
)
{
export
function
useAppConfig
()
{
const
appConfigList
=
[
const
appConfigList
=
[
{
{
system
:
'dml'
,
system
:
'dml'
,
...
@@ -183,9 +182,10 @@ export function useAppConfig(hasUser = true) {
...
@@ -183,9 +182,10 @@ export function useAppConfig(hasUser = true) {
const
appConfig
=
found
||
appConfigList
[
0
]
const
appConfig
=
found
||
appConfigList
[
0
]
const
config
=
{
...
appConfig
}
const
config
=
{
...
appConfig
}
if
(
hasUser
)
{
const
user
=
localStorage
.
getItem
(
'user'
)
const
mobile
=
useUserStore
().
user
?.
mobile
if
(
user
)
{
if
(
mobile
&&
digitalFinanceMarketingMobiles
.
has
(
mobile
))
{
const
userInfo
=
JSON
.
parse
(
user
)
if
(
userInfo
?.
mobile
&&
digitalFinanceMarketingMobiles
.
has
(
userInfo
.
mobile
))
{
config
.
title
=
'数字金融营销平台'
config
.
title
=
'数字金融营销平台'
}
}
}
}
...
...
src/stores/user.ts
浏览文件 @
40e3ffa1
...
@@ -40,11 +40,13 @@ export const useUserStore = defineStore('user', {
...
@@ -40,11 +40,13 @@ export const useUserStore = defineStore('user', {
this
.
project
=
project
this
.
project
=
project
this
.
roles
=
roles
this
.
roles
=
roles
this
.
permissions
=
permissions
this
.
permissions
=
permissions
localStorage
.
setItem
(
'user'
,
JSON
.
stringify
(
info
))
await
useMapStore
().
getMapList
()
await
useMapStore
().
getMapList
()
},
},
async
logout
()
{
async
logout
()
{
await
logout
()
await
logout
()
this
.
user
=
null
this
.
user
=
null
localStorage
.
removeItem
(
'user'
)
},
},
},
},
})
})
src/utils/axios.ts
浏览文件 @
40e3ffa1
...
@@ -3,7 +3,7 @@ import { ElMessage } from 'element-plus'
...
@@ -3,7 +3,7 @@ import { ElMessage } from 'element-plus'
import
router
from
'@/router'
import
router
from
'@/router'
import
{
useAppConfig
}
from
'@/composables/useAppConfig'
import
{
useAppConfig
}
from
'@/composables/useAppConfig'
import
{
urls
}
from
'@/utils/env'
import
{
urls
}
from
'@/utils/env'
const
appConfig
=
useAppConfig
(
false
)
const
appConfig
=
useAppConfig
()
const
httpRequest
=
axios
.
create
({
const
httpRequest
=
axios
.
create
({
withCredentials
:
true
,
withCredentials
:
true
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论