替换图片并删掉本地图片,代码分包

This commit is contained in:
zhouyanli
2026-04-21 15:48:52 +08:00
parent b0d90c27db
commit 65e6e5bf30
70 changed files with 316 additions and 212 deletions

View File

@@ -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')
}

View File

@@ -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 || '业务异常';