Commit 6c39e25a authored by zhangyanni's avatar zhangyanni

授权相关去#试一下

parent 8b6b097a
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
}; };
function handleToHome() { function handleToHome() {
self.location = document.location.href.split("#/")[0]+"#/"; self.location = document.location.origin;
} }
......
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
}; };
function handleToHome() { function handleToHome() {
self.location = document.location.href.split("#/")[0] + "#/"; self.location = document.location.origin;
} }
......
...@@ -337,7 +337,7 @@ ...@@ -337,7 +337,7 @@
}, },
handleWechatLogin() { handleWechatLogin() {
var url = document.location.href.split("#/")[0] + "#/newPage"; var url = document.location.origin+"/newPage";
window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx725d0e129f703106&redirect_uri=" + encodeURIComponent(url) + "&response_type=code&scope=snsapi_userinfo&state=STATE&connect_redirect=1#wechat_redirect"; window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx725d0e129f703106&redirect_uri=" + encodeURIComponent(url) + "&response_type=code&scope=snsapi_userinfo&state=STATE&connect_redirect=1#wechat_redirect";
}, },
}, },
......
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
let query= this.$route.query; let query= this.$route.query;
switch (this.pageType) { switch (this.pageType) {
case 1: case 1:
successVal = document.location.href.split("#/")[0]+"#/activitydetail?page="+this.$route.query.page+"&id="+this.$route.query.id+"&isDetail=true"+"&isApply="+this.$route.query.isApply+"&type="+this.$route.query.type+"&lang="+this.lang; successVal = document.location.origin+"/activitydetail?page="+this.$route.query.page+"&id="+this.$route.query.id+"&isDetail=true"+"&isApply="+this.$route.query.isApply+"&type="+this.$route.query.type+"&lang="+this.lang;
urlData = this.$route.name=='activitydetail'?document.location.href+"&lang="+this.lang:successVal; urlData = this.$route.name=='activitydetail'?document.location.href+"&lang="+this.lang:successVal;
break; break;
case 2: case 2:
......
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
// //
var userAgent = navigator.userAgent, shareUrl; var userAgent = navigator.userAgent, shareUrl;
var isMini = /miniProgram/i.test(userAgent); var isMini = /miniProgram/i.test(userAgent);
var urlData = (document.location.href.split("#/")[0]+"#/industryReportDetail")+"?id="+this.currentData.reportId + "?lang=" + this.lang; var urlData = (document.location.origin+"/industryReportDetail")+"?id="+this.currentData.reportId + "?lang=" + this.lang;
if (isMini) { if (isMini) {
if (data == 2) { if (data == 2) {
shareUrl = '/pages/industryReport/industryReport?isShareIndustryReport=true&url=' + JSON.stringify(query); shareUrl = '/pages/industryReport/industryReport?isShareIndustryReport=true&url=' + JSON.stringify(query);
...@@ -229,7 +229,7 @@ ...@@ -229,7 +229,7 @@
call(data, command) { call(data, command) {
this.currentData = data; this.currentData = data;
let query = this.$route.query,hrefUrl = (document.location.href.split("#/")[0]+"#/industryReportDetail")+"?id="+this.currentData.reportId+"&lang="+this.lang; let query = this.$route.query,hrefUrl = (document.location.origin+"/industryReportDetail")+"?id="+this.currentData.reportId+"&lang="+this.lang;
query.title = data.reportTitle; query.title = data.reportTitle;
query.lang = this.lang; query.lang = this.lang;
query.rDeviceId = this.publicFun.getCookie("getGuid32"); query.rDeviceId = this.publicFun.getCookie("getGuid32");
...@@ -384,7 +384,7 @@ ...@@ -384,7 +384,7 @@
title: data.reportTitle, title: data.reportTitle,
desc: this.$t("shareInfo.industryReportZy"), desc: this.$t("shareInfo.industryReportZy"),
img: this.lang == 1 ? (this.frontImgUrl + "/public/industryReportShareZh.jpg") : (this.frontImgUrl + "/public/industryReportShareEn.jpg"), img: this.lang == 1 ? (this.frontImgUrl + "/public/industryReportShareZh.jpg") : (this.frontImgUrl + "/public/industryReportShareEn.jpg"),
link: (document.location.href.split("#/")[0]+"#/industryReportDetail")+"?id="+this.currentData.reportId + "&rDeviceId=" + this.publicFun.getCookie("getGuid32") + "&rEmpId=" + (this.userInfo ? this.userInfo.empId : undefined) + "&rTargetType=" link: (document.location.origin+"/industryReportDetail")+"?id="+this.currentData.reportId + "&rDeviceId=" + this.publicFun.getCookie("getGuid32") + "&rEmpId=" + (this.userInfo ? this.userInfo.empId : undefined) + "&rTargetType="
} }
if (Object.keys(this.configVal).length != 0) { if (Object.keys(this.configVal).length != 0) {
this.isShare = true; this.isShare = true;
...@@ -393,7 +393,7 @@ ...@@ -393,7 +393,7 @@
} }
var that = this; var that = this;
if (this.currentData) { if (this.currentData) {
var url = (document.location.href.split("#/")[0]+"#/industryReportDetail")+"?id="+this.currentData.reportId; var url = (document.location.origin+"/industryReportDetail")+"?id="+this.currentData.reportId;
let dataValObj = { let dataValObj = {
title: this.currentData.reportTitle, // 分享标题 that.detailInfo.projectName title: this.currentData.reportTitle, // 分享标题 that.detailInfo.projectName
...@@ -581,7 +581,7 @@ ...@@ -581,7 +581,7 @@
}); });
if (this.currentData) { if (this.currentData) {
var hrefUrl = (document.location.href.split("#/")[0]+"#/industryReportDetail")+"?id="+this.currentData.reportId+"&lang="+this.lang; var hrefUrl = (document.location.origin+"/industryReportDetail")+"?id="+this.currentData.reportId+"&lang="+this.lang;
let dataVal = { let dataVal = {
title: that.currentData.reportTitle, // 分享标题 title: that.currentData.reportTitle, // 分享标题
......
...@@ -22,11 +22,11 @@ ...@@ -22,11 +22,11 @@
val.forEach((item)=>{ val.forEach((item)=>{
arr.push(item.split("=")[1]); arr.push(item.split("=")[1]);
}) })
if(document.location.href.split("#")[0].indexOf("index.html")>-1){ // if(document.location.href.split("#")[0].indexOf("index.html")>-1){
window.location.href = document.location.href.split("#")[0].split("?")[0]+"#/authPage?code="+arr[0]+"&state="+arr[1]; // window.location.href = document.location.origin+"/authPage?code="+arr[0]+"&state="+arr[1];
}else{ // }else{
window.location.href = document.location.href.split("/#")[0].split("?")[0]+"/#/authPage?code="+arr[0]+"&state="+arr[1]; // window.location.href = document.location.href.split("/#")[0].split("?")[0]+"/#/authPage?code="+arr[0]+"&state="+arr[1];
} // }
var _this = this; var _this = this;
setTimeout(function(){ setTimeout(function(){
if(arr[0]!=null||arr[0]!=undefined){ if(arr[0]!=null||arr[0]!=undefined){
...@@ -44,16 +44,16 @@ ...@@ -44,16 +44,16 @@
_this.publicFun.setUserInfoCookieType(that.Base64.encode(JSON.stringify(res.result))); _this.publicFun.setUserInfoCookieType(that.Base64.encode(JSON.stringify(res.result)));
globalMsg.$emit("getUserInfo"); globalMsg.$emit("getUserInfo");
_this.publicFun.setUserInfoCookie("openId",res.result.openId); _this.publicFun.setUserInfoCookie("openId",res.result.openId);
window.location.href = document.location.href.split("#")[0].split("?")[0]+"#/redEnvelopeActJoin?id="+_this.publicFun.getCookie("currentChannelId")+"&flag=6"; window.location.href = document.location.origin+"/redEnvelopeActJoin?id="+_this.publicFun.getCookie("currentChannelId")+"&flag=6";
globalMsg.$emit("postFlagIsReturn",true); globalMsg.$emit("postFlagIsReturn",true);
} else{ } else{
if(res.msg!=null){ if(res.msg!=null){
that.publicFun.setUserInfoCookie("openId",res.msg); that.publicFun.setUserInfoCookie("openId",res.msg);
window.location.href = document.location.href.split("#")[0].split("?")[0]+"#/redEnvelopeActDetail?id="+_this.publicFun.getCookie("currentChannelId"); window.location.href = document.location.origin+"/redEnvelopeActDetail?id="+_this.publicFun.getCookie("currentChannelId");
// _this.$router.push({path:"/redEnvelopeActDetail",query:{id:this.publicFun.getCookie("currentChannelId")}}); // _this.$router.push({path:"/redEnvelopeActDetail",query:{id:this.publicFun.getCookie("currentChannelId")}});
}else{ }else{
window.history.go(-1); window.history.go(-1);
// window.location.href = document.location.href.split("#")[0].split("?")[0]+"#/activitylist"; // window.location.href = document.location.origin+"/activitylist";
} }
} }
}else{ }else{
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
arr.push(item.split("=")[1]); arr.push(item.split("=")[1]);
}) })
if(document.location.href.split("#")[0].indexOf("index.html")>-1){ if(document.location.href.split("#")[0].indexOf("index.html")>-1){
window.location.href = document.location.href.split("#")[0].split("?")[0]+"#/exchangeAuthPage?code="+arr[0]+"&state="+arr[1]; window.location.href = document.location.origin+"/exchangeAuthPage?code="+arr[0]+"&state="+arr[1];
}else{ }else{
window.location.href = document.location.href.split("/#")[0].split("?")[0]+"/#/exchangeAuthPage?code="+arr[0]+"&state="+arr[1]; window.location.href = document.location.href.split("/#")[0].split("?")[0]+"/#/exchangeAuthPage?code="+arr[0]+"&state="+arr[1];
} }
...@@ -44,16 +44,16 @@ ...@@ -44,16 +44,16 @@
_this.publicFun.setUserInfoCookieType(that.Base64.encode(JSON.stringify(res.result))); _this.publicFun.setUserInfoCookieType(that.Base64.encode(JSON.stringify(res.result)));
globalMsg.$emit("getUserInfo"); globalMsg.$emit("getUserInfo");
_this.publicFun.setUserInfoCookie("openId",res.result.openId); _this.publicFun.setUserInfoCookie("openId",res.result.openId);
window.location.href = document.location.href.split("#")[0].split("?")[0]+"#/integralExchange"; window.location.href = document.location.origin+"/integralExchange";
globalMsg.$emit("postFlagIsReturn",true); globalMsg.$emit("postFlagIsReturn",true);
} else{ } else{
if(res.msg!=null){ if(res.msg!=null){
that.publicFun.setUserInfoCookie("openId",res.msg); that.publicFun.setUserInfoCookie("openId",res.msg);
window.location.href = document.location.href.split("#")[0].split("?")[0]+"#/integralExchange"; window.location.href = document.location.origin+"/integralExchange";
// _this.$router.push({path:"/redEnvelopeActDetail",query:{id:this.publicFun.getCookie("currentChannelId")}}); // _this.$router.push({path:"/redEnvelopeActDetail",query:{id:this.publicFun.getCookie("currentChannelId")}});
}else{ }else{
window.history.go(-1); window.history.go(-1);
// window.location.href = document.location.href.split("#")[0].split("?")[0]+"#/activitylist"; // window.location.href = document.location.origin+"/activitylist";
} }
} }
}else{ }else{
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
}, },
handleWechatLogin(){ handleWechatLogin(){
var url = document.location.href.split("#/")[0]+"#/newPage"; var url = document.location.origin+"/newPage";
window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx725d0e129f703106&redirect_uri="+encodeURIComponent(url)+"&response_type=code&scope=snsapi_userinfo&state=STATE&connect_redirect=1#wechat_redirect"; window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx725d0e129f703106&redirect_uri="+encodeURIComponent(url)+"&response_type=code&scope=snsapi_userinfo&state=STATE&connect_redirect=1#wechat_redirect";
}, },
......
...@@ -17,11 +17,7 @@ ...@@ -17,11 +17,7 @@
val.forEach((item)=>{ val.forEach((item)=>{
arr.push(item.split("=")[1]); arr.push(item.split("=")[1]);
}) })
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){ // if(document.location.href.split("#")[0].indexOf("index.html")>-1){
// window.location.href = document.location.href.split("#")[0].split("?")[0]+"#/newPage?code="+arr[0]+"&state="+arr[1]; // window.location.href = document.location.href.split("#")[0].split("?")[0]+"#/newPage?code="+arr[0]+"&state="+arr[1];
// }else{ // }else{
...@@ -36,9 +32,7 @@ ...@@ -36,9 +32,7 @@
} }
api.wechatLoginAxios(params).then((res)=>{ api.wechatLoginAxios(params).then((res)=>{
if(res.code==0){ if(res.code==0){
console.log("调借口了")
if(res.result!=null){ if(res.result!=null){
console.log("进来1")
if(_this.publicFun.getUserInfoCookieType()){ if(_this.publicFun.getUserInfoCookieType()){
_this.publicFun.removeCookieType(); _this.publicFun.removeCookieType();
} }
...@@ -48,9 +42,7 @@ ...@@ -48,9 +42,7 @@
_this.publicFun.setUserInfoCookie("selected","index"); _this.publicFun.setUserInfoCookie("selected","index");
globalMsg.$emit("sendSelected","index"); globalMsg.$emit("sendSelected","index");
} else{ } else{
console.log("进来2")
if(res.msg!=null){ if(res.msg!=null){
console.log("进来3")
that.$router.push({path:"/bindAccount",query:{id:res.msg}}); that.$router.push({path:"/bindAccount",query:{id:res.msg}});
}else{ }else{
window.location.href = document.location.origin+"/loginByPhone"; window.location.href = document.location.origin+"/loginByPhone";
......
...@@ -292,7 +292,7 @@ ...@@ -292,7 +292,7 @@
// //
var userAgent = navigator.userAgent,shareUrl; var userAgent = navigator.userAgent,shareUrl;
var isMini = /miniProgram/i.test(userAgent); var isMini = /miniProgram/i.test(userAgent);
var urlData = this.isActivityList?document.location.href:document.location.href.split("#/")[0]+"#/secondStageDetail?subId="+that.currentData.id+"&proId="+that.currentData.projectId+"&activityId="+that.$route.query.id+"&stage="+this.$route.query.stage; var urlData = this.isActivityList?document.location.href:document.location.origin+"/secondStageDetail?subId="+that.currentData.id+"&proId="+that.currentData.projectId+"&activityId="+that.$route.query.id+"&stage="+this.$route.query.stage;
query.isList = this.isActivityList; query.isList = this.isActivityList;
query.proId = that.currentData.projectId; query.proId = that.currentData.projectId;
query.activityId = that.$route.query.id; query.activityId = that.$route.query.id;
...@@ -551,7 +551,7 @@ ...@@ -551,7 +551,7 @@
this.isActivityList=false; this.isActivityList=false;
this.currentData = item; this.currentData = item;
if(this.currentData){ if(this.currentData){
var url = document.location.href.split("#/")[0]+"#/secondStageDetail?subId="+that.currentData.id+"&proId="+that.currentData.projectId+"&activityId="+that.$route.query.id+"&stage="+this.$route.query.stage; var url = document.location.origin+"/secondStageDetail?subId="+that.currentData.id+"&proId="+that.currentData.projectId+"&activityId="+that.$route.query.id+"&stage="+this.$route.query.stage;
let dataValObj = { let dataValObj = {
title: "我正在TechBook参与项目评选活动,快来给我打分吧,让我的项目成为明日之星!", // 分享标题 that.detailInfo.projectName title: "我正在TechBook参与项目评选活动,快来给我打分吧,让我的项目成为明日之星!", // 分享标题 that.detailInfo.projectName
......
...@@ -1225,7 +1225,7 @@ ...@@ -1225,7 +1225,7 @@
// //
var userAgent = navigator.userAgent, shareUrl; var userAgent = navigator.userAgent, shareUrl;
var isMini = /miniProgram/i.test(userAgent); var isMini = /miniProgram/i.test(userAgent);
var urlData = document.location.href.split("#/")[0] + "#/topicDetails?id=" + that.topicInfo.topicId; var urlData = document.location.origin + "/topicDetails?id=" + that.topicInfo.topicId;
if (isMini) { if (isMini) {
that.dialogVisible = true; that.dialogVisible = true;
let dataVal = { let dataVal = {
...@@ -1300,7 +1300,7 @@ ...@@ -1300,7 +1300,7 @@
this.currentData = data; this.currentData = data;
this.isShareAll = false; this.isShareAll = false;
let query = this.$route.query, resultTitle; let query = this.$route.query, resultTitle;
var urlData = document.location.href.split("#/")[0] + "#/topicDetails?id=" + this.topicInfo.topicId; var urlData = document.location.origin + "/topicDetails?id=" + this.topicInfo.topicId;
var str = this.publicFun.isHasTopicTitle("#", data.discussContent); var str = this.publicFun.isHasTopicTitle("#", data.discussContent);
var simpleContent = data.pcState==0?this.publicFun.getTitlewith(data.discussContent, data.projectList):this.publicFun.getTitlewith(data.simpleContent, data.projectList); var simpleContent = data.pcState==0?this.publicFun.getTitlewith(data.discussContent, data.projectList):this.publicFun.getTitlewith(data.simpleContent, data.projectList);
......
...@@ -375,7 +375,7 @@ ...@@ -375,7 +375,7 @@
// //
var userAgent = navigator.userAgent, shareUrl; var userAgent = navigator.userAgent, shareUrl;
var isMini = /miniProgram/i.test(userAgent); var isMini = /miniProgram/i.test(userAgent);
var urlData = document.location.href.split("#/")[0] + "#/topicList"; var urlData = document.location.origin + "/topicList";
if (isMini) { if (isMini) {
that.dialogVisible = true; that.dialogVisible = true;
let dataVal = { let dataVal = {
......
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