11 Commits

Author SHA1 Message Date
3f8f4e2bf4 release: v1.3.1 2023-11-15 21:12:04 +08:00
3fcdb54442 fix: sms4j 3.0.3 => 3.0.4
修复发送容联云短信错误
2023-11-15 20:57:04 +08:00
5d159c6ab3 fix: 发送消息增加事务处理 2023-11-15 20:55:27 +08:00
39969ebf61 chore: 完善 Redis 部署配置 2023-11-12 00:21:04 +08:00
47a5746794 fix: 修复仪表盘访问趋势区块 y 轴数值过大时无法展示的问题
增加 y 轴单位转换逻辑
2023-11-11 00:09:18 +08:00
8820c1dfc8 refactor: 优化 401 状态处理逻辑
1.退出接口增加登录校验
2.前端获取用户信息失败,自动清理客户端信息并跳转回登录页
2023-11-07 19:53:29 +08:00
712eedba1b refactor: 优化超时登录处理逻辑 2023-11-06 22:12:27 +08:00
47a8160d70 fix: 修复控制台报错 Please use theme before using plugins
1.由 v-md-editor 使用方式不佳引起
2023-11-05 23:23:54 +08:00
b63d7d725d fix: 修复 Swagger 分组接口缺失 2023-11-05 21:11:34 +08:00
f15494d348 style: 优化部分变量命名 2023-11-05 17:36:41 +08:00
91ea4ed685 chore: 更新版本号 2023-11-05 17:30:23 +08:00
17 changed files with 63 additions and 38 deletions

View File

