form-create: 字典选择器分离,重新封装 api 选择器

This commit is contained in:
puhui999 committed 2024-05-06 01:24:25 +08:00
1 parent c77526e8c5
commit 7c158af3cc
10 files changed
+206 -92

No files matched your search

+14
View File
@@ -435,3 +435,17 @@ export const areaReplace = (areaName: string) => {
.replace('自治区', '')
.replace('省', '')
}
/**
* 解析 JSON 字符串
*
* @param str
*/
export function jsonParse(str: string) {
try {
return JSON.parse(str)
} catch (e) {
console.log(`str[${str}] 不是一个 JSON 字符串`)
return ''
}
}