From 7c9ff78e7e413e4444168c7b91efc80a6fbf7184 Mon Sep 17 00:00:00 2001
From: Apcallover <1503963513@qq.com>
Date: Wed, 20 Mar 2024 12:08:54 +0800
Subject: [PATCH] =?UTF-8?q?flat:=E6=9A=82=E5=AD=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/index.html | 10 +++++++
src/page/login/userlogin.vue | 52 +++++++++++++-----------------------
vue.config.js | 3 ++-
3 files changed, 31 insertions(+), 34 deletions(-)
diff --git a/public/index.html b/public/index.html
index 5616061..fc9eaf3 100644
--- a/public/index.html
+++ b/public/index.html
@@ -91,6 +91,16 @@
+
diff --git a/src/page/login/userlogin.vue b/src/page/login/userlogin.vue
index 1cbc859..af20a10 100644
--- a/src/page/login/userlogin.vue
+++ b/src/page/login/userlogin.vue
@@ -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];
// // 临时指定域名,方便测试
diff --git a/vue.config.js b/vue.config.js
index 7457695..280ea46 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -26,8 +26,9 @@ module.exports = {
// target: 'http://localhost:8000', // 本地服务接口地址
// target: "http://39.98.184.58:8000", // 阿里云后台地址
// target: "http://192.168.3.104:8000", // 本地
- target: 'http://192.168.3.120:8000',
+ // target: 'http://192.168.1.106:8000',
// target: 'http://192.168.3.173:8000',
+ target: 'http://10.165.0.173:8000',
ws: true,
changeOrigin: true,
pathRewrite: {