v3.6.0 三级等保重磅更新:1、【新增】双因子方式登录;2、【新增】定期修改密码;3、【新增】最大活跃时间;4、【新增】敏感数据脱敏;5、【新增】登录锁定配置;6、【新增】密码复杂度配置;7、【新增】三级等保可配置

This commit is contained in:
zhuoda 2024-09-03 22:35:00 +08:00
parent 6855b8b088
commit 4362e8df8b
15 changed files with 363 additions and 381 deletions

View File

@ -8,7 +8,6 @@ import net.lab1024.sa.base.module.support.reload.dao.ReloadItemDao;
import net.lab1024.sa.base.module.support.reload.dao.ReloadResultDao;
import net.lab1024.sa.base.module.support.reload.domain.ReloadItemEntity;
import net.lab1024.sa.base.module.support.reload.domain.ReloadResultEntity;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;

View File

@ -1,16 +1,16 @@
spring:
# 数据库连接信息
datasource:
url: jdbc:p6spy:mysql://47.96.105.74:11024/smart_admin_v3_dev?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai
url: jdbc:p6spy:mysql://127.0.0.1:3306/smart_admin_v3?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai
username: root
password: 11024Lab
password: SmartAdmin666
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
initial-size: 2
min-idle: 2
max-active: 10
max-wait: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
filters: stat
druid:
username: druid
@ -22,10 +22,10 @@ spring:
# redis 连接池配置信息
redis:
database: 7
host: 47.96.105.74
port: 6666
password: ASDasd123
database: 1
host: 127.0.0.1
port: 6379
password:
timeout: 10000ms
lettuce:
pool:
@ -39,7 +39,7 @@ spring:
host: smtp.163.com
port: 465
username: lab1024@163.com
password: ROIMSIQCEXHTQFTA
password: ROIASDFJKHQFTA
properties:
mail:
smtp:
@ -87,8 +87,8 @@ file:
region: oss-cn-hangzhou
endpoint: oss-cn-hangzhou.aliyuncs.com
bucket-name: 1024lab-smart-admin
access-key: LTAI5tBAbehjXWyAqLhc58e1
secret-key: asX6ZWutaoTbQL3GxsFs24CmfAcYu3
access-key:
secret-key:
url-prefix: https://${file.storage.cloud.bucket-name}.${file.storage.cloud.endpoint}/
private-url-expire-seconds: 3600

View File

@ -1,16 +1,16 @@
spring:
# 数据库连接信息
datasource:
url: jdbc:p6spy:mysql://47.96.105.74:11024/smart_admin_v3_dev?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai
url: jdbc:p6spy:mysql://127.0.0.1:3306/smart_admin_v3?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai
username: root
password: 11024Lab
password: SmartAdmin666
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
initial-size: 2
min-idle: 2
max-active: 10
max-wait: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
filters: stat
druid:
username: druid
@ -22,10 +22,10 @@ spring:
# redis 连接池配置信息
redis:
database: 7
host: 47.96.105.74
port: 6666
password: ASDasd123
database: 1
host: 127.0.0.1
port: 6379
password:
timeout: 10000ms
lettuce:
pool:
@ -39,7 +39,7 @@ spring:
host: smtp.163.com
port: 465
username: lab1024@163.com
password: ROIMSIQCEXHTQFTA
password: ROIASDFJKHQFTA
properties:
mail:
smtp:
@ -87,8 +87,8 @@ file:
region: oss-cn-hangzhou
endpoint: oss-cn-hangzhou.aliyuncs.com
bucket-name: 1024lab-smart-admin
access-key: LTAI5tBAbehjXWyAqLhc58e1
secret-key: asX6ZWutaoTbQL3GxsFs24CmfAcYu3
access-key:
secret-key:
url-prefix: https://${file.storage.cloud.bucket-name}.${file.storage.cloud.endpoint}/
private-url-expire-seconds: 3600
@ -104,7 +104,7 @@ springdoc:
knife4j:
enable: true
basic:
enable: false
enable: true
username: api # Basic认证用户名
password: 1024 # Basic认证密码

View File

