Resolve garbled characters in the front-end when passing Chinese to the back-end

//If you are using a tomcat server, remember to first
    add URLEncoding="utf-8" to conf/server.xml //, otherwise no matter how much you toss and encode on the interface, the Chinese data obtained in the background will still be garbled
 ① <Connector URIEncoding = "utf-8" connectionTimeout = "20000" port = "8080" 
 protocol = "HTTP/1.1" redirectPort = "8443" />
      ②Encode the transmitted data : encodeURI (urlParam);

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326867040&siteId=291194637