From b0c828aba9b5b9f1a8a9a887cd0994f497f73f16 Mon Sep 17 00:00:00 2001 From: GaoHao <1210693421@qq.com> Date: Tue, 14 Jan 2025 11:20:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E3=80=81=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/login/login.js | 10 +++++----- http/http.js | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/api/login/login.js b/api/login/login.js index 3c54372..fe02c70 100644 --- a/api/login/login.js +++ b/api/login/login.js @@ -5,9 +5,9 @@ import http from '@/http/http.js' */ export const login = (data) => { return http.request({ - url: '/Login/registerCode', + url: '/Login', method: 'POST', - params: data + data: data }) } @@ -23,11 +23,11 @@ export const setSendMsg = (mobile,type) => { /** * 注册 */ -export const register = (params) => { +export const register = (data) => { return http.request({ - url: '/Login/registerCode', + url: '/Login/register', method: 'POST', - params: params + data: data }) } diff --git a/http/http.js b/http/http.js index 72572f4..201fd1a 100644 --- a/http/http.js +++ b/http/http.js @@ -107,13 +107,13 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) { .catch((res) => { if (res.status == 404) { - infoBox.showErrorToast("接口404").then(() => {}); + infoBox.showToast("接口404").then(() => {}); reject(); return; } if (res.code == 401) { - infoBox.showErrorToast(res.message || "请登录").then(() => { + infoBox.showToast(res.message || "请登录").then(() => { uni.redirectTo({ url: "/pages/login/login", }); @@ -121,18 +121,18 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) { }); } if (res.code != 0) { - infoBox.showErrorToast(res.msg).then(() => {}); + infoBox.showToast(res.msg).then(() => {}); reject(); } if (res.code == 500) { - infoBox.showErrorToast(res.msg || "服务器异常").then(() => {}); + infoBox.showToast(res.msg || "服务器异常").then(() => {}); reject(); } reqFinishFunc(); // 请求完毕的动作 // 如果没有提示错误, 那么此处提示 异常。 if (!isShowErrorToast) { - infoBox.showErrorToast(`请求网络异常`); + infoBox.showToast(`请求网络异常`); } return Promise.reject(res); @@ -233,7 +233,7 @@ function upload(uri, data, file, showLoading = true, extParams = {}) { }) .catch((err) => { uni.hideLoading(); - infoBox.showErrorToast(`上传失败`); + infoBox.showToast(`上传失败`); }); }); }