@ -3,14 +3,14 @@ spring:
datasource:
url: jdbc:mysql://127.0.0.1:3306/smart_admin_v3_dev?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai
username: root
password: Zhuoda#1024lab
password: SmartAdmin666
driver-class-name: com.mysql.cj.jdbc.Driver
initial-size: 10
min-idle: 10
max-active: 100
max-wait: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
driver-class-name: com.mysql.cj.jdbc.Driver
filters: stat
druid:
username: druid
@ -38,7 +38,7 @@ spring:
host: smtp.163.com
port: 465
username: lab1024@163.com
password: 1024lab
password: ROIASDFJKHQFTA
properties:
mail:
smtp:
@ -84,9 +84,9 @@ file:
upload-path: /home/smart_admin_v3/upload/ #文件上传目录
url-prefix:
cloud:
region: oss-cn-qingdao
endpoint: oss-cn-qingdao.aliyuncs.com
bucket-name: common
region: oss-cn-hangzhou
endpoint: oss-cn-hangzhou.aliyuncs.com
bucket-name: 1024lab-smart-admin
access-key:
secret-key:
url-prefix: https://${file.storage.cloud.bucket-name}.${file.storage.cloud.endpoint}/

View File

@ -1,16 +1,16 @@
spring:
# 数据库连接信息
datasource:
url: jdbc:p6spy:mysql://47.96.105.74:11024/smart_admin_v3_dev?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai
url: jdbc:p6spy:mysql://127.0.0.1:3306/smart_admin_v3?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai
username: root
password: 11024Lab
password: SmartAdmin666
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
initial-size: 2
min-idle: 2
max-active: 10
max-wait: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
filters: stat
druid:
username: druid
@ -22,10 +22,10 @@ spring:
# redis 连接池配置信息
redis:
database: 7
host: 47.96.105.74
port: 6666
password: ASDasd123
database: 1
host: 127.0.0.1
port: 6379
password:
timeout: 10000ms
lettuce:
pool:
@ -39,7 +39,7 @@ spring:
host: smtp.163.com
port: 465
username: lab1024@163.com
password: ROIMSIQCEXHTQFTA
password: ROIASDFJKHQFTA
properties:
mail:
smtp:
@ -87,8 +87,8 @@ file:
region: oss-cn-hangzhou
endpoint: oss-cn-hangzhou.aliyuncs.com
bucket-name: 1024lab-smart-admin
access-key: LTAI5tBAbehjXWyAqLhc58e1
secret-key: asX6ZWutaoTbQL3GxsFs24CmfAcYu3
access-key:
secret-key:
url-prefix: https://${file.storage.cloud.bucket-name}.${file.storage.cloud.endpoint}/
private-url-expire-seconds: 3600

View File

@ -1,3 +1,3 @@
NODE_ENV=production
VITE_APP_TITLE='SmartAdmin 测试环境(Test)'
VITE_APP_API_URL='http://smartadmin.dev.1024lab.net/sa-api'
VITE_APP_API_URL='http://127.0.0.1:1024'

View File

