skyouc
2025-07-10 a99ba6b06c16fa1da4f8eb6750c0847c65c27278
no message
1个文件已修改
15 ■■■■■ 已修改文件
zy-asrs-admin/src/utils/request.js 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-admin/src/utils/request.js
@@ -10,6 +10,10 @@
    if (params?.condition != null && params?.condition != undefined  && params?.condition  != "") {
        params.current = 1
    }
    if (params?._param != null && params?._param != undefined && hasNonEmptyProperty(params?._param)) {
        data.current = 1
    }
    return instance({
        url: url,
        method: 'get',
@@ -20,11 +24,20 @@
    })
}
function hasNonEmptyProperty(obj) {
    return Object.values(obj).some(value => {
        // 定义何为"不为空" - 根据需求调整
        return value !== null && value !== undefined && value !== '';
    });
}
export const post = async (url, data) => {
    if (data?.condition != null && data?.condition != undefined && data?.condition != "") {
        data.current = 1
    }
    if (data._param != null && data._param != undefined && hasNonEmptyProperty(data?._param)) {
        data.current = 1
    }
    return instance({
        url: url,
        method: 'post',