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 |   93 +++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 90 insertions(+), 3 deletions(-)

diff --git a/api/global.js b/api/global.js
index a0e15ad..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';
 
@@ -38,7 +42,7 @@
 
 	return new Promise((resolve, reject) => {
 		uni.request({
-			url: "/auth/oauth/token?grant_type=password&scope=server",
+			url: BaseUrl + "/auth/oauth/token?grant_type=password&scope=server",
 			method: "POST",
 			data: {
 				username,
@@ -55,6 +59,7 @@
 				resolve(res);
 			},
 			fail: (err) => {
+				console.log('閿欒', err);
 				uni.hideLoading();
 				uni.showToast({
 					icon: 'none',
@@ -65,6 +70,85 @@
 	})
 }
 
+function wxSmallLogin(code) {
+	uni.showLoading({
+		title: '鐧诲綍涓�...',
+	})
+
+	return new Promise((resolve, reject) => {
+		uni.request({
+			url: BaseUrl + `/auth/mobile/token/social?grant_type=mobile&mobile=MINI@${code}`,
+			method: "POST",
+			header: {
+				"TENANT-ID": "5",
+				"Authorization": "Basic cGlnOnBpZw==",
+				'Content-Type': 'application/x-www-form-urlencoded'
+			},
+			success: (res) => {
+				uni.hideLoading();
+				// console.log(res)
+				resolve(res);
+			},
+			fail: (err) => {
+				console.log('閿欒', err);
+				uni.hideLoading();
+				uni.showToast({
+					icon: 'none',
+					title: '鏈嶅姟鍣ㄩ敊璇�'
+				})
+			}
+		})
+	})
+}
+
+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'
+				});
+			}
+		})
+	})
+}
+
+
+
 
 // 鑾峰彇娴佺▼鏁版嵁
 // export const getProcessDataList = (params) => {
@@ -73,5 +157,8 @@
 
 
 export default {
-	apiLogin
+	apiLogin,
+	wxSmallLogin,
+	logout,
+	deleteWithDrawApplicationGlobal
 }

--
Gitblit v1.9.1