|
|
@@ -39,7 +39,28 @@ Ext.define('erp.controller.login', {
|
|
|
//设置cookie
|
|
|
me.setCookie('username',values.name,'/',14);
|
|
|
me.setCookie('password',values.password,'/',14);
|
|
|
- window.location.reload();
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取链接参数
|
|
|
+ *
|
|
|
+ * @param key
|
|
|
+ * 参数的键
|
|
|
+ * @returns 参数的值
|
|
|
+ */
|
|
|
+ var getParameter= function(key) {
|
|
|
+ var reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)");
|
|
|
+ var r = window.location.search.substr(1).match(reg);
|
|
|
+ if (r != null)
|
|
|
+ return decodeURI(r[2]);
|
|
|
+ return null;
|
|
|
+ };
|
|
|
+ var returnUrl=getParameter('returnUrl');
|
|
|
+ if(returnUrl && decodeURIComponent(returnUrl) != window.location.href){
|
|
|
+ // 回到登录前的页面
|
|
|
+ window.location.href = decodeURIComponent(returnUrl);
|
|
|
+ }else{
|
|
|
+ window.location.reload();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|