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