mirror of
https://gitee.com/wonderful-code/buildadmin
synced 2024-11-21 22:55:36 +00:00
refactor:管理员登录接口返回的路由路径使用的字面量改为变量
This commit is contained in:
parent
ea524c542d
commit
bcb72e4d86
@ -102,8 +102,7 @@ class Index extends Backend
|
||||
$res = $this->auth->login($username, $password, (bool)$keep);
|
||||
if ($res === true) {
|
||||
$this->success(__('Login succeeded!'), [
|
||||
'userInfo' => $this->auth->getInfo(),
|
||||
'routePath' => '/admin'
|
||||
'userInfo' => $this->auth->getInfo()
|
||||
]);
|
||||
} else {
|
||||
$msg = $this->auth->getError();
|
||||
|
@ -86,6 +86,7 @@ import router from '/@/router'
|
||||
import clickCaptcha from '/@/components/clickCaptcha'
|
||||
import toggleDark from '/@/utils/useDark'
|
||||
import { fullUrl } from '/@/utils/common'
|
||||
import { adminBaseRoutePath } from '/@/router/static/adminBase'
|
||||
let timer: number
|
||||
|
||||
const config = useConfig()
|
||||
@ -161,7 +162,7 @@ const onSubmit = (captchaInfo = '') => {
|
||||
login('post', form)
|
||||
.then((res) => {
|
||||
adminInfo.dataFill(res.data.userInfo)
|
||||
router.push({ path: res.data.routePath })
|
||||
router.push({ path: adminBaseRoutePath })
|
||||
})
|
||||
.finally(() => {
|
||||
state.submitLoading = false
|
||||
|
Loading…
Reference in New Issue
Block a user