mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-04 23:18:44 +08:00
dashboard配置支持保存入库
This commit is contained in:
+19
-2
@@ -66,6 +66,24 @@ async function fetchOTP() {
|
||||
})
|
||||
}
|
||||
|
||||
// 加载用户监控面板配置
|
||||
async function loadDashboardConfig() {
|
||||
const response = await api.get('/user/config/Dashboard')
|
||||
if (response && response.data && response.data.value) {
|
||||
const data = JSON.stringify(response.data.value)
|
||||
if (data != localStorage.getItem("MP_DASHBOARD")) {
|
||||
localStorage.setItem("MP_DASHBOARD", data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function afterLogin() {
|
||||
// 加载用户监控面板配置
|
||||
await loadDashboardConfig()
|
||||
// 跳转到首页或回原始页面
|
||||
router.push(store.state.auth.originalPath ?? '/')
|
||||
}
|
||||
|
||||
// 登录获取token事件
|
||||
function login() {
|
||||
errorMessage.value = ''
|
||||
@@ -103,8 +121,7 @@ function login() {
|
||||
store.dispatch('auth/updateUserName', username)
|
||||
store.dispatch('auth/updateAvatar', avatar)
|
||||
|
||||
// 跳转到首页或回原始页面
|
||||
router.push(store.state.auth.originalPath ?? '/')
|
||||
afterLogin()
|
||||
})
|
||||
.catch((error: any) => {
|
||||
// 登录失败,显示错误提示
|
||||
|
||||
Reference in New Issue
Block a user