소스 검색

修改判断

lex 1 년 전
부모
커밋
1f5692a072
2개의 변경된 파일7개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 2
      package.json
  2. 5 2
      src/main.ts

+ 2 - 2
package.json

@@ -5,8 +5,8 @@
   "type": "module",
   "scripts": {
     "dev": "vite",
-    "build": "vue-tsc && vite build",
-    "build:dev": "vite build",
+    "build:prod": "vue-tsc --noEmit && vite build",
+    "build:dev": "vue-tsc --noEmit && vite build --mode development",
     "preview": "vite preview"
   },
   "dependencies": {

+ 5 - 2
src/main.ts

@@ -38,8 +38,11 @@ import { TUIComponents, TUICore, genTestUserSig } from "./TUIKit";
 // import TUICallKit
 // import { TUICallKit } from "@tencentcloud/call-uikit-vue";
 
-const SDKAppID = parseSearch.appId || hashSearch.appId || 1400799837; // 1400805079; // Your SDKAppID
-const secretKey = parseSearch.secretKey || hashSearch.secretKey || "37bfb220843e25e78768cadd0dc06756e460e55bd631354930a4149565a1d0c9"; //"c5f4ea6140128a36c842990446a2c89249ab886b5e1ea6893555aa635a0b3c30"; // Your secretKey
+console.log(import.meta.env.DEV, "import.meta.env.DEV");
+
+// 判断是否是测试环境的
+const SDKAppID = parseSearch.appId || hashSearch.appId || import.meta.env.DEV ? 1400805079 : 1400799837; // 1400805079; // Your SDKAppID
+const secretKey = parseSearch.secretKey || hashSearch.secretKey || import.meta.env.DEV ? "c5f4ea6140128a36c842990446a2c89249ab886b5e1ea6893555aa635a0b3c30" : "37bfb220843e25e78768cadd0dc06756e460e55bd631354930a4149565a1d0c9"; //"c5f4ea6140128a36c842990446a2c89249ab886b5e1ea6893555aa635a0b3c30"; // Your secretKey
 const userID = parseSearch.userID; //|| "KT:140:TEACHER"; // User ID
 
 // init TUIKit