0924
This commit is contained in:
@ -605,13 +605,14 @@ const formatDate = (dateString) => {
|
||||
const getUsersList = async () => {
|
||||
try {
|
||||
const response = await xunjianUserlist();
|
||||
const userRows = response?.data?.rows || response?.rows || [];
|
||||
// 适配新接口格式:检查code为200且rows为数组
|
||||
const userRows = response.code === 200 && response.rows && Array.isArray(response.rows) ? response.rows : [];
|
||||
|
||||
userList.value = userRows
|
||||
.filter((item) => item && typeof item === 'object')
|
||||
.map((item, index) => ({
|
||||
label: item.userName || `用户${index + 1}`,
|
||||
value: item.id || `id_${index}`
|
||||
.map((item) => ({
|
||||
label: item.userName || '未知用户',
|
||||
value: String(item.userId || '') // 使用userId作为唯一标识
|
||||
}));
|
||||
|
||||
if (userList.value.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user