From e193d75257a21568a15f99b27a2a48bd7fd815f9 Mon Sep 17 00:00:00 2001
From: 付延余 <f-yanyu@outlook.com>
Date: 星期三, 22 三月 2023 17:59:06 +0800
Subject: [PATCH] 1.磅房详情(完成) 2.入场申请报错(完成) 3.签到(完成) 4.日志(完成) 5.发运计划详情(完成)
---
api/publicInterface.js | 148 ++++++++++++++++++++++++++-----------------------
1 files changed, 79 insertions(+), 69 deletions(-)
diff --git a/api/publicInterface.js b/api/publicInterface.js
index 54e06bf..c295cff 100644
--- a/api/publicInterface.js
+++ b/api/publicInterface.js
@@ -4,76 +4,46 @@
// const BaseUrl = "http://192.168.3.159:9999/";
import {BaseUrl as wrBaseUrl} from '@/api/request.js'
// const BaseUrl = "http://192.168.0.120:9999"
-const BaseUrl = "http://192.168.0.120:9999"
+const BaseUrl = "http://192.168.110.101:9999"
// 鐧诲綍
-function apiLogin({
- code
-}) {
- uni.showLoading({
- title: '鐧诲綍涓�...',
- })
- return new Promise((resolve, reject) => {
- uni.request({
- url: BaseUrl + "/wrzs/wx/login",
- method: "POST",
- data: {
- code
- },
- header: {
- // "TENANT-ID": "5",
- // "Authorization": "Basic cGlnOnBpZw==",
- 'Content-Type': 'application/x-www-form-urlencoded'
- },
- success: (res) => {
- uni.hideLoading();
- // console.log(res)
- resolve(res.data);
- },
- fail: (err) => {
- console.log('閿欒', err);
- uni.hideLoading();
- uni.showToast({
- icon: 'none',
- title: '鏈嶅姟鍣ㄩ敊璇�'
- })
- }
- })
- })
-}
+// function apiLogin({
+// code
+// }) {
+// uni.showLoading({
+// title: '鐧诲綍涓�...',
+// })
+// return new Promise((resolve, reject) => {
+// uni.request({
+// url: BaseUrl + "/wrzs/wx/login",
+// method: "POST",
+// data: {
+// code
+// },
+// header: {
+// // "TENANT-ID": "5",
+// // "Authorization": "Basic cGlnOnBpZw==",
+// 'Content-Type': 'application/x-www-form-urlencoded'
+// },
+// success: (res) => {
+// uni.hideLoading();
+// // console.log(res)
+// resolve(res.data);
+// },
+// fail: (err) => {
+// console.log('閿欒', err);
+// uni.hideLoading();
+// uni.showToast({
+// icon: 'none',
+// title: '鏈嶅姟鍣ㄩ敊璇�'
+// })
+// }
+// })
+// })
+// }
-function apiLogin2({
- code
-}) {
- uni.showLoading({
- title: '鍔犺浇涓�...'
- })
- return new Promise((resolve, reject) => {
- uni.request({
- url: BaseUrl + "/wrzs/wx/login2",
- method: "POST",
- data: {
- code
- },
- header: {
- 'Content-Type': 'application/x-www-form-urlencoded'
- },
- success: (res) => {
- uni.hideLoading();
- resolve(res.data)
- },
- fail: (err) => {
- console.log('閿欒', err);
- uni.hideLoading();
- uni.showToast({
- icon: 'none',
- title: '鏈嶅姟鍣ㄩ敊璇�'
- })
- }
- })
- })
-}
+
// 娉ㄥ唽
@@ -130,6 +100,7 @@
})
}
+
// 鑾峰彇token
function apiLoginPassword({
username,
@@ -170,6 +141,45 @@
}
+// 寰俊灏忕▼搴忎竴閿櫥褰�
+function apiLoginWx({
+ code
+}) {
+ uni.showLoading({
+ title: '鍔犺浇涓�...'
+ })
+ return new Promise((resolve, reject) => {
+ uni.request({
+ url: BaseUrl + '/admin/oauth2/token',
+ method: "POST",
+ data: {
+ grant_type:'mobile',
+ mobile:`MINI@${code}`,
+ code
+ },
+ header: {
+ "Authorization": 'Basic c29jaWFsOnNvY2lhbA==', //app:app
+ 'content-type': 'application/x-www-form-urlencoded',
+ "CLIENT_TOC": "Y",
+ "isToken": "false"
+ },
+ success: (res) => {
+ uni.hideLoading();
+ resolve(res.data)
+ },
+ fail: (err) => {
+ console.log('閿欒', err);
+ uni.hideLoading();
+ uni.showToast({
+ icon: 'none',
+ title: '鏈嶅姟鍣ㄩ敊璇�'
+ })
+ }
+ })
+ })
+}
+
+
// 鑾峰彇娴佺▼鏁版嵁
// export const getProcessDataList = (params) => {
@@ -178,8 +188,8 @@
export {
- apiLogin,
- apiLogin2,
+ apiLoginWx,
apiRegister,
- apiLoginPassword
+ apiLoginPassword,
+ BaseUrl
}
--
Gitblit v1.9.1