🐞 fix: 优化singleSign方法;确保无论成功与否都能重定向到主页
This commit is contained in:
parent
a2ceabb9e9
commit
43e291dd52
|
@ -16,10 +16,8 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
singleSign() {
|
singleSign() {
|
||||||
const { userName, password = "123456" } = this.$route.query;
|
const { userName, password = "123456" } = this.$route.query;
|
||||||
this.$store.dispatch("SingleSign", { userName, password }).then(() => {
|
this.$store.dispatch("SingleSign", { userName, password }).finally(() => {
|
||||||
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
|
this.$router.push({ path: "/" }).catch(()=>{});
|
||||||
}).catch((error) => {
|
|
||||||
console.error(error);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue