From fbd6124a80d055d3a30f6213252242084f4ca868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?TOP=E7=B3=AF=E7=B1=B3?= <1130395124@qq.com> Date: Tue, 7 Mar 2023 12:02:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96request.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/request.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/request.js b/src/core/request.js index 35c87d4..bd9b32b 100644 --- a/src/core/request.js +++ b/src/core/request.js @@ -25,7 +25,7 @@ const request = async (args) => { throw "找不到API:" + args.api; } - if (rule.auth && !$store.state.user.token) { + if (typeof rule.auth !== "undefined" && rule.auth === true && !$store.state.user.token) { $store.commit("user/showLoginModal", true); return; } @@ -38,7 +38,7 @@ const request = async (args) => { const [error, response] = await uni.request({ url: prototype.$config.root + rule.url, - method: rule.method || 'get', + method: rule.method || 'post', data: args.data, header: { 'X-Requested-With': 'XMLHttpRequest',