diff --git a/App.vue b/App.vue index e711b4f..0bc8bfb 100644 --- a/App.vue +++ b/App.vue @@ -3,19 +3,17 @@ onLaunch: function() { const token = { loginName: uni.getStorageSync('loginName'), - secretKey: uni.getStorageSync('secretKey'), + secretKey: uni.getStorageSync('Gs-Token'), } if (token.secretKey){ uni.reLaunch({ url: '/pages/homeIndex/index' }) - console.log(token.secretKey,'App Launch') } else { uni.reLaunch({ url: '/pages/login/login' // url:'/pages/mypage/mypage' }) - console.log(token.secretKey,'App Launch2') } }, diff --git a/main.js b/main.js index 24a919d..919c552 100644 --- a/main.js +++ b/main.js @@ -6,28 +6,11 @@ import App from './App' import { $http } from '@escook/request-miniprogram' - Vue.config.productionTip = false uni.$http = $http -// $http.baseUrl = 'http://local.gunshiiot.com:18083' $http.baseUrl = 'http://local.gunshiiot.com:18083' // 请求拦截器 -$http.beforeRequest = function(options) { - // uni.showLoading({ - // title: '数据加载中' - // }) - // if ( - // options.url.indexOf('/gunshiApp/xfflood/doLogin') == -1 - // && options.url.indexOf('/gunshiApp/xfflood/getLoginInfo') == -1 - // && options.url.indexOf('/gunshiApp/xfflood/my/info/getByUserId') == -1 - // && options.url.indexOf('/gunshiApp/xfflood/bzProjectManipulationRecord/file/get/') == -1 - // ) { - // // uni.showLoading({ - // // title: '数据加载中' - // // }) - // } - - +$http.beforeRequest = function (options) { if (options.url.indexOf('/doLogin') == -1) { options.header = { 'Authorization': 'Bearer ' + uni.getStorageSync('Gs-Token') @@ -35,10 +18,15 @@ $http.beforeRequest = function(options) { } } // 响应拦截器 -$http.afterRequest = function(options) { +$http.afterRequest = function (options) { + if (options.data.code == 405) { + uni.redirectTo({ + url: '/pages/login/login' + }) + } // uni.hideLoading() } -uni.$showMsg = function(title = '数据请求失败了', duration = 1500) { +uni.$showMsg = function (title = '数据请求失败了', duration = 1500) { return uni.showToast({ title, duration, diff --git a/manifest.json b/manifest.json index 2149324..eed39fb 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { - "name" : "咸丰水利", - "appid" : "__UNI__CB311EF", + "name" : "小玉潭水库", + "appid" : "__UNI__7573222", "description" : "", "versionName" : "1.0.0", "versionCode" : "100", @@ -18,10 +18,10 @@ }, "modules" : { "VideoPlayer" : {}, - "Contacts" : {}, "Messaging" : {}, "Camera" : {}, - "Maps" : {} + "Maps" : {}, + "Contacts" : {} }, /* 模块配置 */ "distribute" : { diff --git a/pages/messageList/index.vue b/pages/messageList/index.vue index ba3fc68..ed10d0d 100644 --- a/pages/messageList/index.vue +++ b/pages/messageList/index.vue @@ -9,7 +9,7 @@ - + 开始时间 {{startTime}} @@ -23,7 +23,7 @@ - + diff --git a/pages/mypage/mypage.vue b/pages/mypage/mypage.vue index 5d3217e..0c3117b 100644 --- a/pages/mypage/mypage.vue +++ b/pages/mypage/mypage.vue @@ -84,7 +84,7 @@ } - } + }, }, }