From 7eb7c653e54ae77dacef48a303c5e3dba4f2afa7 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期三, 26 十一月 2025 09:14:54 +0800
Subject: [PATCH] 优化
---
screen/src/utils/request.js | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/screen/src/utils/request.js b/screen/src/utils/request.js
index 490faed..94fce10 100644
--- a/screen/src/utils/request.js
+++ b/screen/src/utils/request.js
@@ -1,8 +1,8 @@
import axios from "axios"
const instance = axios.create({
- baseURL: '/gateway_interface',
- timeout: 10000,
+ baseURL: '/system_gateway',
+ timeout: 30000,
withCredentials: true,
headers: {
shopId: 1
@@ -18,11 +18,12 @@
export default instance
-export const request = (url, data) => {
+export const request = (url, data, method = 'GET') => {
return instance({
url: url,
- method: 'GET',
- params: { ...data }
+ method: method || 'GET',
+ params: method == 'GET' ? { ...data } : null,
+ data: method == 'POST' ? { ...data } : null
})
}
@@ -32,4 +33,4 @@
method: 'get',
data
})
-}
\ No newline at end of file
+}
--
Gitblit v1.9.3