shaogen1995 il y a 6 mois
Parent
commit
42518d8451

+ 7 - 0
展示端/public/index.html

@@ -8,6 +8,13 @@
     <meta name="description" content="Web site created using create-react-app" />
     <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
 
+    <script>
+      // 测试环境域名
+      const weiXinLoginBackUrlTemp = 'https://sit-hqbooking.4dage.com'
+      // 甲方域名
+      // const weiXinLoginBackUrlTemp =''
+    </script>
+
     <!--
       manifest.json provides metadata used when your web app is installed on a
       user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/

+ 2 - 1
展示端/src/pages/Z1login/index.tsx

@@ -7,6 +7,7 @@ import { setTokenInfo } from '@/utils/storage'
 import { MessageFu } from '@/utils/message'
 import { useParams } from 'react-router-dom'
 import { API_login } from '@/store/action/all'
+import { baseUrlTemp } from '@/utils/http'
 function Z1login() {
   // 获取地址栏参数 1:课程 2:展馆
   const urlObjTemp: any = useParams()
@@ -15,7 +16,7 @@ function Z1login() {
   const getUserCode = useCallback(() => {
     //此处的ID是在文档的开发-基本配置里面
     let appid = 'wxcf0db4440f05e3a5'
-    let url = `https://sit-hqbooking.4dage.com/web/#/login/${urlObjTemp.key}`
+    let url = `${baseUrlTemp}/web/#/login/${urlObjTemp.key}`
     window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(
       url
     )}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`

+ 2 - 0
展示端/src/types/declaration.d.ts

@@ -6,3 +6,5 @@ declare module '*.gif'
 declare module '*.svg'
 declare module 'js-export-excel'
 declare module 'braft-utils'
+
+declare const weiXinLoginBackUrlTemp: string

+ 1 - 1
展示端/src/utils/http.ts

@@ -6,7 +6,7 @@ import { domShowFu } from './domShow'
 
 const envFlag = process.env.NODE_ENV === 'development'
 
-const baseUrlTemp = 'https://sit-hqbooking.4dage.com' // 测试环境
+export const baseUrlTemp = weiXinLoginBackUrlTemp // 测试环境
 // const baseUrlTemp = 'http://192.168.20.61:8091' // 线下环境
 
 const baseFlag = baseUrlTemp.includes('https://')