mirror of
https://github.com/yudaocode/yudao-ui-admin-vue3.git
synced 2026-05-11 17:13:43 +00:00
form-create: 字典选择器分离,重新封装 api 选择器
This commit is contained in:
@@ -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 ''
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user