diff --git a/src/common/axios.js b/src/common/axios.js index d72415d2..c569ec79 100644 --- a/src/common/axios.js +++ b/src/common/axios.js @@ -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' diff --git a/src/pages/login.vue b/src/pages/login.vue index b72ac34e..e21bcd4e 100644 --- a/src/pages/login.vue +++ b/src/pages/login.vue @@ -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) }