登录、注册接口修改
This commit is contained in:
@@ -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
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
12
http/http.js
12
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(`上传失败`);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user