wenhongquan 11 months ago
parent
commit
e89063ef6f
2 changed files with 14 additions and 4 deletions
  1. 12 2
      src/components/pdfview/index.vue
  2. 2 2
      vite.config.ts

+ 12 - 2
src/components/pdfview/index.vue

@@ -59,6 +59,7 @@ const ispic = ref(false);
 const ismobile = ref(false);
 
 
+
 const currentPdf = ref(props.src)
 watchEffect(() => {
   ispic.value = props.ispic;
@@ -86,14 +87,23 @@ watchEffect(() => {
   // currentPdf.value = props.src.replaceAll("https://njdnyjsfilesystem.s3.cn-east-1.qiniucs.com","http://sdrqczwd3.hd-bkt.clouddn.com");
 })
 
+const inst = ref(null);
 
 onMounted(()=>{
   proxy?.getConfigKey("sys.file.preview.watermark").then(res => {
     if(res.data){
-      watertext.value = res.data.replaceAll("{username}",userStore.nickname).replaceAll("{time}",moment().format("yyyy-MM-DD HH:mm:ss"))
-    }
+      inst.value =  setInterval(()=>{
+        watertext.value = res.data.replaceAll("{username}",userStore.nickname).replaceAll("{time}",moment().format("yyyy-MM-DD HH:mm:ss"))
+
+      },1000);
+     }
   })
 })
+onUnmounted(()=>{
+  if(inst.value!=null){
+    clearInterval(inst.value)
+  }
+})
 
 
 // const { pdf, pages } = usePDF(currentPdf)

+ 2 - 2
vite.config.ts

@@ -26,8 +26,8 @@ export default defineConfig(({ mode, command }: ConfigEnv): UserConfig => {
       open: true,
       proxy: {
         [env.VITE_APP_BASE_API]: {
-          target: 'http://localhost:8080',
-          // target: 'https://filesystem.njdnyjs.com/api',
+          // target: 'http://localhost:8080',
+          target: 'https://filesystem.njdnyjs.com/api',
           changeOrigin: true,
           ws: true,
           rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')