可以使用decodeURIComponent() 对参数进行编码
async fn(str){
let val = encodeURIComponent(str);
const res = await getApi(val);
...
}
可以使用decodeURIComponent() 对参数进行编码
async fn(str){
let val = encodeURIComponent(str);
const res = await getApi(val);
...
}