feat: 登录功能
This commit is contained in:
@@ -59,19 +59,21 @@ http.interceptors.response.use(
|
||||
uni.hideLoading();
|
||||
|
||||
const { data } = response;
|
||||
|
||||
// console.log(data);
|
||||
|
||||
// 根据业务状态码处理(可根据实际接口调整)
|
||||
if (data.code === 200 || data.code === 0) {
|
||||
return data;
|
||||
}
|
||||
// if (data.code === 200 || data.code === 0) {
|
||||
// return data;
|
||||
// }
|
||||
|
||||
// 业务错误提示
|
||||
uni.showToast({
|
||||
title: data.message || "请求失败",
|
||||
icon: "none",
|
||||
});
|
||||
// // 业务错误提示
|
||||
// uni.showToast({
|
||||
// title: data.message || "请求失败",
|
||||
// icon: "none",
|
||||
// });
|
||||
|
||||
return Promise.reject(data);
|
||||
// return Promise.reject(data);
|
||||
return data;
|
||||
},
|
||||
(error) => {
|
||||
uni.hideLoading();
|
||||
|
||||
Reference in New Issue
Block a user