wangfei 6 lat temu
rodzic
commit
953ccab65b
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1
    1
      src/util/util.js

+ 1
- 1
src/util/util.js Wyświetl plik

41
   },
41
   },
42
   getCode: (appid) => {
42
   getCode: (appid) => {
43
     wechatConfig.appid = appid
43
     wechatConfig.appid = appid
44
-    const refer = window.encodeURIComponent(window.location.href.replace(/code=[^?&=]+/, '').replace(/state=[^?&=]+/, '').replace('?&', '?'))
44
+    const refer = window.encodeURIComponent(window.location.href.replace(/code=[^?&#/=]+/, '').replace(/state=[^?&=#/]+/, '').replace('?&', '?'))
45
     let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${refer}&response_type=${wechatConfig.response_type}&scope=${wechatConfig.scope}&state=${wechatConfig.state}#wechat_redirect`
45
     let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${refer}&response_type=${wechatConfig.response_type}&scope=${wechatConfig.scope}&state=${wechatConfig.state}#wechat_redirect`
46
     window.location.href = url
46
     window.location.href = url
47
   },
47
   },