diff --git a/docs/extension/index.md b/docs/extension/index.md index d452a758538662bd1f06be7d44b37142ab804de1..01da6c2e42a980b5cf72cf3512b2fcfddb66d92b 100644 --- a/docs/extension/index.md +++ b/docs/extension/index.md @@ -1,4 +1,5 @@ # 简介 +拓展功能可以在不修改主程序的情况下,改变系统原有的功能或增加新的功能。目前只支持对纯后端API系统进行有限的功能增强和拓展。通过给后端安装拓展插件来增强与拓展前端系统的功能目前正在开发中。 ## 简要说明 程序会读取 `程序运行路径/ext/` 下的jar文件作为拓展插件来加载。 diff --git a/docs/quick-start/front-end.md b/docs/quick-start/front-end.md index a037d6bd575dab5a56624059429942756cdba652..546e0d56a33af02d570df37dcbd4513ebefa0010 100644 --- a/docs/quick-start/front-end.md +++ b/docs/quick-start/front-end.md @@ -1,5 +1,7 @@ # 关于前端 +> 目前的前端项目1.x版本停止维护,开发重心将转移到vuetify-refactor分支,重新从0开始采用vite+vue3+vuetify开发可维护性和可拓展性更高,更灵活的前端系统 + 由于本人主要精力放在了后端,前端缺少精心打磨,且前端技术不太专业,所以目前前端的文档较少和可能落后于实际项目情况 待后端基本完善和稳定后,我会再对前端项目进行重构。 diff --git a/pom.xml b/pom.xml index 765804f265d17a125893d2a2c0c1839ce9cd7a95..c4b612c5f2e1990c05f0ac91fc8eeccc19f117ce 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ API或脚手架模块版本号仅使用数字加点(如:sfc-ext,sfc-api) 功能组件或咸鱼云根模块需要使用RELEASE或SNAPSHOT后缀(如:sfc-core,sfc-ext-hadoop-store) --> - 1.8.6.0-RELEASE + 1.8.6.2-RELEASE saltedfishcloud 咸鱼云网盘 diff --git a/sfc-api/pom.xml b/sfc-api/pom.xml index ec6bf36f0207a1d26dc85f269d745a54410c9273..9e6f84d08a6151e8da441747c8c2b4345ff5bfa1 100644 --- a/sfc-api/pom.xml +++ b/sfc-api/pom.xml @@ -5,7 +5,7 @@ saltedfishcloud com.xiaotao - 1.8.6.0-RELEASE + 1.8.6.2-RELEASE 4.0.0 1.2.2 diff --git a/sfc-api/src/main/java/com/xiaotao/saltedfishcloud/utils/ResourceUtils.java b/sfc-api/src/main/java/com/xiaotao/saltedfishcloud/utils/ResourceUtils.java index 28c368c9f13ca0dbfafdca4b1500bb9a28078899..28a3081a1fdef32250ddee39c103b089f9fa06b1 100644 --- a/sfc-api/src/main/java/com/xiaotao/saltedfishcloud/utils/ResourceUtils.java +++ b/sfc-api/src/main/java/com/xiaotao/saltedfishcloud/utils/ResourceUtils.java @@ -66,6 +66,6 @@ public class ResourceUtils { public static String generateContentDisposition(String filename) throws UnsupportedEncodingException { - return "inline;filename*=UTF-8''"+ URLEncoder.encode(filename, "utf-8"); + return "inline;filename*=UTF-8''"+ URLEncoder.encode(filename, "utf-8").replaceAll("\\+", "%20"); } } diff --git a/sfc-compress/pom.xml b/sfc-compress/pom.xml index da4b13672e23e0022183855775dd30d37ab7da59..577a25cb219bc783b2ad1ab39f26c7c06c2dfe55 100644 --- a/sfc-compress/pom.xml +++ b/sfc-compress/pom.xml @@ -7,7 +7,7 @@ com.xiaotao saltedfishcloud - 1.8.6.0-RELEASE + 1.8.6.2-RELEASE sfc-compress diff --git a/sfc-core/pom.xml b/sfc-core/pom.xml index 4dacc2048a0c45f5d218ae9e38c2a72d2ff7fd79..3905f4044af04b7a91de4b56bed763f96304299f 100644 --- a/sfc-core/pom.xml +++ b/sfc-core/pom.xml @@ -5,7 +5,7 @@ saltedfishcloud com.xiaotao - 1.8.6.0-RELEASE + 1.8.6.2-RELEASE 4.0.0 @@ -70,7 +70,7 @@ com.xiaotao sfc-compress - 1.8.6.0-RELEASE + 1.8.6.2-RELEASE compile diff --git a/sfc-core/src/main/java/com/xiaotao/saltedfishcloud/config/SysRuntimeConfig.java b/sfc-core/src/main/java/com/xiaotao/saltedfishcloud/config/SysRuntimeConfig.java index 6016bb3d50a5848996bd0c247d0577c4aea04d90..23d65e8ec126520a0bf5276692b8df2afab6fd2b 100644 --- a/sfc-core/src/main/java/com/xiaotao/saltedfishcloud/config/SysRuntimeConfig.java +++ b/sfc-core/src/main/java/com/xiaotao/saltedfishcloud/config/SysRuntimeConfig.java @@ -4,6 +4,7 @@ import com.xiaotao.saltedfishcloud.constant.MQTopic; import com.xiaotao.saltedfishcloud.enums.ProtectLevel; import com.xiaotao.saltedfishcloud.service.config.ConfigName; import com.xiaotao.saltedfishcloud.service.config.ConfigService; +import com.xiaotao.saltedfishcloud.service.hello.HelloService; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -28,6 +29,9 @@ public class SysRuntimeConfig implements ApplicationRunner { private static ProtectLevel PROTECT_MODE_LEVEL = null; private static SysRuntimeConfig GLOBAL_HOLD_INST; + @Autowired + private HelloService helloService; + @Autowired private ConfigService configService; @@ -99,14 +103,16 @@ public class SysRuntimeConfig implements ApplicationRunner { log.warn("[注册关闭]系统未开启任何用户注册方式"); } + updateFeature(); // 监听配置改变,实时更新状态缓存 configService.addConfigSetListener(e -> { ConfigName key = e.getKey(); if (key == ConfigName.ENABLE_EMAIL_REG) { - enableEmailReg = "true".equals(e.getValue().toLowerCase()); + enableEmailReg = "true".equalsIgnoreCase(e.getValue()); } else if (key == ConfigName.ENABLE_REG_CODE) { - enableRegCode = "true".equals(e.getValue().toLowerCase()); + enableRegCode = "true".equalsIgnoreCase(e.getValue()); } + updateFeature(); }); @@ -118,6 +124,11 @@ public class SysRuntimeConfig implements ApplicationRunner { }, new PatternTopic(MQTopic.PROTECT_LEVEL_SWITCH)); } + public void updateFeature() { + helloService.setFeature("enableRegCode", isEnableRegCode()); + helloService.setFeature("enableEmailReg", isEnableEmailReg()); + } + /** * 从数据库中抓取数据更新配置 */ diff --git a/sfc-core/src/main/java/com/xiaotao/saltedfishcloud/controller/FileController.java b/sfc-core/src/main/java/com/xiaotao/saltedfishcloud/controller/FileController.java index 032093dbae295ddfd4f4239ed72648c618769c3b..383f5c1e510b682fe9a9ad1ba2df2b3da82f1be5 100644 --- a/sfc-core/src/main/java/com/xiaotao/saltedfishcloud/controller/FileController.java +++ b/sfc-core/src/main/java/com/xiaotao/saltedfishcloud/controller/FileController.java @@ -149,9 +149,9 @@ public class FileController { @RequestParam("md5") String md5) throws IOException { boolean b = fileService.getFileSystem().quickSave(uid, path, name, md5); if (b) { - return JsonResult.emptySuccess(); + return JsonResultImpl.getInstance(true); } else { - return JsonResultImpl.getInstance(100, null, FileSystemError.QUICK_SAVE_NOT_HIT.getMessage()); + return JsonResultImpl.getInstance(100, false, FileSystemError.QUICK_SAVE_NOT_HIT.getMessage()); } } @@ -199,6 +199,12 @@ public class FileController { } + @AllowAnonymous + @GetMapping("getFileList") + public JsonResult getFileList(@PathVariable String uid, @RequestParam("path") String path) { + return JsonResult.emptySuccess(); + } + /** * 搜索目标用户网盘中的文件或文件夹 * @param uid 目标UID,非管理员只能搜索公共用户和自己的资源 diff --git a/sfc-core/src/main/java/com/xiaotao/saltedfishcloud/controller/UserController.java b/sfc-core/src/main/java/com/xiaotao/saltedfishcloud/controller/UserController.java index 959ff9cc9ba627a55da4351bb77972225b7570b6..dcacbe127e5d7b06a53875743e803373aa85f881 100644 --- a/sfc-core/src/main/java/com/xiaotao/saltedfishcloud/controller/UserController.java +++ b/sfc-core/src/main/java/com/xiaotao/saltedfishcloud/controller/UserController.java @@ -39,6 +39,7 @@ import javax.validation.Valid; import javax.validation.constraints.Email; import javax.validation.constraints.Max; import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.util.HashMap; @@ -174,7 +175,7 @@ public class UserController { */ @PostMapping("/regcode") @AllowAnonymous - public JsonResult sendRegCode(@RequestParam("email") @Email String email) { + public JsonResult sendRegCode(@Validated @NotBlank @RequestParam("email") @Email String email) { userService.sendRegEmail(email); return JsonResult.emptySuccess(); } diff --git a/sfc-core/src/main/java/com/xiaotao/saltedfishcloud/service/thumbnail/handler/SimpleImageThumbnailHandler.java b/sfc-core/src/main/java/com/xiaotao/saltedfishcloud/service/thumbnail/handler/SimpleImageThumbnailHandler.java index 978b13f11f6ddddc31e1ed9ce2fb4957ef174f1c..a6d1f595820399fdd2023d20745591637f09d087 100644 --- a/sfc-core/src/main/java/com/xiaotao/saltedfishcloud/service/thumbnail/handler/SimpleImageThumbnailHandler.java +++ b/sfc-core/src/main/java/com/xiaotao/saltedfishcloud/service/thumbnail/handler/SimpleImageThumbnailHandler.java @@ -1,8 +1,6 @@ package com.xiaotao.saltedfishcloud.service.thumbnail.handler; import com.xiaotao.saltedfishcloud.service.file.thumbnail.ThumbnailHandler; -import com.xiaotao.saltedfishcloud.service.hello.FeatureProvider; -import com.xiaotao.saltedfishcloud.service.hello.HelloService; import com.xiaotao.saltedfishcloud.utils.ImageUtils; import org.springframework.core.io.Resource; import org.springframework.stereotype.Component; diff --git a/sfc-core/src/main/java/com/xiaotao/saltedfishcloud/service/user/UserServiceImp.java b/sfc-core/src/main/java/com/xiaotao/saltedfishcloud/service/user/UserServiceImp.java index 338edb7a185e75c880fc84e1f971261ea08609ab..372425e7d62b9349697c587c6bcb4ba451940c48 100644 --- a/sfc-core/src/main/java/com/xiaotao/saltedfishcloud/service/user/UserServiceImp.java +++ b/sfc-core/src/main/java/com/xiaotao/saltedfishcloud/service/user/UserServiceImp.java @@ -275,7 +275,7 @@ public class UserServiceImp implements UserService { if (!code.equals(sysProperties.getCommon().getRegCode())) { throw new JsonException(AccountError.REG_CODE_ERROR); } - return addUser(user, passwd, email, User.TYPE_COMMON); + return addUser(user, passwd, null, User.TYPE_COMMON); } } diff --git a/sfc-core/src/main/resources/application.yml b/sfc-core/src/main/resources/application.yml index 1d0cee655580aae01d09258eaa0dfcda23dd65a2..87a9e1ef4f207248ccd5b5118a1baa5dd3f60eb8 100644 --- a/sfc-core/src/main/resources/application.yml +++ b/sfc-core/src/main/resources/application.yml @@ -43,9 +43,9 @@ logging: level: org: warn com: warn - com.xiaotao: debug - com.xiaotao.saltedfishcloud.dao.mybatis: warn - com.xiaotao.saltedfishcloud.SaltedfishcloudApplication: warn + com.xiaotao: info +# com.xiaotao.saltedfishcloud.dao.mybatis: warn +# com.xiaotao.saltedfishcloud.SaltedfishcloudApplication: warn app: version: ^project.version^ diff --git a/sfc-core/src/main/resources/sql/1.8.6.1.sql b/sfc-core/src/main/resources/sql/1.8.6.1.sql new file mode 100644 index 0000000000000000000000000000000000000000..cb3fd4ef271d519459bd00bdb8b7013f1506d436 --- /dev/null +++ b/sfc-core/src/main/resources/sql/1.8.6.1.sql @@ -0,0 +1 @@ +ALTER TABLE user modify email VARCHAR(256) DEFAULT NULL; \ No newline at end of file diff --git a/sfc-core/src/main/resources/sql/full.sql b/sfc-core/src/main/resources/sql/full.sql index b2e71c1e199eddf8c7a52d508f40d8847c161c75..86c629b7c414ea921913d789bc4d06b3d147f615 100644 --- a/sfc-core/src/main/resources/sql/full.sql +++ b/sfc-core/src/main/resources/sql/full.sql @@ -198,7 +198,7 @@ CREATE TABLE `user` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `user` varchar(32) DEFAULT NULL, `pwd` varchar(32) DEFAULT NULL, - `email` varchar(256) NOT NULL, + `email` varchar(256) DEFAULT NULL, `last_login` int unsigned DEFAULT NULL, `type` int unsigned DEFAULT '0', `role` varchar(32) DEFAULT NULL, diff --git a/sfc-orm-configure/pom.xml b/sfc-orm-configure/pom.xml index 023f5ed1ecf3afa41e60888b800e464a55f6b788..d24325838a5817a11fcf538b847eab47b6141520 100644 --- a/sfc-orm-configure/pom.xml +++ b/sfc-orm-configure/pom.xml @@ -5,7 +5,7 @@ saltedfishcloud com.xiaotao - 1.8.6.0-RELEASE + 1.8.6.2-RELEASE 4.0.0