Commit eaf6f86a authored by 郭志伟's avatar 郭志伟

fix: 微信静默授权

parent 86d7e7db
import { setShare } from "@/service/wxJsSdk"; import { setShare } from "@/service/wxJsSdk";
const currentOrigin = window.location.origin + "/share.html?path="; const currentOrigin = window.location.origin + "/share.html#";
const logo = currentOrigin + "/shareImg/index.png"; const logo = currentOrigin + "/shareImg/index.png";
const shareList = { const shareList = {
home: { home: {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Description: weixin-js-sdk * @Description: weixin-js-sdk
* @LastEditors: gzw * @LastEditors: gzw
* @Date: 20120-08-30 18:40:11 * @Date: 20120-08-30 18:40:11
* @LastEditTime: 2020-09-01 17:23:22 * @LastEditTime: 2020-09-01 18:00:52
*/ */
import cfg from "@/config/index"; import cfg from "@/config/index";
import { getwxAuth } from "@/api/user"; import { getwxAuth } from "@/api/user";
...@@ -75,7 +75,7 @@ export function checkOpenId() { ...@@ -75,7 +75,7 @@ export function checkOpenId() {
cfg.wxAppId + cfg.wxAppId +
"&redirect_uri=" + "&redirect_uri=" +
encodeURIComponent(local) + encodeURIComponent(local) +
"&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect"; "&response_type=code&scope=snsapi_base&state=1#wechat_redirect";
return false; return false;
} else { } else {
return true; return true;
......
...@@ -222,15 +222,15 @@ export default { ...@@ -222,15 +222,15 @@ export default {
this.checkLogin(); this.checkLogin();
} }
}, },
created() {
!checkOpenId();
},
mounted() { mounted() {
this.updateRemain(); this.updateRemain();
}, },
methods: { methods: {
...mapActions(["setIsShowLogin"]), ...mapActions(["setIsShowLogin"]),
checkLogin() { checkLogin() {
if (!checkOpenId()) {
return;
}
if (!this.isLogin) { if (!this.isLogin) {
this.setIsShowLogin(true); this.setIsShowLogin(true);
return; return;
......
...@@ -106,6 +106,7 @@ import Detail from "@/api/detail.zhongan.yiwai"; ...@@ -106,6 +106,7 @@ import Detail from "@/api/detail.zhongan.yiwai";
import { trail, list } from "@/api/product"; import { trail, list } from "@/api/product";
import { isIdNo } from "@/service/validation"; import { isIdNo } from "@/service/validation";
import { getRealAge, getBirthDate } from "@/service/utils"; import { getRealAge, getBirthDate } from "@/service/utils";
import { checkOpenId } from "@/service/wxJsSdk";
export default { export default {
name: "GoodsDetail-AI", name: "GoodsDetail-AI",
...@@ -223,6 +224,9 @@ export default { ...@@ -223,6 +224,9 @@ export default {
return JSON.parse(JSON.stringify(this.formData)); return JSON.parse(JSON.stringify(this.formData));
} }
}, },
created() {
checkOpenId();
},
mounted() { mounted() {
this.getDetail(); this.getDetail();
}, },
......
...@@ -235,6 +235,9 @@ export default { ...@@ -235,6 +235,9 @@ export default {
return JSON.parse(JSON.stringify(this.formData)); return JSON.parse(JSON.stringify(this.formData));
} }
}, },
created() {
checkOpenId();
},
mounted() { mounted() {
this.getDetail(); this.getDetail();
}, },
...@@ -252,9 +255,6 @@ export default { ...@@ -252,9 +255,6 @@ export default {
this.$notify({ type: "warn", message: "被保人年龄不在可投保范围,请仔细核对" }); this.$notify({ type: "warn", message: "被保人年龄不在可投保范围,请仔细核对" });
return; return;
} }
if (!checkOpenId()) {
return;
}
if (localStorage.get("mongoToken")) { if (localStorage.get("mongoToken")) {
this.$refs.insureForm.getFamilyList(true).then(() => { this.$refs.insureForm.getFamilyList(true).then(() => {
setTimeout(() => { setTimeout(() => {
......
...@@ -210,6 +210,9 @@ export default { ...@@ -210,6 +210,9 @@ export default {
return JSON.parse(JSON.stringify(this.formData)); return JSON.parse(JSON.stringify(this.formData));
} }
}, },
created() {
checkOpenId();
},
mounted() { mounted() {
this.getDetail(); this.getDetail();
}, },
...@@ -237,9 +240,6 @@ export default { ...@@ -237,9 +240,6 @@ export default {
// this.currentPupopIndex = 6; // this.currentPupopIndex = 6;
// return; // return;
// } // }
if (!checkOpenId()) {
return;
}
this.showLoginPopup(); this.showLoginPopup();
this.popupShow = false; this.popupShow = false;
}, },
......
...@@ -218,6 +218,9 @@ export default { ...@@ -218,6 +218,9 @@ export default {
return JSON.parse(JSON.stringify(this.formData)); return JSON.parse(JSON.stringify(this.formData));
} }
}, },
created() {
checkOpenId();
},
mounted() { mounted() {
this.getDetail(); this.getDetail();
}, },
...@@ -235,9 +238,6 @@ export default { ...@@ -235,9 +238,6 @@ export default {
this.$notify({ type: "warning", message: "被保人年龄不在可投保范围,请仔细核对" }); this.$notify({ type: "warning", message: "被保人年龄不在可投保范围,请仔细核对" });
return; return;
} }
if (!checkOpenId()) {
return;
}
if (localStorage.get("mongoToken")) { if (localStorage.get("mongoToken")) {
socialSecurityCache = this.formData.socialSecurity; socialSecurityCache = this.formData.socialSecurity;
this.$refs.insureForm.getFamilyList(true).then(() => { this.$refs.insureForm.getFamilyList(true).then(() => {
......
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