From 49e3612d8f4f0dbd3ce261b17f20ad59da59db55 Mon Sep 17 00:00:00 2001
From: 付延余 <f-yanyu@outlook.com>
Date: 星期四, 22 十二月 2022 14:18:58 +0800
Subject: [PATCH] 日发运计划接口同步后台更新。数字键盘动作更新。主页、申请页列表功能按钮更新(撤回,编辑,删除)。完善页面细节
---
api/global.js | 66 ++++++++++++++++++++++++++++-----
1 files changed, 56 insertions(+), 10 deletions(-)
diff --git a/api/global.js b/api/global.js
index c8be2af..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,12 +31,6 @@
});
}
-// const baseUrl = 'http://192.168.3.159:9999'
-// const baseUrl = 'https://mx.jzeg.cn:443/app';
-// let baseUrl = 'http://192.168.0.114:9999';
-
-const baseUrl = "https://mx.jzeg.cn:9998"; // 姝e紡鏈嶅姟
-
// POST璇锋眰
function apiLogin({
username,
@@ -44,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,
@@ -79,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",
@@ -103,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'
+ });
+ }
+ })
+ })
+}
+
@@ -114,5 +158,7 @@
export default {
apiLogin,
- wxSmallLogin
+ wxSmallLogin,
+ logout,
+ deleteWithDrawApplicationGlobal
}
--
Gitblit v1.9.1