From 2c11814ecf148a5fe5a80d03e29481476e47f34d Mon Sep 17 00:00:00 2001
From: 付延余 <f-yanyu@outlook.com>
Date: 星期一, 19 十二月 2022 16:13:34 +0800
Subject: [PATCH] test push two

---
 api/global.js |   45 +++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 43 insertions(+), 2 deletions(-)

diff --git a/api/global.js b/api/global.js
index a0e15ad..c8be2af 100644
--- a/api/global.js
+++ b/api/global.js
@@ -27,6 +27,12 @@
 	});
 }
 
+// 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,
@@ -38,7 +44,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 +61,38 @@
 				resolve(res);
 			},
 			fail: (err) => {
+				console.log('閿欒', err);
+				uni.hideLoading();
+				uni.showToast({
+					icon: 'none',
+					title: '鏈嶅姟鍣ㄩ敊璇�'
+				})
+			}
+		})
+	})
+}
+
+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',
@@ -66,6 +104,8 @@
 }
 
 
+
+
 // 鑾峰彇娴佺▼鏁版嵁
 // export const getProcessDataList = (params) => {
 //     return getRequest('/oa/actProcess/getByCondition', params)
@@ -73,5 +113,6 @@
 
 
 export default {
-	apiLogin
+	apiLogin,
+	wxSmallLogin
 }

--
Gitblit v1.9.1