完成小区相关的接口对接

This commit is contained in:
Zy
2026-04-07 18:02:18 +08:00
parent ee55b4dca7
commit b87a594d4e
32 changed files with 913 additions and 384 deletions

View File

@@ -151,12 +151,14 @@ service.interceptors.response.use(
});
}
return Promise.reject('无效的会话,或者会话已过期,请重新登录。');
} else if (code === HttpStatus.SERVER_ERROR) {
ElMessage({ message: msg, type: 'error' });
return Promise.reject(new Error(msg));
} else if (code === HttpStatus.WARN) {
ElMessage({ message: msg, type: 'warning' });
// 图片上传全部失败 500
} else if (code === HttpStatus.UPLOAD_IMG_ALL_ERROR) {
ElMessage({ message: '图片全部上传失败', type: 'error' });
return Promise.reject(new Error(msg));
// 图片上传部分失败 601
} else if (code === HttpStatus.UPLOAD_IMG_ERROR) {
ElMessage({ message: '部分图片上传失败', type: 'warning' });
return Promise.reject(res.data);
} else if (code !== HttpStatus.SUCCESS) {
ElNotification.error({ title: msg });
return Promise.reject('error');

9
src/utils/vartype.ts Normal file
View File

@@ -0,0 +1,9 @@
// 判断是不是 File 文件
function isFile(file) {
return file instanceof File;
}
// 判断是不是字符串
function isString(str) {
return typeof str === 'string';
}