Commit 29b66689 by 展昭

err page = call back page

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