瀏覽代碼

bug修改

wangfei 6 年之前
父節點
當前提交
953ccab65b
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      src/util/util.js

+ 1
- 1
src/util/util.js 查看文件

@@ -41,7 +41,7 @@ const toolClass = {
41 41
   },
42 42
   getCode: (appid) => {
43 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 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 46
     window.location.href = url
47 47
   },