wangfumin 2 месяцев назад
Родитель
Сommit
16b0f44505

+ 2 - 2
src/request/index.ts

@@ -99,7 +99,7 @@ axios.interceptors.request.use(async (config) => {
     const offline = isOfflineMode();
     if (!offline) {
       if (!token && !~notLoginUrls.indexOf(config.url) && !shareBypassLogin) {
-        const redirect = window.location.href;
+        const redirect = encodeURIComponent(window.location.href);
         router.replace({ name: RouteName.login, query: { redirect } });
         throw "用户未登录";
       }
@@ -158,7 +158,7 @@ const responseInterceptor = (res: AxiosResponse<any, any>) => {
         errMsg === "token已经失效,请重新登录"
       ) {
         getAuth().clear();
-        const redirect = window.location.href;
+        const redirect = encodeURIComponent(window.location.href);
         router.replace({ name: RouteName.login, query: { redirect } });
       }
     }

+ 5 - 5
src/view/case/download.vue

@@ -14,9 +14,6 @@
         <el-slider v-model="percent" :show-tooltip="false" />
       </div>
     </div>
-    <div v-else-if="state === State.readDown">
-      <span>正在下载中……</span>
-    </div>
   </div>
 </template>
 
@@ -63,9 +60,10 @@ const stateTitle = {
   [State.readDown]: filename.value,
 };
 
+const appId = import.meta.env.VITE_APP_APP;
 const params = {
   caseId: props.caseId,
-  fromRoute: 'fire'
+  fromRoute: appId === 'criminal' ? 'criminal' : 'fire',
 };
 // 初始化
 const initial = async () => {
@@ -133,7 +131,7 @@ const requestUpdateURL = async (callback: () => void) => {
 
   downloadURL.value = percent.value === 100 ? res.data.url : null;
   if (downloadURL.value) {
-    state.value = State.readDown;
+    // 进度完成后,不切换到“正在下载中”状态,直接通过回调通知完成
     callback();
   } else {
     timer = setTimeout(() => requestUpdateURL(callback), 1000);
@@ -153,6 +151,8 @@ defineExpose<QuiskExpose>({
     await download();
     loading.close();
     ElMessage.success("下载完成");
+    // 返回真值以通知外层工厂关闭弹窗
+    return true as any;
   },
 });
 </script>

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

@@ -37,7 +37,7 @@
               <el-tooltip content="移除" v-if="editOrShow === 'edit'">
                 <span class="act" @click.stop="onDelete(item)"><i class="iconfont icon-CloseCircle" /></span>
               </el-tooltip>
-              <el-tooltip content="带看" v-if="editOrShow === 'show'">
+              <el-tooltip content="带看" v-if="editOrShow === 'show' && !isOfflineMode()">
                 <span class="act" @click.stop="openDaiKan(item)"><i class="iconfont icon-look_t" /></span>
               </el-tooltip>
               <el-tooltip content="全屏">

+ 13 - 1
src/view/newFireCase/newFireDetails/components/screenShot.vue

@@ -23,7 +23,7 @@
         >
           <div class="file-left" @click="handleView(file)">
             <div class="file-avatar">
-              <img v-if="file.videoFolderCover" :src="file.videoFolderCover" alt="">
+              <img v-if="file.videoFolderCover" :src="getCoverSrc(file.videoFolderCover)" alt="">
               <div class="zhezhao">
                 <i class="iconfont icon-play play-icon" />
               </div>
@@ -150,6 +150,18 @@ const fetchRecordList = async () => {
   }
 }
 
+const getCoverSrc = (raw: string) => {
+  if (!raw) return '';
+  if (isOfflineMode()) {
+    const httpHost = /^https?:\/\/[^/]+/i;
+    if (httpHost.test(raw)) return '.' + raw.replace(httpHost, '');
+    if (raw.startsWith('/')) return '.' + raw;
+    if (raw.startsWith('./')) return raw;
+    return './' + raw;
+  }
+  return typeof raw === 'string' ? getResource(raw) : raw as any;
+};
+
 watch(() => props.caseId, () => {
   fetchRecordList();
 }, { immediate: true });

+ 3 - 2
src/view/newFireCase/newFireDetails/index.vue

@@ -56,11 +56,12 @@ import {
 import { isOfflineMode } from '@/util/offline'
 
 // 从路由获取参数
-const appId = import.meta.env.VITE_APP_APP === 'criminal' ? 'criminal' : !import.meta.env.VITE_APP_APP ? '' : 'fire'
+const appId = import.meta.env.VITE_APP_APP === 'criminal' ? 'criminal' : !import.meta.env.VITE_APP_APP ? '' : 'fire';
+console.log(appId, 'appId')
 const route = useRoute();
 const vueRouter = useRouter();
 const caseId = computed(() => Number(route.params.caseId));
-const fromRoute = computed(() => appId || route.query.fromRoute as string);
+const fromRoute = computed(() => route.query.fromRoute as string || appId);
 const editOrShow = computed(() => route.query.editOrShow as string || 'show');
 const showSave = computed(() => {
   const sub = route.query.editSub as string | undefined;

+ 27 - 10
src/view/system/login.vue

@@ -180,16 +180,33 @@ const submitClick = async () => {
           } else {
             targetPath = hashStr;
           }
-        } else {
-          const usp = new URLSearchParams(url.search);
-          usp.delete('token');
-          const qs = usp.toString();
-          const pathName = url.pathname;
-          targetPath = qs ? `${pathName}?${qs}` : pathName;
-        }
-        if (!targetPath.startsWith('/')) targetPath = '/' + targetPath;
-        console.log('Internal redirect to', targetPath);
-        router.replace(targetPath);
+      } else {
+          // Fallback: when redirect contains '%23' in pathname (encoded '#'), treat as hash route
+          if (url.pathname.includes('%23')) {
+            const idx = url.pathname.indexOf('%23');
+            const after = url.pathname.slice(idx + 3); // content after '%23'
+            const qIndex = after.indexOf('?');
+            if (qIndex > -1) {
+              const basePath = after.slice(0, qIndex);
+              const queryStr = after.slice(qIndex + 1);
+              const usp = new URLSearchParams(queryStr);
+              usp.delete('token');
+              const qs = usp.toString();
+              targetPath = qs ? `${basePath}?${qs}` : basePath;
+            } else {
+              targetPath = after;
+            }
+          } else {
+            const usp = new URLSearchParams(url.search);
+            usp.delete('token');
+            const qs = usp.toString();
+            const pathName = url.pathname;
+            targetPath = qs ? `${pathName}?${qs}` : pathName;
+          }
+      }
+      if (!targetPath.startsWith('/')) targetPath = '/' + targetPath;
+      console.log('Internal redirect to', targetPath);
+      router.replace(targetPath);
       } else {
         url.searchParams.delete("token");
         console.log('External redirect to', url.toString());