flat: 修改登录

This commit is contained in:
史典卓
2024-10-09 15:48:24 +08:00
parent 706bd14f44
commit 487ec6cefb
2 changed files with 27 additions and 27 deletions

View File

@@ -56,21 +56,21 @@ import topLang from "@/page/index/top/top-lang";
// import { info } from "@/api/system/tenant"; // import { info } from "@/api/system/tenant";
import {getCaptcha} from "@/api/user"; import {getCaptcha} from "@/api/user";
console.log('是否跳转', /(^http)(s?):\/\/([a-z0-9].+)\/manage(\/)?$/i.test(location.href), location.href) // console.log('是否跳转', /(^http)(s?):\/\/([a-z0-9].+)\/manage(\/)?$/i.test(location.href), location.href)
if (/(^http)(s?):\/\/([a-z0-9].+)\/manage(\/)?$/i.test(location.href)) { // if (/(^http)(s?):\/\/([a-z0-9].+)\/manage(\/)?$/i.test(location.href)) {
window.location.href = process.env.VUE_APP_LOGIN_NEXT // window.location.href = process.env.VUE_APP_LOGIN_NEXT
} // }
if (/(\/login\?)(.*)/ig.test(location.href)) { // if (/(\/login\?)(.*)/ig.test(location.href)) {
const obj = {} // const obj = {}
const query = location.href.split('?')[1].replace(/\?/, '').split('&') // const query = location.href.split('?')[1].replace(/\?/, '').split('&')
query.forEach((item) => { // query.forEach((item) => {
const a = item.split('='); // const a = item.split('=');
obj[a[0]] = a[1] // obj[a[0]] = a[1]
}) // })
window.sessionStorage.setItem('query_session', JSON.stringify(obj)) // window.sessionStorage.setItem('query_session', JSON.stringify(obj))
} else { // } else {
window.sessionStorage.removeItem('query_session') // window.sessionStorage.removeItem('query_session')
} // }
export default { export default {
name: "login", name: "login",
@@ -115,17 +115,17 @@ export default {
watch: {}, watch: {},
created() { created() {
// this.getTenant(); // this.getTenant();
const {ticket} = JSON.parse(window.sessionStorage.getItem('query_session') || "{}") // const {ticket} = JSON.parse(window.sessionStorage.getItem('query_session') || "{}")
window.sessionStorage.removeItem('query_session') // window.sessionStorage.removeItem('query_session')
console.log(ticket) // if (ticket) {
if (ticket) { // this.proLoading = true
this.proLoading = true // this.ticket = ticket
this.ticket = ticket // this.handleLogin()
this.handleLogin() // } else {
} else { // console.log('刷新1')
console.log('刷新1') // this.refreshCode();
this.refreshCode(); // }
} this.refreshCode();
}, },
mounted() { mounted() {
}, },

View File

@@ -24,7 +24,7 @@ module.exports = {
port: 1888, port: 1888,
proxy: { proxy: {
"/api": { "/api": {
target: 'http://10.165.0.173:8000', target: 'http://39.98.184.58:8000',
ws: true, ws: true,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {