From e1e30e034377abc641218a460e672e970f8c5d57 Mon Sep 17 00:00:00 2001 From: xyiege Date: Tue, 24 Oct 2023 23:40:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0orgin=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/login/index.js | 2 +- utils/request/index.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/api/login/index.js b/api/login/index.js index a9e5d5c..da741d6 100644 --- a/api/login/index.js +++ b/api/login/index.js @@ -14,6 +14,6 @@ const api = { // 用户登录(手机号+验证码) export function login(data) { - return request.post(api.login, data) + return request.post(api.login,JSON.stringify(data)) } diff --git a/utils/request/index.js b/utils/request/index.js index fd398f7..4844dfd 100644 --- a/utils/request/index.js +++ b/utils/request/index.js @@ -18,7 +18,8 @@ const $http = new request({ // defaultUploadUrl: 'upload/image', // 设置请求头(如果使用报错跨域问题,可能是content-type请求类型和后台那边设置的不一致) header: { - 'Content-Type': 'application/json;charset=utf-8' + 'Content-Type': 'application/json;charset=utf-8', + "Access-Control-Allow-Origin":"*" }, // 请求超时时间, 单位ms(默认15000) timeout: 15000,