1. When the data format returned by the backend is "{"url":"https://...."}", we need to use JSON.parse to convert the data format to complete the data echo
But if you use JSON.parse directly, it is very likely that the following error will be reported
2. We can use try catch to capture to avoid error reporting
function parseJson(str) {
try {
return JSON.parse(str);
} catch (e) {
return {};
}
}
3. The method parseJson() can be directly introduced in html
<img :src="parseJson(userInfo?.signUrl).url" />