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