|
|
@@ -334,14 +334,12 @@ export default {
|
|
|
this.$apis.loginAPI(params)
|
|
|
.then((res) => {
|
|
|
if (res.data.code === 0) {
|
|
|
- console.log(res);
|
|
|
if (this.rememberMe) {
|
|
|
localStorage.phone = this.cardForm.phone;
|
|
|
localStorage.password = this.cardForm.password;
|
|
|
localStorage.rememberMe = this.rememberMe;
|
|
|
this.st="true";//修改登录状态为true
|
|
|
localStorage.setItem("s",this.st);
|
|
|
- console.log(localStorage);
|
|
|
} else {
|
|
|
localStorage.removeItem("rememberMe");
|
|
|
localStorage.removeItem("phone");
|
|
|
@@ -362,7 +360,11 @@ export default {
|
|
|
if (this.$route.params.login_to) {
|
|
|
this.$router.push(String(this.$route.params.login_to));
|
|
|
} else {
|
|
|
- this.$router.push("/portal");
|
|
|
+ if(res.data.data.user.role === "ADMIN"){
|
|
|
+ this.$router.push("/root");
|
|
|
+ }else{
|
|
|
+ this.$router.push("/portal");
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
let p = new Promise(function (resolve, reject) {
|