Commit 29b66689 by 展昭

err page = call back page

parent aa40f9fb
Showing with 25 additions and 13 deletions
......@@ -38,11 +38,19 @@ async function getToken(access_token, appid) {
},
err => {
console.log("789err=", err);
this.$router.push({
name: "oidcCallback",
query: { err: err.response.data.error_description }
});
}
)
.catch(err => {
console.log("111err=", err);
//this.$router.push("/oidc-callback-error"); // Handle errors any way you want
this.$router.push({
name: "oidcCallback",
query: { err: err.response.data.error_description }
});
});
}
......
......@@ -46,7 +46,6 @@ export default {
res => {
console.log("res=", res);
if (res.status == 200) {
const accessToken = res.data.access_token;
//store.dispatch("changeToken", accessToken);
localStorage.setItem("token", accessToken);
......@@ -56,7 +55,7 @@ export default {
err => {
console.log("123err=", err);
this.errMessage = err.response.data.error_description;
console.log('this.errMessage=',this.errMessage);
console.log("this.errMessage=", this.errMessage);
}
)
.catch(err => {
......@@ -66,17 +65,22 @@ export default {
}
},
mounted() {
this.oidcSignInCallback()
.then(redirectPath => {
this.getOidcUser().then(user => {
const appid = localStorage.getItem("appid");
this.getToken(user.access_token, appid, redirectPath);
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
});
})
.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