角色 保存

This commit is contained in:
zhonghua1
2026-01-02 14:40:14 +08:00
parent f004a75483
commit b607a5980c
5 changed files with 185 additions and 86 deletions

View File

@@ -52,9 +52,6 @@
</view>
<text class="customer-name">{{ item.customerName }}</text>
</view>
<view class="ai-tag">
<text>以上内容由AI生成</text>
</view>
</view>
</scroll-view>
</view>

View File

@@ -1635,7 +1635,8 @@
// 构建查询参数对象(后端使用 @RequestParam参数需要作为 URL 查询参数传递)
const queryParams = {
current: this.serviceListPage.current,
size: this.serviceListPage.size
size: this.serviceListPage.size,
serviceStatus: '服务结束' // 默认搜索条件:服务结束
};
// 添加查询参数:所属销售姓名和客户姓名
@@ -1654,17 +1655,40 @@
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(queryParams[key])}`)
.join('&');
// 调试:打印请求参数
console.log('服务记录查询参数:', JSON.stringify(queryParams));
console.log('查询字符串:', queryString);
// 后端使用 @RequestParam参数需要作为 URL 查询参数传递
const baseUrl = getApiUrl('/api/audioManagement/list');
const url = queryString ? `${baseUrl}?${queryString}` : baseUrl;
// 获取认证信息
let tenantId = '';
let token = '';
try {
tenantId = uni.getStorageSync('backend-tenant-id') || '';
token = uni.getStorageSync('backend-token') || '';
} catch (e) {
console.error('获取认证信息失败:', e);
}
// 构建请求头(参考接待页面的实现方式)
const headers = {
'Content-Type': 'application/json'
};
if (token) {
headers['Authorization'] = `Bearer ${token}`;
}
if (tenantId) {
headers['X-Tenant-Id'] = tenantId;
}
const res = await uni.request({
url,
method: 'POST',
data: {}, // POST 请求体为空,参数都在 URL 查询字符串中
header: {
'Content-Type': 'application/json'
},
header: headers,
timeout: 10000
});