修复因插入数字类型的ID导致其意外在末尾追加 .0 导致列表数据异常的问题

This commit is contained in:
lyswhut
2023-05-18 15:22:45 +08:00
parent 0454d300ec
commit 8018d9b418
8 changed files with 31 additions and 9 deletions
@@ -19,13 +19,20 @@ import {
createMusicInfoByMusicInfoIdQueryStatement,
} from './statements'
const idFixRxp = /\.0$/
/**
* 获取用户列表
* @returns
*/
export const queryAllUserList = () => {
return createListQueryStatement().all() as LX.DBService.UserListInfo[]
const list = createListQueryStatement().all() as LX.DBService.UserListInfo[]
for (const info of list) {
// 兼容v2.3.0之前版本插入数字类型的ID导致其意外在末尾追加 .0 的问题
if (info.sourceListId?.endsWith('.0')) {
info.sourceListId = info.sourceListId.replace(idFixRxp, '')
}
}
return list
}
/**