mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2026-01-20 16:53:37 +08:00
Merge branch 'main' into perf/tailwindcss-class
This commit is contained in:
@@ -73,23 +73,21 @@ const onLogin = async (formEl: FormInstance | undefined) => {
|
||||
username: ruleForm.username,
|
||||
password: ruleForm.password
|
||||
})
|
||||
.then(res => {
|
||||
if (res.success) {
|
||||
// 获取后端路由
|
||||
return initRouter().then(() => {
|
||||
disabled.value = true;
|
||||
router
|
||||
.push(getTopMenu(true).path)
|
||||
.then(() => {
|
||||
message(t("login.pureLoginSuccess"), { type: "success" });
|
||||
})
|
||||
.finally(() => (disabled.value = false));
|
||||
});
|
||||
} else {
|
||||
message(t("login.pureLoginFail"), { type: "error" });
|
||||
}
|
||||
.then(async () => {
|
||||
// 获取后端路由
|
||||
await initRouter();
|
||||
disabled.value = true;
|
||||
router.push(getTopMenu(true).path).then(() => {
|
||||
message(t("login.pureLoginSuccess"), { type: "success" });
|
||||
});
|
||||
})
|
||||
.finally(() => (loading.value = false));
|
||||
.catch(_err => {
|
||||
message(t("login.pureLoginFail"), { type: "error" });
|
||||
})
|
||||
.finally(() => {
|
||||
disabled.value = false;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user