jiangbiao 1 mês atrás
pai
commit
84bb6bc4b1

+ 6 - 2
rc-admin/src/main/java/com/ruoyi/web/controller/rc/TCommonfileController.java

@@ -35,7 +35,7 @@ public class TCommonfileController extends BaseController
     /**
      * 通用附件上传
      */
-    @Log(title = "通用附件上传", businessType = BusinessType.UPDATE)
+//    @Log(title = "通用附件上传", businessType = BusinessType.UPDATE)
     @PostMapping("/uploadFile")
     public AjaxResult uploadFile(@RequestParam("file") MultipartFile file, String pType, String pId) throws IOException
     {
@@ -64,7 +64,11 @@ public class TCommonfileController extends BaseController
             TCommonfile tCommonfile = new TCommonfile();
             tCommonfile.setFileUrl(url);
             tCommonfile.setFileName(file.getOriginalFilename());
-            tCommonfile.setCreaterCode(String.valueOf(getUserId()));
+            try {
+                tCommonfile.setCreaterCode(String.valueOf(getUserId()));
+            } catch (Exception e) {
+                logger.info("无用户");
+            }
             tCommonfile.setpId(Long.parseLong(pId));
             tCommonfile.setpType(pType);
             tCommonfile.setFileSize(String.valueOf(size));

+ 1 - 0
rc-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java

@@ -116,6 +116,7 @@ public class SecurityConfig
                     .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
                     .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
                         .antMatchers("/ehs/approvedanger/processImg/**", "/common/template", "/rc/standardchapter/**", "/rc/standardquestionnaire/**", "/rc/commonfile/**").permitAll()
+                        .antMatchers("/system/dict/data/type/**","/rc/commonfile/uploadFile").permitAll()
                     // 除上面外的所有请求全部需要鉴权认证
                     .anyRequest().authenticated();
             })