增加下载数,页面跳转、展示优化
This commit is contained in:
@@ -38,8 +38,8 @@ function validateResult(result) {
|
||||
if (result.errCode == 200) {
|
||||
return true;
|
||||
} else if (result.errCode == 400) {
|
||||
var href = encodeURI(window.location.href);
|
||||
window.location = "static/manage/login.html?returnUrl=" + href;
|
||||
var href = encodeURIComponent(window.location.href);
|
||||
window.location = ctx + "static/manage/login.html?redirect=" + href;
|
||||
} else {
|
||||
alert(result.errMsg);
|
||||
}
|
||||
@@ -226,8 +226,8 @@ function ajaxTemp(url, dataSentType, dataReceiveType, paramsStr, successFunction
|
||||
contentType : "application/x-www-form-urlencoded; charset=UTF-8",
|
||||
success : function(msg) {
|
||||
if (msg.errCode == 400) {
|
||||
var href = encodeURI(window.location.href);
|
||||
window.location = "static/manage/login.html?returnUrl=" + href;
|
||||
var href = encodeURIComponent(window.location.href);
|
||||
window.location = ctx + "static/manage/login.html?redirect=" + href;
|
||||
} else {
|
||||
if (typeof successFunction == "function") {
|
||||
successFunction(msg, id);
|
||||
@@ -346,7 +346,7 @@ var common = {
|
||||
},
|
||||
getParam: function(name){
|
||||
var url = location.search;// 获取url中"?"符后的字串
|
||||
url = decodeURIComponent(url);
|
||||
// url = decodeURIComponent(url);
|
||||
if (url.indexOf("?") != -1) {
|
||||
var str = url.substr(1);
|
||||
strs = str.split("&");
|
||||
|
||||
@@ -74,16 +74,20 @@
|
||||
app.passwordError = "密码不能为空";
|
||||
return;
|
||||
}
|
||||
var returnUrl = common.getParam("returnUrl");
|
||||
if (!!returnUrl) {
|
||||
returnUrl = decodeURI(returnUrl);
|
||||
// 获取url中"?"符后的字串
|
||||
var href = location.href;
|
||||
var url = href.substring(href.indexOf("?"), href.length);
|
||||
var redirect = "";
|
||||
if (url.indexOf("redirect=") > 0) {
|
||||
redirect = url.substring(url.indexOf("redirect=") + 9, url.length);
|
||||
redirect = decodeURIComponent(redirect);
|
||||
} else {
|
||||
returnUrl = ctx + "static/manage/home.html";
|
||||
redirect = ctx + "static/manage/home.html";
|
||||
}
|
||||
post(ctx + "login", param, function (result) {
|
||||
console.log(result);
|
||||
if (result.errCode == 200) {
|
||||
location.href = returnUrl;
|
||||
location.href = redirect;
|
||||
} else {
|
||||
app.passwordError = "登录失败," + result.errMsg;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user