1
0
mirror of https://github.com/ialley-workshop-open/uni-halo.git synced 2026-06-11 12:49:30 +08:00

feat: 新增首页轮播支持配置

This commit is contained in:
小莫唐尼
2025-06-15 18:38:52 +08:00
parent 8963ba1921
commit 2fd83a7814
17 changed files with 325 additions and 101 deletions
+18
View File
@@ -160,6 +160,24 @@ const utils = {
urls: list,
loop: true
})
},
/**
* 检查是否为json字符串
* @param {Object} jsonStr 数据源
*/
checkJsonAndParse(jsonStr) {
try {
const jsonResult = JSON.parse(jsonStr);
return {
ok: true,
jsonData: jsonResult,
}
} catch (e) {
return {
ok: false,
jsonData: {},
}
}
}
};