|
@@ -19,8 +19,8 @@ if(localStorage.getItem('userInfo')){
|
|
|
var urlForWeChat = 'https://www.caimei365.com/we_chat/redirect_uri.html';
|
|
|
$.get(spiServer+'/user/authorizationLink?mode=1&redirectUri='+urlForWeChat, function(r){
|
|
|
if(r.code===0 && r.data){
|
|
|
- setBaseCookie("loginBeforePath", window.location.href);
|
|
|
setBaseCookie("weChatAutoLogin", 1);
|
|
|
+ setBeforeUrl();
|
|
|
window.location.href = r.data;
|
|
|
}
|
|
|
});
|
|
@@ -197,7 +197,7 @@ $(function(){
|
|
|
text: btnTxt,
|
|
|
btnClass: 'btn-confirm-login',
|
|
|
action: function(){
|
|
|
- setBaseCookie("loginBeforePath", window.location.href);
|
|
|
+ setBeforeUrl();
|
|
|
window.location.href = '/login.html';
|
|
|
}
|
|
|
},
|
|
@@ -211,7 +211,7 @@ $(function(){
|
|
|
// 去登录弹窗
|
|
|
$('body').on("click", '.toLogin',function () {
|
|
|
//loginAert('<span>你还未登录</span><span>请登录后再进行购买</span>', '去登录');
|
|
|
- setBaseCookie("loginBeforePath", window.location.href);
|
|
|
+ setBeforeUrl();
|
|
|
window.location.href = '/login.html';
|
|
|
});
|
|
|
// 退出登录
|
|
@@ -325,6 +325,14 @@ $(function(){
|
|
|
});
|
|
|
|
|
|
});
|
|
|
+
|
|
|
+function setBeforeUrl(){
|
|
|
+ var baseUrl = window.location.href;
|
|
|
+ var flag = baseUrl.indexOf('/login.html')>0 || baseUrl.indexOf('/register.html')>0 || baseUrl.indexOf('/we_chat/redirect_uri.html')>0;
|
|
|
+ if(!flag){
|
|
|
+ setBaseCookie("loginBeforePath", baseUrl);
|
|
|
+ }
|
|
|
+}
|
|
|
// 公共方法
|
|
|
function setBaseCookie(cname,cvalue,exdays){
|
|
|
if (exdays) {
|
|
@@ -580,7 +588,7 @@ function toBeforePath(){
|
|
|
window.location.href = '/index.html';
|
|
|
}
|
|
|
function toLogin() {//去登录
|
|
|
- setBaseCookie("loginBeforePath", window.location.href);
|
|
|
+ setBeforeUrl();
|
|
|
window.location.href = '/login.html';
|
|
|
}
|
|
|
function upgrade () { //升级会员
|