Commit c067222d by 展昭

err

parent c9a0773f
......@@ -90,10 +90,6 @@ router.beforeEach((to, from, next) => {
setAutoLogin({ autoCode: authcode, redirectPath: toPath })
store.dispatch("signOutOidc")
} else {
console.log('abc');
console.log('to=',to);
console.log('from=',from);
next()
}
}
......
......@@ -42,6 +42,7 @@ async function getToken(access_token, appid) {
)
.catch(err => {
console.log("111err=", err);
window.location.href = '/callback.html?err=' + err.response.data.error_description;
});
}
......
......@@ -44,7 +44,7 @@ export default {
.post(url, qs.stringify(pms))
.then(
res => {
console.log("res=", res);
console.log("123res=", res);
if (res.status == 200) {
const accessToken = res.data.access_token;
//store.dispatch("changeToken", accessToken);
......@@ -53,9 +53,7 @@ export default {
}
},
err => {
console.log("123err=", err);
this.errMessage = err.response.data.error_description;
console.log("this.errMessage=", this.errMessage);
}
)
.catch(err => {
......@@ -65,22 +63,17 @@ export default {
}
},
mounted() {
const err = this.$route.query.err;
if (err) {
this.errMessage = err;
} else {
this.oidcSignInCallback()
.then(redirectPath => {
this.getOidcUser().then(user => {
const appid = localStorage.getItem("appid");
this.getToken(user.access_token, appid, redirectPath);
});
})
.catch(err => {
console.error(err);
//this.$router.push("/oidc-callback-error"); // Handle errors any way you want
this.oidcSignInCallback()
.then(redirectPath => {
this.getOidcUser().then(user => {
const appid = localStorage.getItem("appid");
this.getToken(user.access_token, appid, redirectPath);
});
}
})
.catch(err => {
console.error(err);
//this.$router.push("/oidc-callback-error"); // Handle errors any way you want
});
}
};
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment