소스 검색

task 45202 大屏调整

dev
庞东旭 2 일 전
부모
커밋
057007c4ad
3개의 변경된 파일62개의 추가작업 그리고 5개의 파일을 삭제
  1. +2
    -2
      src/router/index.js
  2. +10
    -1
      src/utils/request.js
  3. +50
    -2
      src/views/login/index.js

+ 2
- 2
src/router/index.js 파일 보기

@@ -46,8 +46,8 @@ const routes = [
];

const router = new VueRouter({
routes
// mode: 'history'
routes,
mode: 'history'
});

export default router;

+ 10
- 1
src/utils/request.js 파일 보기

@@ -63,7 +63,16 @@ service.interceptors.response.use(res => {
}
).then(() => {
store.dispatch('LogOut').then(() => {
location.href = '/index';
try {
const targetPath = window.location.pathname;
console.log(window.location)
if(targetPath)
location.href = '/login?redirect=' + encodeURIComponent(targetPath);
else
location.href = '/index';
} catch(e) {
location.href = '/index';
}
})
})
} else if (code === 500) {


+ 50
- 2
src/views/login/index.js 파일 보기

@@ -31,8 +31,56 @@ export default {
code: [{ required: true, trigger: "blur", message: "验证码不能为空" }],
// smsCode: [{ required: true, trigger: "blur", message: "验证码不能为空" }]
},
redirect: undefined,
};
},
watch: {
$route: {
handler: function (route) {
this.redirect = route.query && route.query.redirect;
console.log(route)
if (route.query && route.query.code && route.query.exiturl) {
let obj = {
code: route.query.code,
};
this.singleLoading = true;
this.$store
.dispatch("SingleLogin", obj)
.then((res) => {
Cookies.set("singleUrl", route.query.exiturl, { expires: 30 });
this.singleLoading = false;
if (this.viewChecked == true) {
this.$router.push({ path: "/viewPages/profile" });
} else {
if (res && res.code && res.code == 200) {
let requireUpdatePassword = res.requireUpdatePassword;
if (requireUpdatePassword) {
//重置密码
this.$set(this.resetPwd, "open", true);
} else {
this.$router
.push({ path: this.redirect || "/" })
.catch(() => {});
}
}
}
})
.catch((error) => {
const errorString = error + "";
this.loading = false;
if (errorString.indexOf("证书无效") > -1) {
loginError().then((res) => {
this.upload.open = true;
this.upload.loginJson = res.msg;
});
}
this.singleLoading = false;
});
}
},
immediate: true,
},
},
computed: {
},
created () {
@@ -136,8 +184,8 @@ export default {
//重置密码
this.$set(this.resetPwd, "open", true);
} else {
this.$router
.push({ path: this.redirect || "/nav" })
console.log(this.redirect + 11111111111);
this.$router.push({ path: this.redirect || "/nav" })
}
}
}


불러오는 중...
취소
저장