Commit 2e328be8 authored by zhangyanni's avatar zhangyanni

登录-去#试一下console

parent dd42be55
......@@ -19,7 +19,7 @@
})
console.log(val)
console.log(arr)
window.location.href = document.location.origin+"/newPage?code="+arr[0]+"&state="+arr[1];
// window.location.href = document.location.origin+"/newPage?code="+arr[0]+"&state="+arr[1];
console.log(document.location.origin)
console.log(document.location.origin+"/newPage?code="+arr[0]+"&state="+arr[1])
// if(document.location.href.split("#")[0].indexOf("index.html")>-1){
......@@ -28,45 +28,45 @@
// window.location.href = document.location.href.split("/#")[0].split("?")[0]+"/#/newPage?code="+arr[0]+"&state="+arr[1];
// }
var _this = this;
// setTimeout(function(){
// if(arr[0]!=null||arr[0]!=undefined){
// let params = {
// code:arr[0],
// state:arr[1]
// }
// api.wechatLoginAxios(params).then((res)=>{
// if(res.code==0){
// console.log("调借口了")
// if(res.result!=null){
// console.log("进来1")
// if(_this.publicFun.getUserInfoCookieType()){
// _this.publicFun.removeCookieType();
// }
// _this.publicFun.setUserInfoCookieType(that.Base64.encode(JSON.stringify(res.result)));
// globalMsg.$emit("getUserInfo");
// _this.$router.push("/index");
// _this.publicFun.setUserInfoCookie("selected","index");
// globalMsg.$emit("sendSelected","index");
// } else{
// console.log("进来2")
// if(res.msg!=null){
// console.log("进来3")
// that.$router.push({path:"/bindAccount",query:{id:res.msg}});
// }else{
// window.location.href = document.location.origin+"/loginByPhone";
// }
// }
// }else{
// that.$toast(res.msg);
// }
// }).catch((err)=>{
// that.$toast(err);
// })
// }else{
// // var dataUrl = document.location.href.split("#/")[0]+"#/newPage";
// // window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx725d0e129f703106&redirect_uri="+encodeURIComponent(dataUrl)+"&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
// }
// },2000)
setTimeout(function(){
if(arr[0]!=null||arr[0]!=undefined){
let params = {
code:arr[0],
state:arr[1]
}
api.wechatLoginAxios(params).then((res)=>{
if(res.code==0){
console.log("调借口了")
if(res.result!=null){
console.log("进来1")
if(_this.publicFun.getUserInfoCookieType()){
_this.publicFun.removeCookieType();
}
_this.publicFun.setUserInfoCookieType(that.Base64.encode(JSON.stringify(res.result)));
globalMsg.$emit("getUserInfo");
_this.$router.push("/index");
_this.publicFun.setUserInfoCookie("selected","index");
globalMsg.$emit("sendSelected","index");
} else{
console.log("进来2")
if(res.msg!=null){
console.log("进来3")
that.$router.push({path:"/bindAccount",query:{id:res.msg}});
}else{
window.location.href = document.location.origin+"/loginByPhone";
}
}
}else{
that.$toast(res.msg);
}
}).catch((err)=>{
that.$toast(err);
})
}else{
// var dataUrl = document.location.href.split("#/")[0]+"#/newPage";
// window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx725d0e129f703106&redirect_uri="+encodeURIComponent(dataUrl)+"&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
}
},2000)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment