tangning 2 дней назад
Родитель
Сommit
9f654f692a

+ 6 - 2
src/store/user.ts

@@ -135,8 +135,12 @@ export const sendPhoneCode = async (phone: string) => {
   return countdownStore.get(phone);
 };
 
-export const transformSWToken = async (scene: QuoteScene, isObj?: any) => {
-  const res = await axios.get(getSWToken, { params: { num: scene.num,  isObj } });
+export const transformSWToken = async (scene: QuoteScene, isObj?: any, caseId?: number) => {
+  console.log('transformSWToken', scene, isObj, caseId);
+  const res = await axios.get(getSWToken, { params: { num: scene.num,  isObj }, headers:{
+      caseId2: caseId
+    } }
+  );
   return res.data.token;
 };
 

+ 3 - 2
src/view/case/download.vue

@@ -30,7 +30,7 @@ import { ElLoading, ElMessage } from "element-plus";
 import { QuoteScene, SceneType } from "@/store/scene";
 import { QuiskExpose } from "@/helper/mount";
 
-const props = defineProps<{ caseId: number; title: string }>();
+const props = defineProps<{ caseId: number; title: string, res:any }>();
 enum State {
   uncreate,
   package,
@@ -67,7 +67,7 @@ const params = {
 };
 // 初始化
 const initial = async () => {
-  const res = await axios.get(checkHasDownload, { params });
+  const res = props.res || await axios.get(checkHasDownload, { params });
   state.value = getState(res.data.downloadStatus);
   count.value = res.data.count;
   downloadURL.value = res.data.downloadUrl;
@@ -142,6 +142,7 @@ onUnmounted(() => clearTimeout(timer));
 
 defineExpose<QuiskExpose>({
   submit: async () => {
+    alert("downloadCaseScene");
     await initial();
     const loading = ElLoading.service({
       lock: true,

+ 1 - 1
src/view/case/quisk.ts

@@ -89,5 +89,5 @@ export const downloadCase = async (props: caseDownloadProps) => {
     hideFloor: hideFloor,
     enterText: "下 载",
   });
-  return await sceneDownloadDialog(props);
+  return await sceneDownloadDialog({...props, res:res });
 };

+ 1 - 1
src/view/newFireCase/dyManager/quisk.ts

@@ -24,5 +24,5 @@ export const sceneDownload = async(props: SceneDpwnloadProps) => {
     hideFloor: hideFloor,
     enterText: '下 载'
   });
-  return await sceneDownloadDialog(props);
+  return await sceneDownloadDialog({...props, res: res});
 }

+ 2 - 2
src/view/newFireCase/dyManager/sceneDownload.vue

@@ -27,7 +27,7 @@ import { ElLoading, ElMessage } from "element-plus";
 import { QuoteScene, SceneType } from "@/store/scene";
 import { QuiskExpose } from "@/helper/mount";
 
-const props = defineProps<{ scene: QuoteScene, onQuit: any }>();
+const props = defineProps<{ scene: QuoteScene, onQuit: any, res: any }>();
 console.log(props);
 
 enum State {
@@ -65,7 +65,7 @@ const params = {
 };
 // 初始化
 const initial = async () => {
-  const res = await axios.get(checkHasDownload, { params });
+  const res =  props.res || await axios.get(checkHasDownload, { params });
   state.value = getState(res.data.downloadStatus);
   count.value = res.data.count;
   downloadURL.value = res.data.downloadUrl;

+ 1 - 1
src/view/newFireCase/meshManager/quisk.ts

@@ -24,5 +24,5 @@ export const sceneDownload = async(props: SceneDpwnloadProps) => {
     hideFloor: hideFloor,
     enterText: '下 载'
   });
-  return await sceneDownloadDialog(props);
+  return await sceneDownloadDialog({...props, res: res});
 }

+ 2 - 2
src/view/newFireCase/meshManager/sceneDownload.vue

@@ -28,7 +28,7 @@ import { ElLoading, ElMessage } from "element-plus";
 import { QuoteScene, SceneType } from "@/store/scene";
 import { QuiskExpose } from "@/helper/mount";
 
-const props = defineProps<{ scene: QuoteScene }>();
+const props = defineProps<{ scene: QuoteScene, res: any }>();
 enum State {
   uncreate,
   package,
@@ -64,7 +64,7 @@ const params = {
 };
 // 初始化
 const initial = async () => {
-  const res = await axios.get(checkHasDownload, { params });
+  const res = props.res || await axios.get(checkHasDownload, { params });
   state.value = getState(res.data.downloadStatus);
   count.value = res.data.count;
   downloadURL.value = res.data.downloadUrl;

+ 1 - 1
src/view/newFireCase/newFireDetails/components/scene.vue

@@ -295,7 +295,7 @@ const onDelete = async (scene: Scene) => {
 };
 const onOpen = async (scene: Scene) => {
   let type = [0, 1, 3, 4, 6].includes(Number(scene.sceneType)) ? 1 : 0;
-  const token = await transformSWToken(scene, type);
+  const token = await transformSWToken(scene, type, caseId.value);
   if(!token) return;
   let newUrl = SceneTypePaths[scene.sceneType][1];
   let returnurl = window.location.origin + window.location.pathname + '/#/login';

+ 3 - 5
src/view/newFireCase/newFireDetails/components/shot.vue

@@ -90,11 +90,9 @@ const config: any = {
 };
 const MetaType = 'video';
 
-const videoRecorder = new VideoRecorder(config,{
-        mimeType:getSupportedMimeType(),
-        audioBitsPerSecond: 128000,
-        videoBitsPerSecond: 2500000
-      });
+const videoRecorder = new VideoRecorder(config);
+videoRecorder.codecType = 'video/webm;codecs=vp8,opus';
+videoRecorder._codecType = 'video/webm;codecs=vp8,opus';
 let showBottomBar = ref(false);
 const MAX_SIZE = 2 * 1024 * 1024 * 1024;
 const MAX_TIME = 30 * 60 * 1000;

+ 1 - 1
src/view/vrmodel/quisk.ts

@@ -24,5 +24,5 @@ export const sceneDownload = async(props: SceneDpwnloadProps) => {
     hideFloor: hideFloor,
     enterText: '下 载'
   });
-  return await sceneDownloadDialog(props);
+  return await sceneDownloadDialog({...props, res: res});
 }

+ 2 - 2
src/view/vrmodel/sceneDownload.vue

@@ -28,7 +28,7 @@ import { ElLoading, ElMessage } from "element-plus";
 import { QuoteScene, SceneType } from "@/store/scene";
 import { QuiskExpose } from "@/helper/mount";
 
-const props = defineProps<{ scene: QuoteScene }>();
+const props = defineProps<{ scene: QuoteScene, res: any }>();
 enum State {
   uncreate,
   package,
@@ -64,7 +64,7 @@ const params = {
 };
 // 初始化
 const initial = async () => {
-  const res = await axios.get(checkHasDownload, { params });
+  const res = props.res || await axios.get(checkHasDownload, { params });
   state.value = getState(res.data.downloadStatus);
   count.value = res.data.count;
   downloadURL.value = res.data.downloadUrl;