From 45547b52b7a4c3813a5058dffa27d24d1c250676 Mon Sep 17 00:00:00 2001 From: jia <1451658316@qq.com> Date: Thu, 7 Dec 2023 09:34:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=B7=E6=B1=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 222 ++++++++++++++++++++++++------------------------ utils/http.js | 7 +- utils/syhttp.js | 19 +++-- 3 files changed, 128 insertions(+), 120 deletions(-) diff --git a/manifest.json b/manifest.json index 75f6217..7116fe9 100644 --- a/manifest.json +++ b/manifest.json @@ -1,112 +1,112 @@ { - "name": "种植溯源", - "appid": "__UNI__D087881", - "description": "", - "versionName": "1.0.1", - "versionCode": "100", - "transformPx": false, - /* 5+App特有相关 */ - "app-plus": { - "usingComponents": true, - "nvueStyleCompiler": "uni-app", - "compilerVersion": 3, - "screenOrientation": [ - "portrait-primary", - "portrait-secondary", - "landscape-primary", - "landscape-secondary" - ], - "splashscreen": { - "alwaysShowBeforeRender": true, - "waiting": true, - "autoclose": true, - "delay": 0 - }, - /* 模块配置 */ - "modules": { - "Geolocation": {}, - "Maps": {}, - "LivePusher": {}, - "VideoPlayer": {}, - "Barcode": {}, - "Camera": {}, - "UniMP": { - "description": "uni小程序" - } - }, - /* 应用发布信息 */ - "distribute": { - /* android打包配置 */ - "android": { - "permissions": [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" - ], - "minSdkVersion": 21 - }, - /* ios打包配置 */ - "ios": { - "dSYMs": false - }, - /* SDK配置 */ - "sdkConfigs": { - "ad": {}, - "geolocation": { - "amap": { - "name": "amap_18982406440DFVLElaO", - "__platform__": ["android"], - "appkey_ios": "4e6789b864fe1a2d76b98e38158f20f2", - "appkey_android": "a230d943475443eb29fc3871fbef8605" - }, - "system": { - "__platform__": ["ios", "android"] - } - }, - "maps": { - "amap": { - "name": "4e6789b864fe1a2d76b98e38158f20f2", - "appkey_ios": "a230d943475443eb29fc3871fbef8605", - "appkey_android": "a230d943475443eb29fc3871fbef8605" - } - } - } - } - }, - /* 快应用特有相关 */ - "quickapp": {}, - /* 小程序特有相关 */ - "mp-weixin": { - "appid": "", - "setting": { - "urlCheck": false - }, - "usingComponents": true - }, - "mp-alipay": { - "usingComponents": true - }, - "mp-baidu": { - "usingComponents": true - }, - "mp-toutiao": { - "usingComponents": true - }, - "uniStatistics": { - "enable": false - }, - "vueVersion": "3" -} \ No newline at end of file + "name" : "种植溯源", + "appid" : "__UNI__D087881", + "description" : "", + "versionName" : "1.0.1", + "versionCode" : "100", + "transformPx" : false, + /* 5+App特有相关 */ + "app-plus" : { + "usingComponents" : true, + "nvueStyleCompiler" : "uni-app", + "compilerVersion" : 3, + "screenOrientation" : [ + "portrait-primary", + "portrait-secondary", + "landscape-primary", + "landscape-secondary" + ], + "splashscreen" : { + "alwaysShowBeforeRender" : true, + "waiting" : true, + "autoclose" : true, + "delay" : 0 + }, + /* 模块配置 */ + "modules" : { + "Geolocation" : {}, + "Maps" : {}, + "LivePusher" : {}, + "VideoPlayer" : {}, + "Barcode" : {}, + "Camera" : {}, + "UniMP" : { + "description" : "uni小程序" + } + }, + /* 应用发布信息 */ + "distribute" : { + /* android打包配置 */ + "android" : { + "permissions" : [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "minSdkVersion" : 21 + }, + /* ios打包配置 */ + "ios" : { + "dSYMs" : false + }, + /* SDK配置 */ + "sdkConfigs" : { + "ad" : {}, + "geolocation" : { + "amap" : { + "name" : "amap_18982406440DFVLElaO", + "__platform__" : [ "android" ], + "appkey_ios" : "4e6789b864fe1a2d76b98e38158f20f2", + "appkey_android" : "a230d943475443eb29fc3871fbef8605" + }, + "system" : { + "__platform__" : [ "ios", "android" ] + } + }, + "maps" : { + "amap" : { + "name" : "4e6789b864fe1a2d76b98e38158f20f2", + "appkey_ios" : "a230d943475443eb29fc3871fbef8605", + "appkey_android" : "a230d943475443eb29fc3871fbef8605" + } + } + } + } + }, + /* 快应用特有相关 */ + "quickapp" : {}, + /* 小程序特有相关 */ + "mp-weixin" : { + "appid" : "", + "setting" : { + "urlCheck" : false + }, + "usingComponents" : true + }, + "mp-alipay" : { + "usingComponents" : true + }, + "mp-baidu" : { + "usingComponents" : true + }, + "mp-toutiao" : { + "usingComponents" : true + }, + "uniStatistics" : { + "enable" : false + }, + "vueVersion" : "3" +} diff --git a/utils/http.js b/utils/http.js index 4af274d..751ce4c 100644 --- a/utils/http.js +++ b/utils/http.js @@ -17,6 +17,7 @@ function baseRequest(url, method, data, { header = config.HEADER; if (store.state.userInfo) { header.TOKEN = store.state.userInfo.token + } return new Promise((reslove, reject) => { @@ -43,9 +44,13 @@ function baseRequest(url, method, data, { reslove(res.data); else if (res.data.code == -1) { - if (onReLogin) { + if (res.data.msg == "登录超时,请重新登录") { // store.commit('LOGOUT'); + uni.reLaunch({ + url:'/pages/Login/login' + }) + } } else if (res.data.code == 0) { if (res.data.msg != '用户信息不存在') { diff --git a/utils/syhttp.js b/utils/syhttp.js index 930a25c..a8c3b6d 100644 --- a/utils/syhttp.js +++ b/utils/syhttp.js @@ -37,15 +37,18 @@ function baseRequest(url, method, data, { if (noVerify) reslove(res.data); else if (res.data.code == -1) { - // if (onReLogin) { - // // store.commit('LOGOUT'); - // return reject(); - // } - uni.showToast({ - title: res.data.msg, - icon: 'none', - }) + if (res.data.msg == "登录超时,请重新登录") { + // store.commit('LOGOUT'); + uni.showToast({ + title: res.data.msg , + icon: 'none', + }) + uni.reLaunch({ + url:'/pages/Login/login' + }) + + } } else if (res.data.code == 0) { if (res.data.msg != '用户信息不存在') { uni.showToast({