js链接中含有+号特殊字符处理,不能传到后台

用encodeURIComponent将特殊字符转义后即可。
实际用例:
export function publishNotice(contents,title) {
contents=encodeURIComponent(contents);
const data = {
title,
contents
}
console.log(“发布的内容:”+contents);
console.log(“title=”+title)
return fetch({
url: ‘/backManger/fmkj/HcNotices/publishNotice’ + getParams(data),
method: ‘post’
});
}

JS中含有特殊字符的处理

相关文章:

  • 2021-10-24
  • 2021-07-05
  • 2022-12-23
  • 2022-02-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-05
  • 2022-12-23
相关资源
相似解决方案