hsy 4 月之前
父節點
當前提交
e73d05003c
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/views/promotion/goods.vue

+ 4 - 2
src/views/promotion/goods.vue

@@ -208,7 +208,9 @@ const getWeChatAuth = async () => {
     sessionStorage.setItem("paymentSettingId", paymentSettingId);
     sessionStorage.setItem("paymentSettingId", paymentSettingId);
     //跳转微信授权
     //跳转微信授权
 
 
-    const redirectUri = encodeURIComponent(location.href);
+    const redirectUri = encodeURIComponent(
+      `${location.origin}${location.pathname}?promotionGoodsId=${route.query.promotionGoodsId}&promotionSiteId=${route.query.promotionSiteId}`
+    );
     location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${redirectUri}&response_type=code&scope=snsapi_base&state=123#wechat_redirect`;
     location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${redirectUri}&response_type=code&scope=snsapi_base&state=123#wechat_redirect`;
     return;
     return;
   }
   }
@@ -249,7 +251,7 @@ const init = async () => {
   if (!code || !paymentSettingId) {
   if (!code || !paymentSettingId) {
     return getWeChatAuth();
     return getWeChatAuth();
   }
   }
-  getOpenId()
+  getOpenId();
   // wxConfig();
   // wxConfig();
 };
 };
 onMounted(() => init());
 onMounted(() => init());