@@ -153,7 +153,7 @@ public class SysRoleServiceImpl extends IBaseServiceImpl<SysRoleEntity, Long> im
}
/**
- *
+ * 重置角色为默认角色(游客)
* @param roleId 角色id
*/
private void checkUserRole(Long roleId){
@@ -186,7 +186,12 @@ public class SysRoleServiceImpl extends IBaseServiceImpl<SysRoleEntity, Long> im
@Override
public Result editStatus(Long id, Integer isDisable) {
+ // 禁用时,将关联用户的角色设置为默认角色(游客)
+
entityMapper.setIsEnabled(id, isDisable);
+ if (isDisable == 0) {
+ checkUserRole(id);
+ }
return Result.success();
@@ -9,7 +9,7 @@ project.sc=\u65B0\u7586\u6B66\u8B66\u519B\u53F2\u9986
redis.prefix=${project.en}_token_
# \u5141\u8BB8\u4E0A\u4F20\u6587\u4EF6\u540E\u7F00
-server.file.allow=.jpg,.gif,.png,.ico,.bmp,.jpeg,.zip,.zp,.rar,.mp3,.mp4,.avi,.mov,.4dage,.wav,.wma,.m4a,.obj
+server.file.allow=.jpg,.gif,.png,.ico,.bmp,.jpeg,.zip,.zp,.rar,.mp3,.mp4,.avi,.mov,.4dage,.wav,.wma,.m4a,.obj,.pdf,audio
@@ -290,7 +290,7 @@ public class GoodsServiceImpl extends IBaseServiceImpl<GoodsEntity, Long> implem
// 判断后缀名,需要包含这以下四个
- String [] typeCheck = {"video","model","thumb"};
+ String [] typeCheck = {"video","model","thumb","audio","pdf"};
if (!Arrays.asList(typeCheck).contains(type)) {
return Result.failure("非法类型");
@@ -302,7 +302,7 @@ public class GoodsServiceImpl extends IBaseServiceImpl<GoodsEntity, Long> implem
// 视频、模型使用原名存储(中文转拼音)
- if ("video".equals(type) || "model".equals(type)) {
+ if ("video".equals(type) || "model".equals(type) || "audio".equals(type)) {
newName = RegexUtil.getPinyinName(fileName);
} else {
newName = DateUtil.format(LocalDateTime.now(), "yyyyMMdd_HHmmssSSS");