@@ -1,3 +1,20 @@
## [v1.3.1](https://github.com/Charles7c/continew-admin/compare/v1.3.0...v1.3.1) (2023-11-15)
### 💎 功能优化
- 完善 Redis 部署配置 ([39969eb](https://github.com/Charles7c/continew-admin/commit/39969ebf6173fc379dc3501e9204a344d1cf62cf))
- 优化 401 状态处理逻辑 ([8820c1d](https://github.com/Charles7c/continew-admin/commit/8820c1dfc858b9ef9df470e90dfe9ba4b1166e29))
- 优化超时登录处理逻辑 ([712eedb](https://github.com/Charles7c/continew-admin/commit/712eedba1be0ec371119745d4596cd35c2ce25d6))
- 优化部分变量命名 ([f15494d](https://github.com/Charles7c/continew-admin/commit/f15494d34823ded87efc396d98e2eb0108f74a3d))
### 🐛 问题修复
- sms4j 3.0.3 => 3.0.4 ([3fcdb54](https://github.com/Charles7c/continew-admin/commit/3fcdb54442b380e76838478fa46e8dfb70a2759b))
- 发送消息增加事务处理 ([5d159c6](https://github.com/Charles7c/continew-admin/commit/5d159c6ab337a9432419d84cf246cff506500567))
- 修复仪表盘访问趋势区块 y 轴数值过大时无法展示的问题 ([47a5746](https://github.com/Charles7c/continew-admin/commit/47a5746794e552faf9c41fbcc21af091a878eb95))
- 修复控制台报错 Please use theme before using plugins ([47a8160](https://github.com/Charles7c/continew-admin/commit/47a8160d70862a5ee7284c165004cece2714a10f))
- 修复 Swagger 分组接口缺失 ([b63d7d7](https://github.com/Charles7c/continew-admin/commit/b63d7d725da5e9e9b2db9fd59bd140d64b50040c))
## [v1.3.0](https://github.com/Charles7c/continew-admin/compare/v1.2.0...v1.3.0) (2023-11-04) ## [v1.3.0](https://github.com/Charles7c/continew-admin/compare/v1.2.0...v1.3.0) (2023-11-04)
### ✨ 新特性 ### ✨ 新特性

View File

@@ -4,7 +4,7 @@
<img src="https://img.shields.io/badge/License-Apache--2.0-blue.svg" alt="License" /> <img src="https://img.shields.io/badge/License-Apache--2.0-blue.svg" alt="License" />
</a> </a>
<a href="https://github.com/Charles7c/continew-admin" target="_blank"> <a href="https://github.com/Charles7c/continew-admin" target="_blank">
<img src="https://img.shields.io/badge/RELEASE-v1.3.0-%23ff3f59.svg" alt="Release" /> <img src="https://img.shields.io/badge/RELEASE-v1.3.1-%23ff3f59.svg" alt="Release" />
</a> </a>
<a href="https://github.com/Charles7c/continew-admin" target="_blank"> <a href="https://github.com/Charles7c/continew-admin" target="_blank">
<img src="https://img.shields.io/github/stars/Charles7c/continew-admin?style=social" alt="GitHub stars" /> <img src="https://img.shields.io/github/stars/Charles7c/continew-admin?style=social" alt="GitHub stars" />
@@ -23,7 +23,7 @@
## 简介 ## 简介
ContiNew Admin Continue New Admin中后台管理框架/脚手架持续以最新流行技术栈构建拥抱变化迭代优化。在社区贡献者的支持和参与下持续发展并源源不断地为企业级项目开发提供助力。当前采用的技术栈Vue3、Spring Boot3、TypeScript、Arco Design Vue、Undertow、Sa-Token、JWT、MariaDB、MyBatis Plus、Redis、Redisson、Easy Excel、Hutool 等。 ContiNew Admin Continue New Admin中后台管理框架/脚手架持续以最新流行技术栈构建拥抱变化迭代优化。在社区贡献者的支持和参与下持续发展并源源不断地为企业级项目开发提供助力。当前采用的技术栈Vue3、**Spring Boot 2.7.xJDK8** 、TypeScript、Arco Design Vue、Undertow、Sa-Token、JWT、MariaDB、MyBatis Plus、Redis、Redisson、Easy Excel、Hutool 等。
## 项目源码 ## 项目源码

View File

@@ -139,10 +139,9 @@ public class LogServiceImpl implements LogService {
public SystemLogDetailResp get(Long id) { public SystemLogDetailResp get(Long id) {
LogDO logDO = logMapper.selectById(id); LogDO logDO = logMapper.selectById(id);
CheckUtils.throwIfNotExists(logDO, "LogDO", "ID", id); CheckUtils.throwIfNotExists(logDO, "LogDO", "ID", id);
SystemLogDetailResp detail = BeanUtil.copyProperties(logDO, SystemLogDetailResp.class);
SystemLogDetailResp detailVO = BeanUtil.copyProperties(logDO, SystemLogDetailResp.class); this.fill(detail);
this.fill(detailVO); return detail;
return detailVO;
} }
@Override @Override

View File

@@ -68,6 +68,7 @@ public class MessageServiceImpl implements MessageService {
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void add(MessageReq req, List<Long> userIdList) { public void add(MessageReq req, List<Long> userIdList) {
CheckUtils.throwIf(() -> CollUtil.isEmpty(userIdList), "消息接收人不能为空"); CheckUtils.throwIf(() -> CollUtil.isEmpty(userIdList), "消息接收人不能为空");
MessageDO message = BeanUtil.copyProperties(req, MessageDO.class); MessageDO message = BeanUtil.copyProperties(req, MessageDO.class);

View File

@@ -135,16 +135,16 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleMapper, RoleDO, RoleRes
public void fillDetail(Object detailObj) { public void fillDetail(Object detailObj) {
super.fillDetail(detailObj); super.fillDetail(detailObj);
if (detailObj instanceof RoleDetailResp) { if (detailObj instanceof RoleDetailResp) {
RoleDetailResp detailVO = (RoleDetailResp)detailObj; RoleDetailResp detail = (RoleDetailResp)detailObj;
Long roleId = detailVO.getId(); Long roleId = detail.getId();
if (SysConsts.ADMIN_ROLE_CODE.equals(detailVO.getCode())) { if (SysConsts.ADMIN_ROLE_CODE.equals(detail.getCode())) {
List<MenuResp> list = menuService.list(null, null); List<MenuResp> list = menuService.list(null, null);
List<Long> menuIds = list.stream().map(MenuResp::getId).collect(Collectors.toList()); List<Long> menuIds = list.stream().map(MenuResp::getId).collect(Collectors.toList());
detailVO.setMenuIds(menuIds); detail.setMenuIds(menuIds);
} else { } else {
detailVO.setMenuIds(roleMenuService.listMenuIdByRoleIds(CollUtil.newArrayList(roleId))); detail.setMenuIds(roleMenuService.listMenuIdByRoleIds(CollUtil.newArrayList(roleId)));
} }
detailVO.setDeptIds(roleDeptService.listDeptIdByRoleId(roleId)); detail.setDeptIds(roleDeptService.listDeptIdByRoleId(roleId));
} }
} }

View File

@@ -153,11 +153,11 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, UserDO, UserRes
public void fillDetail(Object detailObj) { public void fillDetail(Object detailObj) {
super.fillDetail(detailObj); super.fillDetail(detailObj);
if (detailObj instanceof UserDetailResp) { if (detailObj instanceof UserDetailResp) {
UserDetailResp detailVO = (UserDetailResp)detailObj; UserDetailResp detail = (UserDetailResp)detailObj;
detailVO.setDeptName(ExceptionUtils.exToNull(() -> deptService.get(detailVO.getDeptId()).getName())); detail.setDeptName(ExceptionUtils.exToNull(() -> deptService.get(detail.getDeptId()).getName()));
List<Long> roleIdList = userRoleService.listRoleIdByUserId(detailVO.getId()); List<Long> roleIdList = userRoleService.listRoleIdByUserId(detail.getId());
detailVO.setRoleIds(roleIdList); detail.setRoleIds(roleIdList);
detailVO.setRoleNames(String.join(StringConsts.CHINESE_COMMA, roleService.listNameByIds(roleIdList))); detail.setRoleNames(String.join(StringConsts.CHINESE_COMMA, roleService.listNameByIds(roleIdList)));
} }
} }

View File

@@ -1,7 +1,7 @@
{ {
"name": "continew-admin-ui", "name": "continew-admin-ui",
"description": "ContiNew Admin 中后台管理框架Continue New Admin持续以最新流行技术栈构建拥抱变化迭代优化。", "description": "ContiNew Admin 中后台管理框架Continue New Admin持续以最新流行技术栈构建拥抱变化迭代优化。",
"version": "1.3.0", "version": "1.3.1",
"private": true, "private": true,
"author": "Charles7c", "author": "Charles7c",
"license": "Apache-2.0", "license": "Apache-2.0",

View File

@@ -40,17 +40,17 @@ import App from './App.vue';
import '@/assets/style/global.less'; import '@/assets/style/global.less';
import '@/utils/request'; import '@/utils/request';
VueMarkdownEditor.use(createEmojiPlugin());
VueMarkdownEditor.use(createCopyCodePlugin());
VueMarkdownEditor.use(createTodoListPlugin());
hljs.registerLanguage('json', json);
hljs.registerLanguage('java', java);
VueMarkdownEditor.use(githubTheme, { VueMarkdownEditor.use(githubTheme, {
Hljs: hljs, Hljs: hljs,
}); });
VMdPreview.use(githubTheme, { VMdPreview.use(githubTheme, {
Hljs: hljs, Hljs: hljs,
}); });
VueMarkdownEditor.use(createEmojiPlugin());
VueMarkdownEditor.use(createCopyCodePlugin());
VueMarkdownEditor.use(createTodoListPlugin());
hljs.registerLanguage('json', json);
hljs.registerLanguage('java', java);
const app = createApp(App); const app = createApp(App);
// 全局方法挂载 // 全局方法挂载

View File

@@ -23,7 +23,7 @@ export default function setupUserLoginInfoGuard(router: Router) {
await userStore.getInfo(); await userStore.getInfo();
next(); next();
} catch (error) { } catch (error) {
await userStore.logout(); await userStore.logoutCallBack();
next({ next({
name: 'login', name: 'login',
query: { query: {

View File

@@ -22,8 +22,11 @@ const setTimer = (timer: number) => {
}; };
const clearTimer = () => { const clearTimer = () => {
clearInterval(Number(localStorage.getItem(TIMER_KEY))); const timer = localStorage.getItem(TIMER_KEY);
localStorage.removeItem(TIMER_KEY); if (timer) {
clearInterval(Number(timer));
localStorage.removeItem(TIMER_KEY);
}
}; };
export { isLogin, getToken, setToken, clearToken, setTimer, clearTimer }; export { isLogin, getToken, setToken, clearToken, setTimer, clearTimer };

View File

@@ -1,7 +1,7 @@
import axios from 'axios'; import axios from 'axios';
import type { AxiosRequestConfig, AxiosResponse } from 'axios'; import type { AxiosRequestConfig, AxiosResponse } from 'axios';
import { useUserStore } from '@/store'; import { useUserStore } from '@/store';
import { getToken } from '@/utils/auth'; import { getToken, clearTimer } from '@/utils/auth';
import modalErrorWrapper from '@/utils/modal-error-wrapper'; import modalErrorWrapper from '@/utils/modal-error-wrapper';
import messageErrorWrapper from '@/utils/message-error-wrapper'; import messageErrorWrapper from '@/utils/message-error-wrapper';
@@ -51,8 +51,7 @@ axios.interceptors.response.use(
return res; return res;
} }
if ([401].includes(res.code) && response.config.url !== '/auth/user/info') { if ([401].includes(res.code) && response.config.url !== '/auth/user/info') {
const userStore = useUserStore(); clearTimer();
userStore.logout();
modalErrorWrapper({ modalErrorWrapper({
title: '确认退出', title: '确认退出',
content: res.msg, content: res.msg,
@@ -60,6 +59,8 @@ axios.interceptors.response.use(
escToClose: false, escToClose: false,
okText: '重新登录', okText: '重新登录',
async onOk() { async onOk() {
const userStore = useUserStore();
userStore.logoutCallBack();
window.location.reload(); window.location.reload();
}, },
}); });

View File

@@ -60,7 +60,7 @@
const { chartOption } = useChartOption((isDark) => { const { chartOption } = useChartOption((isDark) => {
return { return {
grid: { grid: {
left: '30', left: '38',
right: '0', right: '0',
top: '10', top: '10',
bottom: '50', bottom: '50',
@@ -114,6 +114,9 @@
axisLabel: { axisLabel: {
formatter(value: any, idx: number) { formatter(value: any, idx: number) {
if (idx === 0) return value; if (idx === 0) return value;
if (value >= 1000) {
return `${value / 1000}k`;
}
return `${value}`; return `${value}`;
}, },
}, },

View File

@@ -110,7 +110,6 @@ public class AuthController {
return LoginResp.builder().token(token).build(); return LoginResp.builder().token(token).build();
} }
@SaIgnore
@Operation(summary = "用户退出", description = "注销用户的当前登录") @Operation(summary = "用户退出", description = "注销用户的当前登录")
@Parameter(name = "Authorization", description = "令牌", required = true, example = "Bearer xxxx-xxxx-xxxx-xxxx", @Parameter(name = "Authorization", description = "令牌", required = true, example = "Bearer xxxx-xxxx-xxxx-xxxx",
in = ParameterIn.HEADER) in = ParameterIn.HEADER)

View File

@@ -5,7 +5,7 @@ project:
# 应用名称 # 应用名称
appName: continew-admin appName: continew-admin
# 版本 # 版本
version: 1.3.0 version: 1.3.1
# 描述 # 描述
description: ContiNew Admin 中后台管理框架/脚手架Continue New Admin持续以最新流行技术栈构建拥抱变化迭代优化。 description: ContiNew Admin 中后台管理框架/脚手架Continue New Admin持续以最新流行技术栈构建拥抱变化迭代优化。
# 基本包 # 基本包
@@ -58,7 +58,9 @@ springdoc:
packages-to-scan: ${project.basePackage}.webapi.controller packages-to-scan: ${project.basePackage}.webapi.controller
- group: 'auth' - group: 'auth'
display-name: '系统认证' display-name: '系统认证'
paths-to-match: '/auth/**' paths-to-match:
- '/auth/**'
- '/oauth/**'
packages-to-scan: ${project.basePackage}.webapi.controller.auth packages-to-scan: ${project.basePackage}.webapi.controller.auth
- group: 'common' - group: 'common'
display-name: '通用接口' display-name: '通用接口'

View File

@@ -28,7 +28,7 @@ services:
- /docker/redis/conf/redis.conf:/usr/local/redis/config/redis.conf - /docker/redis/conf/redis.conf:/usr/local/redis/config/redis.conf
- /docker/redis/data:/data - /docker/redis/data:/data
- /docker/redis/logs:/logs - /docker/redis/logs:/logs
command: 'redis-server /usr/local/redis/config/redis.conf --appendonly yes --requirepass 123456' command: 'redis-server /usr/local/redis/config/redis.conf --appendonly yes --requirepass 你的 Redis 密码'
continew-admin-server: continew-admin-server:
build: ./continew-admin build: ./continew-admin
restart: always restart: always
@@ -67,5 +67,5 @@ services:
volumes: volumes:
- /docker/nginx/conf/nginx.conf:/etc/nginx/nginx.conf - /docker/nginx/conf/nginx.conf:/etc/nginx/nginx.conf
- /docker/nginx/cert:/etc/nginx/cert - /docker/nginx/cert:/etc/nginx/cert
- /docker/continew-admin/web:/usr/share/nginx/html
- /docker/nginx/logs:/var/log/nginx - /docker/nginx/logs:/var/log/nginx
- /docker/continew-admin/web:/usr/share/nginx/html

View File

@@ -1,6 +1,6 @@
bind 0.0.0.0 bind 0.0.0.0
# redis 密码 # redis 密码
requirepass 123456 requirepass 你的 Redis 密码
# key 监听器配置 # key 监听器配置
# notify-keyspace-events Ex # notify-keyspace-events Ex

View File

@@ -52,7 +52,7 @@ limitations under the License.
<p6spy.version>3.9.1</p6spy.version> <p6spy.version>3.9.1</p6spy.version>
<!-- ### 工具库相关 ### --> <!-- ### 工具库相关 ### -->
<sms4j.version>3.0.3</sms4j.version> <sms4j.version>3.0.4</sms4j.version>
<justauth.version>1.16.5</justauth.version> <justauth.version>1.16.5</justauth.version>
<easyexcel.version>3.3.2</easyexcel.version> <easyexcel.version>3.3.2</easyexcel.version>
<ip2region.version>2.7.15</ip2region.version> <ip2region.version>2.7.15</ip2region.version>
@@ -62,7 +62,7 @@ limitations under the License.
<hutool.version>5.8.22</hutool.version> <hutool.version>5.8.22</hutool.version>
<!-- ### 基础环境相关 ### --> <!-- ### 基础环境相关 ### -->
<revision>1.3.0</revision> <revision>1.3.1</revision>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<spotless.version>2.30.0</spotless.version> <spotless.version>2.30.0</spotless.version>
<maven.compiler.source>8</maven.compiler.source> <maven.compiler.source>8</maven.compiler.source>