lex-xin 4 mēneši atpakaļ
vecāks
revīzija
c09b036ed2
1 mainītis faili ar 18 papildinājumiem un 17 dzēšanām
  1. 18 17
      src/state.ts

+ 18 - 17
src/state.ts

@@ -63,19 +63,20 @@ export const openDefaultWebView = (url?: string, callBack?: any) => {
  */
 export const goWechatAuth = (wxAppId: string, urlString?: string) => {
   // 开发环境
-  if (import.meta.env.DEV) {
-    const replaceUrl =
-      `https://online.lexiaoya.cn/getWxCode?appid=${
-        wxAppId || 'wx8654c671631cfade'
-      }&state=STATE&redirect_uri=` +
-      encodeURIComponent(urlString || window.location.href);
-    window.location.replace(replaceUrl);
-  }
+  // if (import.meta.env.DEV) {
+  //   const replaceUrl =
+  //     `https://online.lexiaoya.cn/getWxCode?appid=${
+  //       wxAppId || 'wx8654c671631cfade'
+  //     }&state=STATE&redirect_uri=` +
+  //     encodeURIComponent(urlString || window.location.href);
+  //   window.location.replace(replaceUrl);
+  // }
 
-  // 生产环境
-  if (import.meta.env.PROD) {
-    goAuth(wxAppId, urlString);
-  }
+  // // 生产环境
+  // if (import.meta.env.PROD) {
+  //   goAuth(wxAppId, urlString);
+  // }
+  goAuth(wxAppId, urlString);
 };
 
 const goAuth = (wxAppId: string, urlString?: string) => {
@@ -99,15 +100,15 @@ export const goAliAuth = (alipayAppId: string, urlString?: string) => {
   const urlNow = encodeURIComponent(urlString || window.location.href);
   const appid = alipayAppId || '2021004100630808';
   // 开发环境
-  if (import.meta.env.DEV) {
+  // if (import.meta.env.DEV) {
     let url = `https://kt.colexiu.com/getAliCode?app_id=${appid}&state=STATE&redirect_uri=${urlNow}`;
     window.location.replace(url);
-  }
+  // }
 
   // 生产环境
-  if (import.meta.env.PROD) {
-    alipayAuth(alipayAppId, urlString);
-  }
+  // if (import.meta.env.PROD) {
+  //   alipayAuth(alipayAppId, urlString);
+  // }
 };
 
 const alipayAuth = (alipayAppId: string, urlString?: string) => {