From e170fd5e5b5b7fbc9a19d7aff4cf0908adeffe10 Mon Sep 17 00:00:00 2001
From: 付延余 <f-yanyu@outlook.com>
Date: 星期一, 19 十二月 2022 14:09:12 +0800
Subject: [PATCH] ‘第一次提交’
---
api/global.js | 42 +++++++++++++++++++++++++++++++++++++++---
1 files changed, 39 insertions(+), 3 deletions(-)
diff --git a/api/global.js b/api/global.js
index 0cc2fd4..c8be2af 100644
--- a/api/global.js
+++ b/api/global.js
@@ -29,7 +29,9 @@
// const baseUrl = 'http://192.168.3.159:9999'
// const baseUrl = 'https://mx.jzeg.cn:443/app';
-const baseUrl = "https://mx.jzeg.cn:9998";
+// let baseUrl = 'http://192.168.0.114:9999';
+
+const baseUrl = "https://mx.jzeg.cn:9998"; // 姝e紡鏈嶅姟
// POST璇锋眰
function apiLogin({
@@ -59,7 +61,38 @@
resolve(res);
},
fail: (err) => {
- console.log('閿欒',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',
@@ -71,6 +104,8 @@
}
+
+
// 鑾峰彇娴佺▼鏁版嵁
// export const getProcessDataList = (params) => {
// return getRequest('/oa/actProcess/getByCondition', params)
@@ -78,5 +113,6 @@
export default {
- apiLogin
+ apiLogin,
+ wxSmallLogin
}
--
Gitblit v1.9.1