diff --git a/pom.xml b/pom.xml index cea4846..99dec4c 100644 --- a/pom.xml +++ b/pom.xml @@ -236,6 +236,10 @@ persistence-api 1.0.2 + + org.hibernate + hibernate-core + diff --git a/src/main/java/com/zhangmeng/fiction/server/config/SecurityAuthenticationEntryPoint.java b/src/main/java/com/zhangmeng/fiction/server/config/SecurityAuthenticationEntryPoint.java index f05bca4..f2983ff 100644 --- a/src/main/java/com/zhangmeng/fiction/server/config/SecurityAuthenticationEntryPoint.java +++ b/src/main/java/com/zhangmeng/fiction/server/config/SecurityAuthenticationEntryPoint.java @@ -1,6 +1,9 @@ package com.zhangmeng.fiction.server.config; +import com.zhangmeng.fiction.server.common.utils.ResponseUtil; +import com.zhangmeng.fiction.server.res.Result; +import org.springframework.http.HttpStatus; import org.springframework.security.access.AccessDeniedException; import org.springframework.security.core.AuthenticationException; import org.springframework.security.web.AuthenticationEntryPoint; @@ -21,8 +24,8 @@ public class SecurityAuthenticationEntryPoint implements AuthenticationEntryPoin @Override public void commence(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, AuthenticationException e) throws IOException, ServletException { - //Result result = Result.failure(401,"权限不足,请登录后在试"); - //ResponseUtil.responseJson(httpServletResponse, HttpStatus.UNAUTHORIZED.value(),result); - throw new AccessDeniedException("权限不足,请登录后在试"); + Result result = Result.failure(401,"权限不足,请登录后在试"); + ResponseUtil.responseJson(httpServletResponse, HttpStatus.UNAUTHORIZED.value(),result); +// throw new AccessDeniedException("权限不足,请登录后在试"); } } diff --git a/src/main/java/com/zhangmeng/fiction/server/service/impl/PermissionServiceImpl.java b/src/main/java/com/zhangmeng/fiction/server/service/impl/PermissionServiceImpl.java index 340ad29..e078ec3 100644 --- a/src/main/java/com/zhangmeng/fiction/server/service/impl/PermissionServiceImpl.java +++ b/src/main/java/com/zhangmeng/fiction/server/service/impl/PermissionServiceImpl.java @@ -58,7 +58,11 @@ public class PermissionServiceImpl extends AbstractBaseServiceImpl i if (rolePermissions.size() > 0) { for (RolePermission rolePermission : rolePermissions) { Permission permission = this.findById(rolePermission.getPermission_id()); - permissionList.add(permission); + if (permission != null){ + permissionList.add(permission); + }else { + this.rolePermissionDao.deleteByPrimaryKey(rolePermission.getId()); + } } } } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 40c6123..58ff784 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -7,7 +7,7 @@ spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver type: com.alibaba.druid.pool.DruidDataSource - url: jdbc:mysql://127.0.0.1:3306/mystyle-blog?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true + url: jdbc:mysql://127.0.0.1:3306/mystyle-fiction?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true username: root password: root jpa: diff --git a/src/main/resources/static/system/config/pear.config.yml b/src/main/resources/static/system/config/pear.config.yml index 33b6fbc..6906bd5 100644 --- a/src/main/resources/static/system/config/pear.config.yml +++ b/src/main/resources/static/system/config/pear.config.yml @@ -70,4 +70,4 @@ other: ## 头部配置 header: ## 站内消息,数据来源,通过 false 设置关闭 - message: "admin/data/message.json" \ No newline at end of file + message: " /system/admin/data/message.json" \ No newline at end of file diff --git a/src/main/resources/templates/admin/home/home.ftl b/src/main/resources/templates/admin/home/home.ftl index c83d6d4..065a090 100644 --- a/src/main/resources/templates/admin/home/home.ftl +++ b/src/main/resources/templates/admin/home/home.ftl @@ -213,32 +213,36 @@ var value2 = replace_str('${fiction_collection!}'); var value3 = replace_str(${fiction_count!}); var value4 = replace_str(${message_count!}); + + var regulator = 200; + var bit = 0; + count.up("value1", { time: 4000, num: value1, - bit: 0, - regulator: 50 + bit: bit, + regulator: regulator }); count.up("value2", { time: 4000, num: value2, - bit: 0, - regulator: 50 + bit: bit, + regulator: regulator }); count.up("value3", { time: 4000, num: value3, - bit: 0, - regulator: 50 + bit: bit, + regulator: regulator }); count.up("value4", { time: 4000, - bit: 0, + bit: bit, num: value4, - regulator: 50 + regulator: regulator }); var echartsRecords = echarts.init(document.getElementById('echarts-records'), 'walden'); @@ -326,7 +330,7 @@ str = str.toString() str = str.replace(/,/gi, ""); console.log(str) - return str + return parseInt(str); } diff --git a/src/main/resources/templates/admin/index.ftl b/src/main/resources/templates/admin/index.ftl index faca8e6..63dcb63 100644 --- a/src/main/resources/templates/admin/index.ftl +++ b/src/main/resources/templates/admin/index.ftl @@ -31,7 +31,7 @@
  • - <#if loginUser.avatar??> + <#if loginUser.avatar ??> <#else > @@ -90,7 +90,7 @@ var popup = layui.popup; // 初始化顶部用户信息 - admin.setAvatar("${loginUser.avatar!}","${loginUser.username!}"); + //admin.setAvatar("/system/admin/images/avatar.jpg","${loginUser.username!}"); // 根目录下 pear.config.yml 文件为初始化配置 // 你可以通过 admin.setConfigPath 方法修改配置文件位置