【功能完善】商城:客服消息改为游标查询,消息 JSON 化

This commit is contained in:
puhui999
2024-11-10 17:56:58 +08:00
parent 8e64ecebd1
commit 94e0dd4f5d
5 changed files with 65 additions and 22 deletions
+13
View File
@@ -131,3 +131,16 @@ export const copyValueToTarget = (target, source) => {
// 更新目标对象值
Object.assign(target, newObj)
}
/**
* 解析 JSON 字符串
*
* @param str
*/
export function jsonParse(str) {
try {
return JSON.parse(str)
} catch (e) {
console.error(`str[${str}] 不是一个 JSON 字符串`)
return ''
}
}