From bfb3c5fd222aee159b265c993ab1ae69d96c0f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=97=9C=E8=A1=80=E9=BE=99=E5=B8=85?= <1493694146@qq.com> Date: Thu, 7 Sep 2023 23:24:42 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E6=B5=81=E7=8E=AF=E5=A2=83=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/app.js | 14 ++++++++++---- utils/logistics.js | 17 ++++++++++------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/config/app.js b/config/app.js index 18a6061..888baa8 100644 --- a/config/app.js +++ b/config/app.js @@ -1,15 +1,20 @@ let httpApiThree; let httpApi; +let httpApiTwo; // 正式使用的域名 -httpApi = 'https://ceshi-worker-task.lihaink.cn' //测试 +// httpApi = 'https://ceshi-worker-task.lihaink.cn' //测试 // httpApi = 'https://preview-worker-task.lihaink.cn' //预上线 -// httpApi = 'https://worker-task.lihaink.cn' //正式 +httpApi = 'https://worker-task.lihaink.cn' //正式 + +// 物流 +httpApiTwo = 'https://logistics.lihaink.cn' //正式环境 +// httpApiTwo = 'https://ceshi-logistics.lihaink.cn' //测试环境 -httpApiThree = 'https://ceshi-worker-task.lihaink.cn' //测试 +// httpApiThree = 'https://ceshi-worker-task.lihaink.cn' //测试 // httpApiThree = 'https://preview-worker-task.lihaink.cn' //预上线 -// httpApiThree = 'https://worker-task.lihaink.cn' //正式 +httpApiThree = 'https://worker-task.lihaink.cn' //正式 // #ifdef H5 // httpApiThree = 'baseUrlTest' //生产 // #endif @@ -33,6 +38,7 @@ module.exports = { // 请求域名 格式: https://您的域名 HTTP_REQUEST_URL: httpApi, HTTP_REQUEST_URL_THREE: httpApiThree, + HTTP_REQUEST_URL_TWO: httpApiTwo, // #ifdef H5 //H5接口是浏览器地址 diff --git a/utils/logistics.js b/utils/logistics.js index 4e7c4ff..e94a501 100644 --- a/utils/logistics.js +++ b/utils/logistics.js @@ -1,5 +1,5 @@ import { - HTTP_REQUEST_URL_THREE, + HTTP_REQUEST_URL_TWO, HEADER, TOKENNAME, } from '@/config/app'; @@ -21,8 +21,7 @@ function baseRequestTwo(url, method, data, { noAuth = false, noVerify = false }) { - // let Url = "https://logistics.lihaink.cn", //正式环境 - let Url = "https://ceshi-logistics.lihaink.cn", //测试环境 + let Url = HTTP_REQUEST_URL_TWO, header = HEADER; if (!noAuth) { // 已经未登录了,禁止请求 @@ -41,6 +40,7 @@ function baseRequestTwo(url, method, data, { // if (store.state.app.token) header[TOKENNAME] = 'Bearer ' + store.state.app.token; if (store.state.app.token) header[TOKENNAME] = store.state.app.token; + // header[TOKENNAME] = 'Bearer sdjflidshjgfkbdasgjmasbgvhauuiavhkesvndkaesbvkjsdbv'; return new Promise((reslove, reject) => { // uni.showLoading({ @@ -52,6 +52,7 @@ function baseRequestTwo(url, method, data, { method: method || 'GET', header: { ...header + }, data: method != 'GET' ? data || {} : {}, params: method == 'GET' ? data : {}, @@ -66,10 +67,12 @@ function baseRequestTwo(url, method, data, { reject(res.data); } else if (res.data.code == 0) { // uni.hideLoading(); - uni.showToast({ - title: res.data.msg || '请检查网络', - icon: 'none' - }) + if (res.data.show != 1 && res.data.msg != '无登录信息') { + uni.showToast({ + title: res.data.msg || '请检查网络', + icon: 'none', + }) + } reject(res.data); } else if (res.data.code == 1) { store.commit("SET_REQUEST");