销冠的素材
This commit is contained in:
@@ -1639,19 +1639,23 @@
|
||||
queryParams.customerName = params.customerName;
|
||||
}
|
||||
|
||||
// 构建查询参数
|
||||
const queryString = Object.keys(queryParams)
|
||||
// 构建请求体(过滤空值),后端改为 POST
|
||||
const requestData = Object.keys(queryParams)
|
||||
.filter(key => queryParams[key] !== null && queryParams[key] !== undefined && queryParams[key] !== '')
|
||||
.map(key => `${key}=${encodeURIComponent(queryParams[key])}`)
|
||||
.join('&');
|
||||
.reduce((acc, key) => {
|
||||
acc[key] = queryParams[key];
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
// 统一使用 getApiUrl,根据 env.js 配置自动切换环境
|
||||
const baseUrl = getApiUrl('/api/audioManagement/list');
|
||||
const url = queryString ? `${baseUrl}?${queryString}` : baseUrl;
|
||||
const url = getApiUrl('/api/audioManagement/list');
|
||||
|
||||
const res = await uni.request({
|
||||
url: url,
|
||||
method: 'GET',
|
||||
method: 'POST',
|
||||
data: requestData,
|
||||
header: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
timeout: 10000
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user