diff --git a/src/App.vue b/src/App.vue index 4cb30209..5f7fbfe9 100644 --- a/src/App.vue +++ b/src/App.vue @@ -24,8 +24,6 @@ export default { initDev() { let baseURL = 'http://192.168.1.87:9000' this.getConfig({baseURL}) - - // this.$store.commit('login', 'bearer 88dd207a-dfe3-4f81-b9bd-e379de427d0b') }, initConfig() { if (process.env.NODE_ENV == 'development') this.initDev() diff --git a/src/common/axios.js b/src/common/axios.js index 9df38602..7ddf7cf3 100644 --- a/src/common/axios.js +++ b/src/common/axios.js @@ -1,8 +1,8 @@ import axios from 'axios' import store from '../store' -import util from "./util"; let instance = axios.create({ + baseURL: process.env.NODE_ENV === "production" ? "/" : "/lan", timeout: 600000, withCredentials: true, }) @@ -23,27 +23,7 @@ instance.interceptors.response.use(res => { return res.data } else if (res.data.code == 401) { store.commit("logout"); - let reg = new RegExp('.*code=(.+$)', "g") - if (reg.test(location.search)) { - let code = location.search.replace(reg, '$1') - store.commit('bindAccount', { - code, then: res => { - store.commit("login", [res?.token_type, res?.access_token].join(" ").trim()) - location.href = location.href.replace('code=' + code, '') - } - }) - } else util.confirm("用户信息验证失效,是否要重新登录?").then(() => { - store.commit('redirectCode') - // let app = store.state.apps?.find(e => location.href.indexOf(e.path) > -1) - // const goto = path => { - // location.href = location.origin + "/pages/loading?" + path - // } - // if (app) { - // goto(location.search + `&app=${app.key}`) - // } else { - // goto(location.search + `#error`) - // } - }).catch(() => 0) + uni.navigateTo({url: "/pages/login"}) } else { console.error(res.data.msg || "请求失败!") return Promise.reject(res.data.msg) diff --git a/src/main.js b/src/main.js index d81cdce7..f4dbc2ab 100644 --- a/src/main.js +++ b/src/main.js @@ -9,7 +9,6 @@ import mixin from './uview/libs/mixin/mixin'; Vue.config.productionTip = false; Vue.prototype.$store = store; //初始化接口工具类 -axios.defaults.baseURL = store.state.baseURL; Vue.prototype.$http = axios; Vue.prototype.$cdn = 'https://cdn.cunwuyun.cn/dvcp/h5/'; Vue.prototype.imgHomeUrl = 'https://cdn.cunwuyun.cn/dvcp/h5/home/'; diff --git a/src/manifest.json b/src/manifest.json index 660cbdb0..d837c157 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,6 +1,6 @@ { - "name": "dv_cp_weixin", - "description": "企业微信应用", + "name": "dv-sass-app", + "description": "企业微信应用库", "versionName": "1.0.0", "versionCode": "100", "transformPx": true, @@ -25,7 +25,16 @@ }, "devServer": { "disableHostCheck": true, - "port": "10323" + "port": "10323", + "proxy": { + "/lan": { + "target": "http://192.168.1.87:9000", + "changeOrigin": true, + "pathRewrite": { + "^/lan": "/" + } + } + } }, "optimization": { "preload": true, diff --git a/src/pages/interview/interview.vue b/src/pages/interview/interview.vue index 1641a8bc..d549c725 100644 --- a/src/pages/interview/interview.vue +++ b/src/pages/interview/interview.vue @@ -1,5 +1,5 @@