From b5d3561a2e06106ed9cce2c6bcc9c2463951e998 Mon Sep 17 00:00:00 2001 From: 819527061@qq.com <123456> Date: 星期五, 15 十一月 2024 11:06:26 +0800 Subject: [PATCH] 新增申请页面不显示发运通知单的问题修改 --- api/global.js | 64 ++++++++++++++++++++++++++++---- 1 files changed, 56 insertions(+), 8 deletions(-) diff --git a/api/global.js b/api/global.js index 4b4916e..fda8eba 100644 --- a/api/global.js +++ b/api/global.js @@ -1,6 +1,10 @@ // import request from '@/config/request'; +import { + BaseUrl +} from '@/utils/request.js' +// import { resolve } from 'node:path/win32'; -// let baseUrl = "/"; +// let BaseUrl = "/"; // const CURRENT_KEY = 'CURRENT_KEY'; // const PARAM_KEY = 'PARAM_KEY'; @@ -27,10 +31,6 @@ }); } -// const baseUrl = 'http://192.168.3.159:9999' -// const baseUrl = 'https://mx.jzeg.cn:443/app'; -const baseUrl = "https://mx.jzeg.cn:9998"; // 姝e紡鏈嶅姟 - // POST璇锋眰 function apiLogin({ username, @@ -42,7 +42,7 @@ return new Promise((resolve, reject) => { uni.request({ - url: baseUrl + "/auth/oauth/token?grant_type=password&scope=server", + url: BaseUrl + "/auth/oauth/token?grant_type=password&scope=server", method: "POST", data: { username, @@ -77,7 +77,7 @@ return new Promise((resolve, reject) => { uni.request({ - url: baseUrl + `/auth/mobile/token/social?grant_type=mobile&mobile=MINI@${code}`, + url: BaseUrl + `/auth/mobile/token/social?grant_type=mobile&mobile=MINI@${code}`, method: "POST", header: { "TENANT-ID": "5", @@ -101,6 +101,52 @@ }) } +function logout() { + uni.request({ + url: `${BaseUrl}/auth/token/logout`, + method: 'DELETE', + header: { + 'TENANT-ID': 5, + Authorization: 'Bearer ' + uni.getStorageSync('access_token'), + VERSION: 'zzl' + } + }) + .then(res => { + console.log('缂撳瓨娓呯悊鎴愬姛'); + uni.showToast({ + title: '鍒拌揪鐧诲綍椤碉紒' + }); + }) + .catch(err => { + uni.showToast({ + title: '缂撳瓨娓呯悊澶辫触锛�' + }); + }); +} +// 鍒犻櫎鎾ゅ洖鐢宠鎺ュ彛 +function deleteWithDrawApplicationGlobal(id) { + return new Promise((resolve, reject) => { + uni.request({ + url: `${BaseUrl}/yunxiao/xswaybill/${id}`, + method: 'DELETE', + header: { + 'TENANT-ID': 5, + Authorization: 'Bearer ' + uni.getStorageSync('access_token'), + VERSION: 'zzl' + }, + success: (res) => { + resolve(res.data); + }, + fail:(err) => { + uni.showToast({ + title: '鍒犻櫎鍑洪敊', + icon: 'none' + }); + } + }) + }) +} + @@ -112,5 +158,7 @@ export default { apiLogin, - wxSmallLogin + wxSmallLogin, + logout, + deleteWithDrawApplicationGlobal } -- Gitblit v1.9.1