|
@@ -13,7 +13,6 @@ export function getCode(url = window.location.href) {
|
|
|
// 没有code,就重定向到地址https://www.xyyxt.net?ask_type=https://api.xyyxt.net/pages2/order/confirm_pay 去获取code,授权后就会把code带上然后访问域名
|
|
|
// ?fromCart=&code=061F5a1w3aolh03SLe1w3sMsCF4F5a16&state=STATE
|
|
|
if (process.env.NODE_ENV !== "development") {
|
|
|
- url = url.split("//")[1];
|
|
|
// 跳自己授权
|
|
|
if (store.getters.config.gzhSelfLicense) {
|
|
|
api.getWxConfig().then((res) => {
|
|
@@ -21,12 +20,13 @@ export function getCode(url = window.location.href) {
|
|
|
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${
|
|
|
res.data.data.gzhAppId
|
|
|
}&redirect_uri=${encodeURIComponent(
|
|
|
- "https://" + url
|
|
|
+ url
|
|
|
)}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
|
|
|
);
|
|
|
});
|
|
|
} else {
|
|
|
- location.replace("https://www.xyyxt.net/?ask_type=" + url);
|
|
|
+ url = url.split("//")[1];
|
|
|
+ location.replace("https://www.xyyxt.net/home/index2?ask_type=" + url);
|
|
|
}
|
|
|
}
|
|
|
}
|