|
@@ -91,15 +91,18 @@ var loginPage = new Vue({
|
|
|
};
|
|
|
_self.setStorages( _self.userData);
|
|
|
// 登录成功页面跳转
|
|
|
- var beforePath = localStorage.getItem("loginBeforePath");
|
|
|
- if(_userIdentity == 4 || _userIdentity ==2){
|
|
|
- window.location.href = '/user/dashboard.html';
|
|
|
- }else if(_userIdentity == 3){
|
|
|
- window.location.href = '/supplier/dashboard.html';
|
|
|
- }else if (beforePath) {
|
|
|
- window.location.href = beforePath;
|
|
|
- }else {
|
|
|
- window.location.href = '/index.html';
|
|
|
+ var forwardUrl = document.referrer;
|
|
|
+ var getHrefUrl = $("#spiServer").val();
|
|
|
+ if(forwardUrl=="" || forwardUrl==undefined || forwardUrl==null || forwardUrl == getHrefUrl){
|
|
|
+ if(_userIdentity == 4 || _userIdentity ==2){
|
|
|
+ location.href = '/user/dashboard.html';
|
|
|
+ }else if(_userIdentity == 3){
|
|
|
+ location.href = '/supplier/dashboard.html';
|
|
|
+ }else{
|
|
|
+ location.href="/index.html";
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ location.href=""+forwardUrl+"";
|
|
|
}
|
|
|
}else if(response.code == -4){
|
|
|
window.location.href = '/bind.html';
|
|
@@ -136,7 +139,6 @@ var loginPage = new Vue({
|
|
|
UserApi.PostLoginAccount(params,function(response){
|
|
|
_self.loginLoading = false;
|
|
|
if(response.code === 0){
|
|
|
- console.log(response.data);
|
|
|
var _userIdentity = response.data.userIdentity;
|
|
|
_self.userData = {
|
|
|
account: response.data.account,
|
|
@@ -152,17 +154,20 @@ var loginPage = new Vue({
|
|
|
permission: response.data.userPermission,
|
|
|
token: response.data.token
|
|
|
};
|
|
|
- _self.setStorages( _self.userData);
|
|
|
+ _self.setStorages( _self.userData);
|
|
|
// 登录成功页面跳转
|
|
|
- var beforePath = localStorage.getItem("loginBeforePath");
|
|
|
- if(_userIdentity == 4 || _userIdentity ==2){
|
|
|
- window.location.href = '/user/dashboard.html';
|
|
|
- }else if(_userIdentity == 3){
|
|
|
- window.location.href = '/supplier/dashboard.html';
|
|
|
- }else if (beforePath) {
|
|
|
- window.location.href = beforePath;
|
|
|
- }else {
|
|
|
- window.location.href = '/index.html';
|
|
|
+ var forwardUrl = document.referrer;
|
|
|
+ var getHrefUrl = $("#spiServer").val();
|
|
|
+ if(forwardUrl=="" || forwardUrl==undefined || forwardUrl==null || forwardUrl == getHrefUrl){
|
|
|
+ if(_userIdentity == 4 || _userIdentity ==2){
|
|
|
+ location.href = '/user/dashboard.html';
|
|
|
+ }else if(_userIdentity == 3){
|
|
|
+ location.href = '/supplier/dashboard.html';
|
|
|
+ }else{
|
|
|
+ location.href="/index.html";
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ location.href=""+forwardUrl+"";
|
|
|
}
|
|
|
} else {// 登录失败
|
|
|
CAIMEI.Alert(response.msg,'确定',false);
|