bzkf3 2 år sedan
förälder
incheckning
0cf17021e3
8 ändrade filer med 47 tillägg och 11 borttagningar
  1. 12 0
      ci/config.js
  2. 2 1
      package.json
  3. 16 4
      pnpm-lock.yaml
  4. 2 2
      public/config.js
  5. 7 0
      src/components/rtc-dialog/index.vue
  6. 3 2
      src/store/user.store.ts
  7. 1 1
      src/utils/request.ts
  8. 4 1
      vite.config.ts

+ 12 - 0
ci/config.js

@@ -0,0 +1,12 @@
+const production = {
+  web_pc: 'https://dyaw.bozedu.net/',
+  web_mobile: 'https://dyawm.bozedu.net/',
+
+  api: 'https://openapi.bozedu.net/',
+  oss: 'https://openapi.bozedu.net/',
+  uc: 'https://uc.bozedu.net/',
+}
+
+window.GLOBAL_CONFIG = production
+
+window.RTC_USE = true

+ 2 - 1
package.json

@@ -21,7 +21,7 @@
     "@element-plus/icons-vue": "^2.0.10",
     "@vueuse/components": "^9.10.0",
     "@vueuse/core": "^9.10.0",
-    "agora-rtc-sdk-ng": "^4.16.0",
+    "agora-rtc-sdk-ng": "^4.17.2",
     "axios": "^1.2.2",
     "element-plus": "^2.2.28",
     "tinymce": "^6.3.1",
@@ -34,6 +34,7 @@
     "@antfu/eslint-config": "^0.27.0",
     "@iconify/json": "^2.2.5",
     "@types/node": "^18.11.18",
+    "@vitejs/plugin-basic-ssl": "^1.0.1",
     "@vitejs/plugin-vue": "^4.0.0",
     "@windicss/plugin-scrollbar": "^1.2.3",
     "eslint": "^8.31.0",

+ 16 - 4
pnpm-lock.yaml

@@ -11,8 +11,8 @@ dependencies:
     specifier: ^9.10.0
     version: 9.10.0(vue@3.2.45)
   agora-rtc-sdk-ng:
-    specifier: ^4.16.0
-    version: 4.16.0
+    specifier: ^4.17.2
+    version: 4.17.2
   axios:
     specifier: ^1.2.2
     version: 1.2.2
@@ -45,6 +45,9 @@ devDependencies:
   '@types/node':
     specifier: ^18.11.18
     version: 18.11.18
+  '@vitejs/plugin-basic-ssl':
+    specifier: ^1.0.1
+    version: 1.0.1(vite@4.0.4)
   '@vitejs/plugin-vue':
     specifier: ^4.0.0
     version: 4.0.0(vite@4.0.4)(vue@3.2.45)
@@ -757,6 +760,15 @@ packages:
       vue: 3.2.45
     dev: false
 
+  /@vitejs/plugin-basic-ssl@1.0.1(vite@4.0.4):
+    resolution: {integrity: sha512-pcub+YbFtFhaGRTo1832FQHQSHvMrlb43974e2eS8EKleR3p1cDdkJFPci1UhwkEf1J9Bz+wKBSzqpKp7nNj2A==}
+    engines: {node: '>=14.6.0'}
+    peerDependencies:
+      vite: ^3.0.0 || ^4.0.0
+    dependencies:
+      vite: 4.0.4(@types/node@18.11.18)(sass@1.57.1)
+    dev: true
+
   /@vitejs/plugin-vue@4.0.0(vite@4.0.4)(vue@3.2.45):
     resolution: {integrity: sha512-e0X4jErIxAB5oLtDqbHvHpJe/uWNkdpYV83AOG2xo2tEVSzCzewgJMtREZM30wXnM5ls90hxiOtAuVU6H5JgbA==}
     engines: {node: ^14.18.0 || >=16.0.0}
@@ -959,8 +971,8 @@ packages:
     hasBin: true
     dev: true
 
-  /agora-rtc-sdk-ng@4.16.0:
-    resolution: {integrity: sha512-Wyoyzb0+ewRfMtyDxnJqHVQqBQYO4IkZsmlfzomXt69FA1rAr5yhQBxy1LxO/mwE9mm1XIC/9Yz5dEjL2d4ehg==}
+  /agora-rtc-sdk-ng@4.17.2:
+    resolution: {integrity: sha512-ErIHOYgf3R/ya3gVCCBKRw3RMdATmoM/8aUGOob4g0VHBBkVDEf9JT0RW2jQgtwm61jszWof+wo2duQDBgTfpw==}
     dependencies:
       agora-rte-extension: 1.2.3
     dev: false

+ 2 - 2
public/config.js

@@ -34,6 +34,6 @@ function isWhich() {
     return local
   }
 }
-window.GLOBAL_CONFIG = isWhich()
+window.GLOBAL_CONFIG = production//isWhich()
 
-window.RTC_USE = false
+window.RTC_USE = true

+ 7 - 0
src/components/rtc-dialog/index.vue

@@ -177,6 +177,11 @@ function handleInfoEdit(data: Partial<type_dyaw_xlfw_zxhd_log>, tip?: string) {
     dxzl_id: dxzl_id,
     dyaw_xlfw_zxhd_log: _reqDate
   })
+  if (dxzl_id === undefined) {
+    return Promise.reject(
+      new Error('尚未与对方建立通话')
+    )
+  }
   return request({
     url: '/dyaw/xlfw_zxhd_log/edit',
     data: {
@@ -386,6 +391,7 @@ async function handleAudioChatStart() {
 }
 async function handleAudioChatCancel() {
   console.info('handleAudioChatCancel start')
+
   try {
     const fullSendData = await handleInfoEdit({ dxzl_status: '2' }, '已取消')
     socketSend(ws2, {
@@ -401,6 +407,7 @@ async function handleAudioChatCancel() {
     console.info('[success]handleAudioChatCancel end')
   } catch (error) {
     console.error('[error]handleAudioChatCancel end', error)
+    isOpen = false
   }
 
 }

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 3 - 2
src/store/user.store.ts


+ 1 - 1
src/utils/request.ts

@@ -49,7 +49,7 @@ instance.interceptors.request.use(
 instance.interceptors.response.use(
   (response) => {
     response.data.code = response.data?.code?.toString()
-    response.data.msg = response.data.msg.replaceAll(/<.*?>/g, ' ')
+    response.data.msg = response.data.msg.replace(/<.*?>/g, ' ')
     const { code, msg } = response.data
     if (code !== '1')
       // ElMessage.error(msg)

+ 4 - 1
vite.config.ts

@@ -8,6 +8,7 @@ import { ElementPlusResolver, VantResolver } from 'unplugin-vue-components/resol
 import Icons from 'unplugin-icons/vite'
 import IconsResolver from 'unplugin-icons/resolver'
 import ConditionalCompile from './plugins/vite-plugin-conditional-compile'
+import basicSsl from '@vitejs/plugin-basic-ssl'
 
 // https://vitejs.dev/config/
 export default defineConfig({
@@ -38,6 +39,7 @@ export default defineConfig({
     },
   },
   plugins: [
+    basicSsl(),
     ConditionalCompile(),
     vue({
       reactivityTransform: true,
@@ -76,7 +78,8 @@ export default defineConfig({
   ],
   server: {
     host: true,
-    port: 5230
+    port: 5230,
+    https: true,
   },
   build: {
     // rollupOptions: {