@ -18,8 +18,6 @@ const KEY_PREFIX = 'smart_admin_';
export default {
// 用户token
USER_TOKEN: `${KEY_PREFIX}user_token`,
// 用户信息
USER_INFO: `${KEY_PREFIX}user_info`,
// 用户权限点
USER_POINTS: `${KEY_PREFIX}user_points`,
// 用户的tag列表

View File

@ -1,5 +1,5 @@
<template>
<a-modal v-model:open="showFlag" :width="800" title="消息内容" :destroyOnClose="true" @ok="showFlag = false">
<a-modal v-model:open="showFlag" :cancelText="null" :width="800" title="消息内容" :closable="false" :maskClosable="false" :destroyOnClose="true" @ok="showFlag = false">
<a-descriptions bordered :column="2" size="small">
<a-descriptions-item :labelStyle="{ width: '80px' }" :span="1" label="类型"
>{{ $smartEnumPlugin.getDescByValue('MESSAGE_TYPE_ENUM', messageDetail.messageType) }}
@ -10,6 +10,9 @@
<pre>{{ messageDetail.content }}</pre>
</a-descriptions-item>
</a-descriptions>
<template #footer>
<a-button type="primary" @click="showFlag = false">关闭</a-button>
</template>
</a-modal>
</template>
<script setup>

View File

@ -10,31 +10,29 @@
<template>
<div>
<a-popover v-model:open="show" trigger="contextmenu" placement="bottomLeft" @openChange="() => (show = true)">
<a-popover v-model:open="show" trigger="click" placement="bottomLeft">
<a-button type="text" @click="showMessage" style="padding: 4px 5px">
<a-badge :count="unreadMessageCount + toBeDoneCount">
<div style="width: 26px; height: 26px">
<BellOutlined :style="{ fontSize: '16px' }" />
<BellOutlined :style="{ fontSize: '16px' }"/>
</div>
</a-badge>
</a-button>
<template #content>
<!-- 为了能在点击查看消息详情弹窗的同时防止消息气泡卡片关闭 所以加了一个手动关闭按钮 -->
<a-button type="text" @click="closeMessage" style="padding: 4px 5px"> 关闭 </a-button>
<a-spin :spinning="loading">
<a-tabs class="dropdown-tabs" centered :tabBarStyle="{ textAlign: 'center' }" style="width: 300px">
<a-tab-pane key="message">
<template #tab>
未读消息
<a-badge :count="unreadMessageCount" showZero :offset="[0, -20]" />
<a-badge :count="unreadMessageCount" :show-zero="false" :offset="[-5, -15]"/>
</template>
<a-list class="tab-pane" size="small">
<a-list-item v-for="item in messageList" :key="item.messageId">
<a-list-item-meta>
<template #title>
<div class="title">
<a-badge status="error" />
<a-badge status="error"/>
<a @click="showMessageDetail(item)">{{ item.title }}</a>
</div>
</template>
@ -44,20 +42,20 @@
</a-list-item-meta>
</a-list-item>
<a-list-item v-if="unreadMessageCount > 3">
<a-button type="text" @click="gotoMessage" style="padding: 4px 5px"> ... 查看更多 </a-button>
<a-button type="link" @click="gotoMessage" style="margin: 0 auto"> 查看更多</a-button>
</a-list-item>
</a-list>
</a-tab-pane>
<a-tab-pane key="to_be_done">
<template #tab>
待办工作
<a-badge :count="toBeDoneCount" showZero :offset="[0, -20]" />
<a-badge :count="toBeDoneCount" :show-zero="false" :offset="[-5, -15]"/>
</template>
<a-list class="tab-pane" size="small" :locale="{ emptyText: '暂无待办' }">
<a-list-item v-for="(item, index) in toBeDoneList" :key="index">
<a-list-item-meta>
<template #title>
<a-badge status="error" />
<a-badge status="error"/>
<a-tag v-if="item.starFlag" color="red">重要</a-tag>
<span>{{ item.title }}</span>
</template>
@ -69,52 +67,52 @@
</a-spin>
</template>
</a-popover>
<MessageDetailModal ref="messageDetailModalRef" @refresh="queryMessage" />
<MessageDetailModal ref="messageDetailModalRef" @refresh="queryMessage"/>
</div>
</template>
<script setup>
import { computed, ref } from 'vue';
import { BellOutlined } from '@ant-design/icons-vue';
import { useUserStore } from '/@/store/modules/system/user.js';
import { smartSentry } from '/@/lib/smart-sentry.js';
import { messageApi } from '/@/api/support/message-api.js';
import dayjs from 'dayjs';
import { theme } from 'ant-design-vue';
import { useRouter } from 'vue-router';
import MessageDetailModal from './header-message-detail-modal.vue';
import localKey from '/@/constants/local-storage-key-const';
import { localRead } from '/@/utils/local-util';
import {computed, ref} from 'vue';
import {BellOutlined} from '@ant-design/icons-vue';
import {useUserStore} from '/@/store/modules/system/user.js';
import {smartSentry} from '/@/lib/smart-sentry.js';
import {messageApi} from '/@/api/support/message-api.js';
import dayjs from 'dayjs';
import {theme} from 'ant-design-vue';
import {useRouter} from 'vue-router';
import MessageDetailModal from './header-message-detail-modal.vue';
import localKey from '/@/constants/local-storage-key-const';
import {localRead} from '/@/utils/local-util';
const { useToken } = theme;
const { token } = useToken();
const {useToken} = theme;
const {token} = useToken();
const loading = ref(false);
const show = ref(false);
const loading = ref(false);
const show = ref(false);
//
function showMessage() {
//
function showMessage() {
show.value = true;
queryMessage();
loadToBeDoneList();
}
}
function closeMessage() {
function closeMessage() {
show.value = false;
}
}
// ------------------------- -------------------------
// ------------------------- -------------------------
//
const unreadMessageCount = computed(() => {
//
const unreadMessageCount = computed(() => {
return useUserStore().unreadMessageCount;
});
});
//
const messageList = ref([]);
//
const messageList = ref([]);
//
async function queryMessage() {
//
async function queryMessage() {
try {
loading.value = true;
let responseModel = await messageApi.queryMessage({
@ -130,30 +128,33 @@
} finally {
loading.value = false;
}
}
}
const messageDetailModalRef = ref();
function showMessageDetail(data) {
const messageDetailModalRef = ref();
function showMessageDetail(data) {
messageDetailModalRef.value.show(data);
}
closeMessage();
}
const router = useRouter();
function gotoMessage() {
const router = useRouter();
function gotoMessage() {
show.value = false;
router.push({ path: '/account', query: { menuId: 'message' } });
}
router.push({path: '/account', query: {menuId: 'message'}});
}
// ------------------------- -------------------------
// ------------------------- -------------------------
//
const toBeDoneCount = computed(() => {
//
const toBeDoneCount = computed(() => {
return useUserStore().toBeDoneCount;
});
});
//
const toBeDoneList = ref([]);
//
const toBeDoneList = ref([]);
const loadToBeDoneList = async () => {
const loadToBeDoneList = async () => {
try {
loading.value = true;
let localToBeDoneList = localRead(localKey.TO_BE_DONE);
@ -165,10 +166,10 @@
} finally {
loading.value = false;
}
};
};
// ------------------------- -------------------------
function timeago(dateStr) {
// ------------------------- -------------------------
function timeago(dateStr) {
let dateTimeStamp = dayjs(dateStr).toDate().getTime();
let result = '';
let minute = 1000 * 60; //
@ -208,24 +209,25 @@
result = year + '-' + month + '-' + date;
}
return result;
}
}
</script>
<style lang="less" scoped>
@smart-page-tag-operate-width: 40px;
@color-primary: v-bind('token.colorPrimary');
@smart-page-tag-operate-width: 40px;
@color-primary: v-bind('token.colorPrimary');
.message-icon-div {
.message-icon-div {
cursor: pointer;
height: 32px;
width: 42px;
padding-left: 10px;
}
.message-icon-div:hover {
background: @hover-bg-color !important;
}
}
.header-notice {
.message-icon-div:hover {
background: @hover-bg-color !important;
}
.header-notice {
display: inline-block;
transition: all 0.3s;
@ -236,22 +238,21 @@
.notice-badge {
color: inherit;
}
}
}
.title {
.title {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;
}
}
.dropdown-tabs {
.dropdown-tabs {
background-color: @base-bg-color;
border-radius: 4px;
}
}
.tab-pane {
height: 250px;
overflow-y: auto;
}
.tab-pane {
height: auto;
}
</style>

View File

@ -10,13 +10,6 @@
<template>
<a-space :size="10">
<div class="setting">
<a-input-search
@click="search"
style="margin-right: 30px; width: 250px"
placeholder="搜索六边形工程师、1024"
enter-button="搜索"
size="small"
/>
<!---消息通知--->
<HeaderMessage ref="headerMessage" />
<!---国际化--->
@ -70,11 +63,6 @@
return useAppConfigStore().helpDocExpandFlag;
});
//
function search() {
window.open('https://1024lab.net');
}
const { useToken } = theme;
const { token } = useToken();
</script>

View File

@ -120,7 +120,6 @@ export const useUserStore = defineStore({
this.token = '';
this.menuList = [];
this.tagNav = [];
this.userInfo = {};
this.unreadMessageCount = 0;
localRemove(localKey.USER_TOKEN);
localRemove(localKey.USER_POINTS);

View File

@ -12,7 +12,7 @@
title="代码配置"
style=""
:open="visibleFlag"
:width="1500"
:width="1200"
:footerStyle="{ textAlign: 'right' }"
@close="onClose"
:maskClosable="false"

View File

@ -11,7 +11,7 @@
<a-drawer
title="代码预览"
:open="visibleFlag"
:width="1500"
:width="1200"
:footerStyle="{ textAlign: 'right' }"
:bodyStyle="{ padding: '8px 24px' }"
@close="onClose"

View File

@ -159,6 +159,7 @@
title: '邮箱',
dataIndex: 'email',
width: 100,
ellipsis: true,
},
{
title: '超管',

File diff suppressed because one or more lines are too long