替换图片并删掉本地图片,代码分包
This commit is contained in:
@@ -22,7 +22,7 @@ export const getResetPassword = (data) =>{
|
||||
return post('/api/resident/auth/resetPassword',data)
|
||||
}
|
||||
// =========首页=======
|
||||
// 查询小区列表
|
||||
export const getVillageList = () =>{
|
||||
return get('/api/resident/village/list')
|
||||
// 首页最新公告
|
||||
export const getNoticeList = () =>{
|
||||
return get('/api/resident/notice/latest')
|
||||
}
|
||||
@@ -16,9 +16,14 @@ export default function request(url, data = {}, method = "GET") {
|
||||
data: data,
|
||||
method: method,
|
||||
header: {
|
||||
"token": uni.getStorageSync("token") || '',
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
"Authorization": "Bearer " + (uni.getStorageSync("token") || ''),
|
||||
"clientid": "resident",
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
// header: {
|
||||
// "token": uni.getStorageSync("token") || '',
|
||||
// 'content-type': 'application/json'
|
||||
// },
|
||||
success: (res) => {
|
||||
uni.hideLoading(); // 关闭加载提示
|
||||
|
||||
@@ -44,16 +49,16 @@ export default function request(url, data = {}, method = "GET") {
|
||||
return;
|
||||
}
|
||||
|
||||
// 业务成功(code=1)
|
||||
// 业务成功(code=200)
|
||||
if (resData.code === 200) {
|
||||
resolve(resData.data); // 只返回核心数据,简化页面调用
|
||||
}
|
||||
// 业务失败(code=2)
|
||||
// 业务失败(code=500)
|
||||
else if (resData.code === 500) {
|
||||
const errMsg = resData.msg || '请求失败';
|
||||
uni.showToast({ title: errMsg, icon: "none", duration: 2000 });
|
||||
resolve(null)
|
||||
// reject(errMsg);
|
||||
// resolve(null)
|
||||
reject(errMsg);
|
||||
}
|
||||
else {
|
||||
const errMsg = resData.msg || '业务异常';
|
||||
|
||||
Reference in New Issue
Block a user