feat: 修复百科添加页面的问题
This commit is contained in:
@@ -53,18 +53,12 @@ export default function LevelConfigPage() {
|
||||
setLoading(true)
|
||||
try {
|
||||
const res = await getLevelConfList()
|
||||
console.log('等级配置接口返回:', res)
|
||||
|
||||
let list: LevelConf[] = []
|
||||
|
||||
if (res && Array.isArray(res.data)) {
|
||||
list = res.data
|
||||
} else if (res && res.data && Array.isArray((res.data as any).list)) {
|
||||
list = (res.data as any).list
|
||||
} else if (Array.isArray(res)) {
|
||||
list = res as unknown as LevelConf[]
|
||||
if (res && res.data && Array.isArray(res.data.list)) {
|
||||
list = res.data.list
|
||||
}
|
||||
|
||||
// Sort by level
|
||||
list.sort((a, b) => a.level - b.level)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user