flat:暂存

This commit is contained in:
Apcallover
2024-03-20 12:08:54 +08:00
parent 8aa0db2fd3
commit 7c9ff78e7e
3 changed files with 31 additions and 34 deletions

View File

@@ -100,15 +100,12 @@ export default {
},
created () {
// this.getTenant();
const {username, password} = this.$route.query
console.log(username, password)
const {username, password } = JSON.parse(window.sessionStorage.getItem('query_session'))
if(username && password) {
this.proLoading = true
this.loginForm.username = username
this.loginForm.password = password
this.$nextTick(() => {
this.handleLogin()
})
this.handleLogin()
} else {
this.refreshCode();
}
@@ -137,41 +134,30 @@ export default {
},
handleLogin () {
if(this.proLoading) {
const loading = this.$loading({
lock: true,
text: '登录中,请稍后。。。',
spinner: "el-icon-loading"
});
this.$store.dispatch("LoginByUsername", {
...this.loginForm, code: '0000'
}).then(() => {
this.$store.dispatch('jlHelpShow', false)
this.$router.push({ path: this.tagWel.value });
loading.close();
}).catch(() => {
loading.close();
this.refreshCode();
});
this.ByUsernameCallback()
return
}
this.$refs.loginForm.validate(valid => {
if (valid) {
const loading = this.$loading({
lock: true,
text: '登录中,请稍后。。。',
spinner: "el-icon-loading"
});
this.$store.dispatch("LoginByUsername", this.loginForm).then(() => {
this.$store.dispatch('jlHelpShow', false)
this.$router.push({ path: this.tagWel.value });
loading.close();
}).catch(() => {
loading.close();
this.refreshCode();
});
this.ByUsernameCallback()
}
});
},
ByUsernameCallback() {
const loading = this.$loading({
lock: true,
text: '登录中,请稍后。。。',
spinner: "el-icon-loading"
});
this.$store.dispatch("LoginByUsername", this.loginForm).then(() => {
this.$store.dispatch('jlHelpShow', false)
this.$router.push({ path: this.tagWel.value });
loading.close();
}).catch(() => {
loading.close();
this.refreshCode();
});
}
// getTenant () {
// let domain = window.location.href.split("/#/")[0];
// // 临时指定域名,方便测试