|
@@ -45,7 +45,7 @@ import { useRouter } from "vue-router";
|
|
import loginLogo from "@/assets/login/login_logo.png";
|
|
import loginLogo from "@/assets/login/login_logo.png";
|
|
import qiyeweixin from "@/assets/login/qiyeweixin.png";
|
|
import qiyeweixin from "@/assets/login/qiyeweixin.png";
|
|
import { UserFilled, Lock } from '@element-plus/icons-vue'
|
|
import { UserFilled, Lock } from '@element-plus/icons-vue'
|
|
-import type { FormInstance, FormRules } from 'element-plus'
|
|
|
|
|
|
+import { ElMessage, type FormInstance, type FormRules } from 'element-plus'
|
|
import { useStore } from '@/store/index'
|
|
import { useStore } from '@/store/index'
|
|
import { post } from "@/utils/request";
|
|
import { post } from "@/utils/request";
|
|
import { LOGIN } from "./api";
|
|
import { LOGIN } from "./api";
|
|
@@ -75,11 +75,26 @@ const login = (formEl: FormInstance | undefined) => {
|
|
console.log(ruleForm.value);
|
|
console.log(ruleForm.value);
|
|
post(LOGIN, { ...ruleForm.value }).then(res => {
|
|
post(LOGIN, { ...ruleForm.value }).then(res => {
|
|
console.log(res);
|
|
console.log(res);
|
|
|
|
+ if(res.code == 'error') {
|
|
|
|
+ ElMessage.error({
|
|
|
|
+ message: "登录失败",
|
|
|
|
+ type: "error",
|
|
|
|
+ duration: 2000,
|
|
|
|
+ })
|
|
|
|
+ loginLoading.value = false;
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ ElMessage.success({
|
|
|
|
+ message: "登录成功",
|
|
|
|
+ type: "success",
|
|
|
|
+ duration: 2000,
|
|
|
|
+ })
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
loginLoading.value = false;
|
|
loginLoading.value = false;
|
|
}, 1000)
|
|
}, 1000)
|
|
// loginLoading.value = false;
|
|
// loginLoading.value = false;
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
|
|
+ console.log(err);
|
|
loginLoading.value = false;
|
|
loginLoading.value = false;
|
|
})
|
|
})
|
|
return
|
|
return
|