[fix][V]:完善login提交表单操作,完成对接login接口

master
Romesum 5 years ago
parent 368427f8fe
commit 93b03a473f

@ -49,6 +49,7 @@
<script> <script>
import {get, post} from "~/utils"; import {get, post} from "~/utils";
import {showFail, showSuccess} from "~/utils/dialog";
export default { export default {
name: "login", name: "login",
@ -62,12 +63,10 @@
character: [{ character: [{
label: '超级管理员', label: '超级管理员',
value: '3' value: '3'
}, }, {
{
label: '管理员', label: '管理员',
value: '2' value: '2'
}, }, {
{
label: '老师', label: '老师',
value: '1' value: '1'
} }
@ -96,9 +95,17 @@
auth: this.ruleForm.identity, auth: this.ruleForm.identity,
username: this.ruleForm.account, username: this.ruleForm.account,
password: this.ruleForm.psw password: this.ruleForm.psw
}) }).then(res => {
showSuccess("登录成功", this)
// //
await this.$router.push('/teacher') setTimeout(() => {
if (this.ruleForm.identity === '1') this.$router.push('/teacher')
else if (this.ruleForm.identity === '2') this.$router.push('/manager')
else if (this.ruleForm.identity === '3') this.$router.push('/supManager')
}, 1000)
}).catch(e => {
showFail(e.msg, this)
})
} else { } else {
console.log('error submit!!'); console.log('error submit!!');
return false; return false;

Loading…
Cancel
Save