2024年2月6日15:57:24

master
zm 2024-02-07 09:45:43 +08:00
parent fd0e99737a
commit c4bd2da74f
7 changed files with 32 additions and 17 deletions

View File

@ -236,6 +236,10 @@
<artifactId>persistence-api</artifactId> <artifactId>persistence-api</artifactId>
<version>1.0.2</version> <version>1.0.2</version>
</dependency> </dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -1,6 +1,9 @@
package com.zhangmeng.fiction.server.config; 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.access.AccessDeniedException;
import org.springframework.security.core.AuthenticationException; import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.AuthenticationEntryPoint; import org.springframework.security.web.AuthenticationEntryPoint;
@ -21,8 +24,8 @@ public class SecurityAuthenticationEntryPoint implements AuthenticationEntryPoin
@Override @Override
public void commence(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, AuthenticationException e) throws IOException, ServletException { public void commence(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, AuthenticationException e) throws IOException, ServletException {
//Result result = Result.failure(401,"权限不足,请登录后在试"); Result result = Result.failure(401,"权限不足,请登录后在试");
//ResponseUtil.responseJson(httpServletResponse, HttpStatus.UNAUTHORIZED.value(),result); ResponseUtil.responseJson(httpServletResponse, HttpStatus.UNAUTHORIZED.value(),result);
throw new AccessDeniedException("权限不足,请登录后在试"); // throw new AccessDeniedException("权限不足,请登录后在试");
} }
} }

View File

@ -58,7 +58,11 @@ public class PermissionServiceImpl extends AbstractBaseServiceImpl<Permission> i
if (rolePermissions.size() > 0) { if (rolePermissions.size() > 0) {
for (RolePermission rolePermission : rolePermissions) { for (RolePermission rolePermission : rolePermissions) {
Permission permission = this.findById(rolePermission.getPermission_id()); Permission permission = this.findById(rolePermission.getPermission_id());
if (permission != null){
permissionList.add(permission); permissionList.add(permission);
}else {
this.rolePermissionDao.deleteByPrimaryKey(rolePermission.getId());
}
} }
} }
} }

View File

@ -7,7 +7,7 @@ spring:
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource 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 username: root
password: root password: root
jpa: jpa:

View File

@ -70,4 +70,4 @@ other:
## 头部配置 ## 头部配置
header: header:
## 站内消息,数据来源,通过 false 设置关闭 ## 站内消息,数据来源,通过 false 设置关闭
message: "admin/data/message.json" message: " /system/admin/data/message.json"

View File

@ -213,32 +213,36 @@
var value2 = replace_str('${fiction_collection!}'); var value2 = replace_str('${fiction_collection!}');
var value3 = replace_str(${fiction_count!}); var value3 = replace_str(${fiction_count!});
var value4 = replace_str(${message_count!}); var value4 = replace_str(${message_count!});
var regulator = 200;
var bit = 0;
count.up("value1", { count.up("value1", {
time: 4000, time: 4000,
num: value1, num: value1,
bit: 0, bit: bit,
regulator: 50 regulator: regulator
}); });
count.up("value2", { count.up("value2", {
time: 4000, time: 4000,
num: value2, num: value2,
bit: 0, bit: bit,
regulator: 50 regulator: regulator
}); });
count.up("value3", { count.up("value3", {
time: 4000, time: 4000,
num: value3, num: value3,
bit: 0, bit: bit,
regulator: 50 regulator: regulator
}); });
count.up("value4", { count.up("value4", {
time: 4000, time: 4000,
bit: 0, bit: bit,
num: value4, num: value4,
regulator: 50 regulator: regulator
}); });
var echartsRecords = echarts.init(document.getElementById('echarts-records'), 'walden'); var echartsRecords = echarts.init(document.getElementById('echarts-records'), 'walden');
@ -326,7 +330,7 @@
str = str.toString() str = str.toString()
str = str.replace(/,/gi, ""); str = str.replace(/,/gi, "");
console.log(str) console.log(str)
return str return parseInt(str);
} }

View File

@ -31,7 +31,7 @@
<li class="layui-nav-item user"> <li class="layui-nav-item user">
<!-- 头 像 --> <!-- 头 像 -->
<a href="javascript:;"> <a href="javascript:;">
<#if loginUser.avatar??> <#if loginUser.avatar ??>
<img src="${springMacroRequestContext.contextPath}/system/admin/images/avatar.jpg" class="layui-nav-img"> <img src="${springMacroRequestContext.contextPath}/system/admin/images/avatar.jpg" class="layui-nav-img">
<#else > <#else >
<img src="${loginUser.avatar!}" class="layui-nav-img"> <img src="${loginUser.avatar!}" class="layui-nav-img">
@ -90,7 +90,7 @@
var popup = layui.popup; var popup = layui.popup;
// 初始化顶部用户信息 // 初始化顶部用户信息
admin.setAvatar("${loginUser.avatar!}","${loginUser.username!}"); //admin.setAvatar("/system/admin/images/avatar.jpg","${loginUser.username!}");
// 根目录下 pear.config.yml 文件为初始化配置 // 根目录下 pear.config.yml 文件为初始化配置
// 你可以通过 admin.setConfigPath 方法修改配置文件位置 // 你可以通过 admin.setConfigPath 方法修改配置文件位置