张延森 4 yıl önce
ebeveyn
işleme
dcdb01b990
2 değiştirilmiş dosya ile 2 ekleme ve 9 silme
  1. 1
    1
      config/index.js
  2. 1
    8
      src/util/getCodeUrl.js

+ 1
- 1
config/index.js Dosyayı Görüntüle

@@ -45,7 +45,7 @@ const config = {
45 45
     }
46 46
   },
47 47
   h5: {
48
-    publicPath: '/',
48
+    publicPath: './',
49 49
     staticDirectory: 'static',
50 50
     postcss: {
51 51
       autoprefixer: {

+ 1
- 8
src/util/getCodeUrl.js Dosyayı Görüntüle

@@ -4,14 +4,7 @@ const appid = APPID
4 4
 
5 5
 export default function(path) {
6 6
 
7
-    console.log(window.location,'window.location')
8
-  const  redirect_uri = `${window.location.origin}/#/${window.location.hash}`
9
-
10
-
11
-//   window.location.origin = `${window.location.protocol}//${Taro.Current.router.path
12
-//       window.location.hostname
13
-//     }${window.location.port ? ':' + window.location.port : ''}`;
14
-    console.log(APPID,redirect_uri,'')
7
+    const  redirect_uri = `${window.location.origin}${window.location.pathname}#/${window.location.hash}`
15 8
 
16 9
     const url=`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(redirect_uri)}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
17 10
     return url