vue pro change

This commit is contained in:
caoqianming 2020-03-24 09:03:46 +08:00
parent 8073c0fa90
commit 971d77e9ab
3 changed files with 8 additions and 4 deletions

View File

@ -2,5 +2,5 @@
ENV = 'production' ENV = 'production'
# base api # base api
VUE_APP_BASE_API = '/prod-api' # VUE_APP_BASE_API = '/prod-api'
VUE_APP_BASE_API = '/api'

View File

@ -48,8 +48,10 @@ App({
globalData: { globalData: {
userInfo: null, userInfo: null,
userinfo: null, // 服务器传回的消费者信息 userinfo: null, // 服务器传回的消费者信息
host: 'http://127.0.0.1:8000/api/', host: 'https://apitest.ctcshe.com/api/',
mediahost: 'http://127.0.0.1:8000/', mediahost: 'https://apitest.ctcshe.com/',
// host: 'http://127.0.0.1:8000/api/',
// mediahost: 'http://127.0.0.1:8000/',
token : '', token : '',
subject:null, subject:null,
} }

View File

@ -14,6 +14,8 @@ function request(url, method, data) {
wx.hideLoading(); wx.hideLoading();
if (res.data.code >= 200 && res.data.code < 400) { if (res.data.code >= 200 && res.data.code < 400) {
resolve(res.data); resolve(res.data);
}else if(res.data.code == 401){
getApp().onLaunch()
} }
else { else {
wx.showToast({ wx.showToast({