A few days ago in the work, and mobile end of the interface to do when found that the front-end in the transfer of parameters when there are + or &, the server to get a string of + or & has become a space, the background Java program in parsing when the error!
The specific code is as follows:
$ (function () {var ISPC =! ( window.__detect.android| | window.__detect.ios| | Window.__detect.phone), Mooncakenums, mooncakeidentify= 0, <span style= "color: #ff0000;" >token = Usercookiecontrol.getcookie (' Authtoken '), App_args = token? ' &authtoken= ' +encodeuricomponent (token) + ' &from=m ': ',</span> Guagua_schma = ' Guagua://guagua::5: : 13:1;18:2 ',//guagua://guagua::8::21:2//exit login Address Logoutbackurl = ' http://event.guagua.cn/event/zhongqiu/index.html
';
Prevents users from repeatedly submitting function Blockajax (delay) {var $elem = $ (' body '), Isblock = $elem. attr (' Data-block ');
if (Isblock) return true;
$elem. attr (' Data-block ', ' block ');
settimeout (function () {$elem. removeattr (' Data-block '); }, delay| |
1200);
}//Login frame function Popuplogindlg () {if (ISPC) {//End login Guagualr._run (' l ');
else {window.location.href = Guagua_schma;
} function __checklogin () {var islogin = Checkloginstatus (); if (!islogin)Popuplogindlg (); Return!!
IsLogin;
//ios Home Hide Redemption button//if (Window.__detect.ios) $ (' #J_exchange_btn '). Hide ();
Home Redemption button $ (' #J_exchange_btn '). Bind (' click ', Function (e) {e.preventdefault ();
if (__checklogin ()) {window.location.href = './duihuan.html '; }
});
From the mobile app's page cookie to obtain the user's login information (Authtoken) contains + and & symbol, resulting in the server to obtain Authtoken parsing error, the solution is to Authtoken URL escape. The code is as follows:
App_args = token? ' &authtoken= ' +encodeuricomponent (token) + ' &from=m ': ',
This allows the server to get the normal Authtoken and resolve the user information.