This commit is contained in:
2024-12-20 14:41:32 +08:00
parent 9a9a08b7ca
commit ee1ae711f5
4 changed files with 54 additions and 5 deletions

View File

@@ -34,7 +34,7 @@ const { title } = useNav();
const ruleForm = reactive({
username: "admin",
password: "admin123"
password: "comcat@2019"
});
const onLogin = async (formEl: FormInstance | undefined) => {
@@ -45,10 +45,22 @@ const onLogin = async (formEl: FormInstance | undefined) => {
useUserStoreHook()
.loginByUsername({
username: ruleForm.username,
password: ruleForm.password
password: ruleForm.password,
isBackendUser: 1
})
.then(res => {
if (res.success) {
console.log(res);
console.log("res.status = " + res.status);
console.log("res.success = " + res.success);
// if (res.success) {
console.info(typeof res.status);
if (res.status) {
console.log(res.status);
} else {
console.info(res);
console.error("res.status is undefined");
}
if (res.status === 200) {
// 获取后端路由
return initRouter().then(() => {
router.push(getTopMenu(true).path).then(() => {