代理设置,工具优化
This commit is contained in:
@@ -15,7 +15,7 @@ instance.interceptors.request.use(config => {
|
|||||||
} else if (/AppCountryAlbum/.test(location.pathname) || config.module == 'AppCountryAlbum') {
|
} else if (/AppCountryAlbum/.test(location.pathname) || config.module == 'AppCountryAlbum') {
|
||||||
config.baseURL = '/aca'
|
config.baseURL = '/aca'
|
||||||
config.url = config.url.replace(/(app|auth|admin)\//, "api/")
|
config.url = config.url.replace(/(app|auth|admin)\//, "api/")
|
||||||
} else if (/\/project\/beta\//.test(location.pathname)) {
|
} else if (/\/project\/beta\//.test(location.pathname) || config.module == 'wangge') {
|
||||||
config.baseURL = '/wangge'
|
config.baseURL = '/wangge'
|
||||||
} else if (/\/project\/police\//.test(location.pathname) || config.module == 'hnjc') {
|
} else if (/\/project\/police\//.test(location.pathname) || config.module == 'hnjc') {
|
||||||
config.baseURL = '/hnjc'
|
config.baseURL = '/hnjc'
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ export default {
|
|||||||
return decodeURIComponent(this.$route.query.back) || ""
|
return decodeURIComponent(this.$route.query.back) || ""
|
||||||
},
|
},
|
||||||
currentApp() {
|
currentApp() {
|
||||||
return this.apps.find(e => this.target.indexOf(e.libPath) > -1) || {}
|
let path = this.target.replace(/(.+)[\\\/][^\\\/]+\?.*/, '$1')
|
||||||
|
return this.apps.find(e => e.libPath.indexOf(path) > -1) || {}
|
||||||
},
|
},
|
||||||
appPath() {
|
appPath() {
|
||||||
return this.currentApp?.label || ""
|
return this.currentApp?.label || ""
|
||||||
@@ -50,12 +51,15 @@ export default {
|
|||||||
handleLogin() {
|
handleLogin() {
|
||||||
this.$refs.loginForm.validate(v => {
|
this.$refs.loginForm.validate(v => {
|
||||||
if (v) {
|
if (v) {
|
||||||
let {name: module,libPath} = this.currentApp
|
let {name: module, libPath} = this.currentApp,
|
||||||
if(/\/project\/police\//.test(libPath)){
|
corpId = 'ww596787bb70f08288'
|
||||||
|
if (/\/project\/police\//.test(libPath)) {
|
||||||
module = 'hnjc'
|
module = 'hnjc'
|
||||||
|
} else if (/\/project\/beta\//.test(libPath)) {
|
||||||
|
corpId = 'ww2a667717a70164f1'
|
||||||
|
module = 'wangge'
|
||||||
}
|
}
|
||||||
this.getToken({...this.form, module, corpId: 'ww596787bb70f08288'}).then(() => {
|
this.getToken({...this.form, module, corpId}).then(() => {
|
||||||
// this.getToken({...this.form, module, corpId: 'wpytYEDgAAcpXjmlYkYwKO60JDGDWrXg'}).then(() => {
|
|
||||||
this.target ? uni.reLaunch({url: this.target}) : uni.navigateBack({})
|
this.target ? uni.reLaunch({url: this.target}) : uni.navigateBack({})
|
||||||
}).catch(() => 0)
|
}).catch(() => 0)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user