浏览代码

pageoffice配置

wucl 9 月之前
父节点
当前提交
fcd87c256e

+ 3 - 5
biz-base/src/main/java/com/dayou/controller/PageOfficeController.java

@@ -1,7 +1,6 @@
 package com.dayou.controller;
 
 
-import com.dayou.utils.PageOfficeUtils;
 import com.zhuozhengsoft.pageoffice.FileSaver;
 import com.zhuozhengsoft.pageoffice.OpenModeType;
 import com.zhuozhengsoft.pageoffice.PageOfficeCtrl;
@@ -16,15 +15,14 @@ import javax.servlet.http.HttpServletResponse;
 public class PageOfficeController {
 
         //获取doc目录的磁盘路径
-    private String dir = PageOfficeUtils.getDirPath() + "static/";
-
+    private static String OPT = "/opt";
     @RequestMapping(value="/openFile")
     public String openFile(HttpServletRequest request, int file_id, String file_name)  {
         //file_id和file_name是为了展示如何使用参数,我们这里只用到了file_name
         PageOfficeCtrl poCtrl = new PageOfficeCtrl(request);
         //webOpen的第一个参数支持能够输出下载文件的Url相对地址或者文件在服务器上的磁盘路径两种方式
         //查看详细,请在"https://www.pageoffice.cn/"搜索“PageOffice属性或方法中涉及到的URL路径或磁盘路径的说明”
-        poCtrl.webOpen("file://"+dir+file_name, OpenModeType.docNormalEdit, "张三");
+        poCtrl.webOpen("file://"+OPT+file_name, OpenModeType.docNormalEdit, "张三");
         return poCtrl.getHtmlCode();//必须
     }
 
@@ -32,7 +30,7 @@ public class PageOfficeController {
     public void saveFile(HttpServletRequest request, HttpServletResponse response, int file_id, String file_name)  {
         //file_id和file_name是为了展示如何使用参数,我们这里只用到了file_name
         FileSaver fs = new FileSaver(request, response);
-        fs.saveToFile(dir + file_name);
+        fs.saveToFile(OPT + file_name);
         fs.close();
     }
 }

+ 2 - 1
common/src/main/java/com/dayou/configuration/WebConfig.java

@@ -76,7 +76,8 @@ public class WebConfig implements WebMvcConfigurer {
         registry.addInterceptor(permissionInterceptor)
                 .addPathPatterns("/**")
                 .excludePathPatterns("/dfs/**")
-                .excludePathPatterns("/doc/**", "/sdk/**","/callback/**");
+                .excludePathPatterns("/doc/**", "/sdk/**","/callback/**",
+                        "/poserver.zz","/poclient","/sealsetup.exe");
 
     }
 

+ 0 - 26
common/src/main/java/com/dayou/utils/PageOfficeUtils.java

@@ -1,26 +0,0 @@
-package com.dayou.utils;
-
-import org.springframework.core.io.FileSystemResource;
-import org.springframework.core.io.Resource;
-
-import java.io.IOException;
-import java.net.URL;
-
-public class PageOfficeUtils {
-
-    /**
-     * @Author: dong
-     * @Date: 2020/11/2 10:39
-     * @Version 1.0
-     */
-    public static String getDirPath(){
-        try {
-            Resource resource = new FileSystemResource("target/classes");
-            URL resourceUrl = resource.getURL();
-            return resourceUrl.getPath();
-        } catch (IOException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-}