From c56e67c77e2a36c894346830c1ab1e6df36fe935 Mon Sep 17 00:00:00 2001 From: 819527061@qq.com <123456> Date: 星期五, 01 十二月 2023 16:55:02 +0800 Subject: [PATCH] 测试bug调整 --- api/global.js | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 53 insertions(+), 2 deletions(-) diff --git a/api/global.js b/api/global.js index 37fcfb2..fda8eba 100644 --- a/api/global.js +++ b/api/global.js @@ -1,5 +1,8 @@ // import request from '@/config/request'; -import { BaseUrl } from '@/utils/request.js' +import { + BaseUrl +} from '@/utils/request.js' +// import { resolve } from 'node:path/win32'; // let BaseUrl = "/"; // const CURRENT_KEY = 'CURRENT_KEY'; @@ -98,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' + }); + } + }) + }) +} + @@ -109,5 +158,7 @@ export default { apiLogin, - wxSmallLogin + wxSmallLogin, + logout, + deleteWithDrawApplicationGlobal } -- Gitblit v1.9.1