mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-09-17 19:06:39 +08:00
v3.6.0 三级等保重磅更新:1、【新增】双因子方式登录;2、【新增】定期修改密码;3、【新增】最大活跃时间;4、【新增】敏感数据脱敏;5、【新增】登录锁定配置;6、【新增】密码复杂度配置;7、【新增】三级等保可配置
This commit is contained in:
parent
6855b8b088
commit
4362e8df8b
@ -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.dao.ReloadResultDao;
|
||||||
import net.lab1024.sa.base.module.support.reload.domain.ReloadItemEntity;
|
import net.lab1024.sa.base.module.support.reload.domain.ReloadItemEntity;
|
||||||
import net.lab1024.sa.base.module.support.reload.domain.ReloadResultEntity;
|
import net.lab1024.sa.base.module.support.reload.domain.ReloadResultEntity;
|
||||||
import org.springframework.context.annotation.Lazy;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
spring:
|
spring:
|
||||||
# 数据库连接信息
|
# 数据库连接信息
|
||||||
datasource:
|
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
|
username: root
|
||||||
password: 11024Lab
|
password: SmartAdmin666
|
||||||
|
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
|
||||||
initial-size: 2
|
initial-size: 2
|
||||||
min-idle: 2
|
min-idle: 2
|
||||||
max-active: 10
|
max-active: 10
|
||||||
max-wait: 60000
|
max-wait: 60000
|
||||||
time-between-eviction-runs-millis: 60000
|
time-between-eviction-runs-millis: 60000
|
||||||
min-evictable-idle-time-millis: 300000
|
min-evictable-idle-time-millis: 300000
|
||||||
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
|
|
||||||
filters: stat
|
filters: stat
|
||||||
druid:
|
druid:
|
||||||
username: druid
|
username: druid
|
||||||
@ -22,10 +22,10 @@ spring:
|
|||||||
|
|
||||||
# redis 连接池配置信息
|
# redis 连接池配置信息
|
||||||
redis:
|
redis:
|
||||||
database: 7
|
database: 1
|
||||||
host: 47.96.105.74
|
host: 127.0.0.1
|
||||||
port: 6666
|
port: 6379
|
||||||
password: ASDasd123
|
password:
|
||||||
timeout: 10000ms
|
timeout: 10000ms
|
||||||
lettuce:
|
lettuce:
|
||||||
pool:
|
pool:
|
||||||
@ -39,7 +39,7 @@ spring:
|
|||||||
host: smtp.163.com
|
host: smtp.163.com
|
||||||
port: 465
|
port: 465
|
||||||
username: lab1024@163.com
|
username: lab1024@163.com
|
||||||
password: ROIMSIQCEXHTQFTA
|
password: ROIASDFJKHQFTA
|
||||||
properties:
|
properties:
|
||||||
mail:
|
mail:
|
||||||
smtp:
|
smtp:
|
||||||
@ -87,8 +87,8 @@ file:
|
|||||||
region: oss-cn-hangzhou
|
region: oss-cn-hangzhou
|
||||||
endpoint: oss-cn-hangzhou.aliyuncs.com
|
endpoint: oss-cn-hangzhou.aliyuncs.com
|
||||||
bucket-name: 1024lab-smart-admin
|
bucket-name: 1024lab-smart-admin
|
||||||
access-key: LTAI5tBAbehjXWyAqLhc58e1
|
access-key:
|
||||||
secret-key: asX6ZWutaoTbQL3GxsFs24CmfAcYu3
|
secret-key:
|
||||||
url-prefix: https://${file.storage.cloud.bucket-name}.${file.storage.cloud.endpoint}/
|
url-prefix: https://${file.storage.cloud.bucket-name}.${file.storage.cloud.endpoint}/
|
||||||
private-url-expire-seconds: 3600
|
private-url-expire-seconds: 3600
|
||||||
|
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
spring:
|
spring:
|
||||||
# 数据库连接信息
|
# 数据库连接信息
|
||||||
datasource:
|
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
|
username: root
|
||||||
password: 11024Lab
|
password: SmartAdmin666
|
||||||
|
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
|
||||||
initial-size: 2
|
initial-size: 2
|
||||||
min-idle: 2
|
min-idle: 2
|
||||||
max-active: 10
|
max-active: 10
|
||||||
max-wait: 60000
|
max-wait: 60000
|
||||||
time-between-eviction-runs-millis: 60000
|
time-between-eviction-runs-millis: 60000
|
||||||
min-evictable-idle-time-millis: 300000
|
min-evictable-idle-time-millis: 300000
|
||||||
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
|
|
||||||
filters: stat
|
filters: stat
|
||||||
druid:
|
druid:
|
||||||
username: druid
|
username: druid
|
||||||
@ -22,10 +22,10 @@ spring:
|
|||||||
|
|
||||||
# redis 连接池配置信息
|
# redis 连接池配置信息
|
||||||
redis:
|
redis:
|
||||||
database: 7
|
database: 1
|
||||||
host: 47.96.105.74
|
host: 127.0.0.1
|
||||||
port: 6666
|
port: 6379
|
||||||
password: ASDasd123
|
password:
|
||||||
timeout: 10000ms
|
timeout: 10000ms
|
||||||
lettuce:
|
lettuce:
|
||||||
pool:
|
pool:
|
||||||
@ -39,7 +39,7 @@ spring:
|
|||||||
host: smtp.163.com
|
host: smtp.163.com
|
||||||
port: 465
|
port: 465
|
||||||
username: lab1024@163.com
|
username: lab1024@163.com
|
||||||
password: ROIMSIQCEXHTQFTA
|
password: ROIASDFJKHQFTA
|
||||||
properties:
|
properties:
|
||||||
mail:
|
mail:
|
||||||
smtp:
|
smtp:
|
||||||
@ -87,8 +87,8 @@ file:
|
|||||||
region: oss-cn-hangzhou
|
region: oss-cn-hangzhou
|
||||||
endpoint: oss-cn-hangzhou.aliyuncs.com
|
endpoint: oss-cn-hangzhou.aliyuncs.com
|
||||||
bucket-name: 1024lab-smart-admin
|
bucket-name: 1024lab-smart-admin
|
||||||
access-key: LTAI5tBAbehjXWyAqLhc58e1
|
access-key:
|
||||||
secret-key: asX6ZWutaoTbQL3GxsFs24CmfAcYu3
|
secret-key:
|
||||||
url-prefix: https://${file.storage.cloud.bucket-name}.${file.storage.cloud.endpoint}/
|
url-prefix: https://${file.storage.cloud.bucket-name}.${file.storage.cloud.endpoint}/
|
||||||
private-url-expire-seconds: 3600
|
private-url-expire-seconds: 3600
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ springdoc:
|
|||||||
knife4j:
|
knife4j:
|
||||||
enable: true
|
enable: true
|
||||||
basic:
|
basic:
|
||||||
enable: false
|
enable: true
|
||||||
username: api # Basic认证用户名
|
username: api # Basic认证用户名
|
||||||
password: 1024 # Basic认证密码
|
password: 1024 # Basic认证密码
|
||||||
|
|
||||||
|
@ -3,14 +3,14 @@ spring:
|
|||||||
datasource:
|
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
|
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
|
username: root
|
||||||
password: Zhuoda#1024lab
|
password: SmartAdmin666
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
initial-size: 10
|
initial-size: 10
|
||||||
min-idle: 10
|
min-idle: 10
|
||||||
max-active: 100
|
max-active: 100
|
||||||
max-wait: 60000
|
max-wait: 60000
|
||||||
time-between-eviction-runs-millis: 60000
|
time-between-eviction-runs-millis: 60000
|
||||||
min-evictable-idle-time-millis: 300000
|
min-evictable-idle-time-millis: 300000
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
|
||||||
filters: stat
|
filters: stat
|
||||||
druid:
|
druid:
|
||||||
username: druid
|
username: druid
|
||||||
@ -38,7 +38,7 @@ spring:
|
|||||||
host: smtp.163.com
|
host: smtp.163.com
|
||||||
port: 465
|
port: 465
|
||||||
username: lab1024@163.com
|
username: lab1024@163.com
|
||||||
password: 1024lab
|
password: ROIASDFJKHQFTA
|
||||||
properties:
|
properties:
|
||||||
mail:
|
mail:
|
||||||
smtp:
|
smtp:
|
||||||
@ -84,9 +84,9 @@ file:
|
|||||||
upload-path: /home/smart_admin_v3/upload/ #文件上传目录
|
upload-path: /home/smart_admin_v3/upload/ #文件上传目录
|
||||||
url-prefix:
|
url-prefix:
|
||||||
cloud:
|
cloud:
|
||||||
region: oss-cn-qingdao
|
region: oss-cn-hangzhou
|
||||||
endpoint: oss-cn-qingdao.aliyuncs.com
|
endpoint: oss-cn-hangzhou.aliyuncs.com
|
||||||
bucket-name: common
|
bucket-name: 1024lab-smart-admin
|
||||||
access-key:
|
access-key:
|
||||||
secret-key:
|
secret-key:
|
||||||
url-prefix: https://${file.storage.cloud.bucket-name}.${file.storage.cloud.endpoint}/
|
url-prefix: https://${file.storage.cloud.bucket-name}.${file.storage.cloud.endpoint}/
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
spring:
|
spring:
|
||||||
# 数据库连接信息
|
# 数据库连接信息
|
||||||
datasource:
|
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
|
username: root
|
||||||
password: 11024Lab
|
password: SmartAdmin666
|
||||||
|
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
|
||||||
initial-size: 2
|
initial-size: 2
|
||||||
min-idle: 2
|
min-idle: 2
|
||||||
max-active: 10
|
max-active: 10
|
||||||
max-wait: 60000
|
max-wait: 60000
|
||||||
time-between-eviction-runs-millis: 60000
|
time-between-eviction-runs-millis: 60000
|
||||||
min-evictable-idle-time-millis: 300000
|
min-evictable-idle-time-millis: 300000
|
||||||
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
|
|
||||||
filters: stat
|
filters: stat
|
||||||
druid:
|
druid:
|
||||||
username: druid
|
username: druid
|
||||||
@ -22,10 +22,10 @@ spring:
|
|||||||
|
|
||||||
# redis 连接池配置信息
|
# redis 连接池配置信息
|
||||||
redis:
|
redis:
|
||||||
database: 7
|
database: 1
|
||||||
host: 47.96.105.74
|
host: 127.0.0.1
|
||||||
port: 6666
|
port: 6379
|
||||||
password: ASDasd123
|
password:
|
||||||
timeout: 10000ms
|
timeout: 10000ms
|
||||||
lettuce:
|
lettuce:
|
||||||
pool:
|
pool:
|
||||||
@ -39,7 +39,7 @@ spring:
|
|||||||
host: smtp.163.com
|
host: smtp.163.com
|
||||||
port: 465
|
port: 465
|
||||||
username: lab1024@163.com
|
username: lab1024@163.com
|
||||||
password: ROIMSIQCEXHTQFTA
|
password: ROIASDFJKHQFTA
|
||||||
properties:
|
properties:
|
||||||
mail:
|
mail:
|
||||||
smtp:
|
smtp:
|
||||||
@ -87,8 +87,8 @@ file:
|
|||||||
region: oss-cn-hangzhou
|
region: oss-cn-hangzhou
|
||||||
endpoint: oss-cn-hangzhou.aliyuncs.com
|
endpoint: oss-cn-hangzhou.aliyuncs.com
|
||||||
bucket-name: 1024lab-smart-admin
|
bucket-name: 1024lab-smart-admin
|
||||||
access-key: LTAI5tBAbehjXWyAqLhc58e1
|
access-key:
|
||||||
secret-key: asX6ZWutaoTbQL3GxsFs24CmfAcYu3
|
secret-key:
|
||||||
url-prefix: https://${file.storage.cloud.bucket-name}.${file.storage.cloud.endpoint}/
|
url-prefix: https://${file.storage.cloud.bucket-name}.${file.storage.cloud.endpoint}/
|
||||||
private-url-expire-seconds: 3600
|
private-url-expire-seconds: 3600
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
NODE_ENV=production
|
NODE_ENV=production
|
||||||
VITE_APP_TITLE='SmartAdmin 测试环境(Test)'
|
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'
|
||||||
|
@ -18,8 +18,6 @@ const KEY_PREFIX = 'smart_admin_';
|
|||||||
export default {
|
export default {
|
||||||
// 用户token
|
// 用户token
|
||||||
USER_TOKEN: `${KEY_PREFIX}user_token`,
|
USER_TOKEN: `${KEY_PREFIX}user_token`,
|
||||||
// 用户信息
|
|
||||||
USER_INFO: `${KEY_PREFIX}user_info`,
|
|
||||||
// 用户权限点
|
// 用户权限点
|
||||||
USER_POINTS: `${KEY_PREFIX}user_points`,
|
USER_POINTS: `${KEY_PREFIX}user_points`,
|
||||||
// 用户的tag列表
|
// 用户的tag列表
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<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 bordered :column="2" size="small">
|
||||||
<a-descriptions-item :labelStyle="{ width: '80px' }" :span="1" label="类型"
|
<a-descriptions-item :labelStyle="{ width: '80px' }" :span="1" label="类型"
|
||||||
>{{ $smartEnumPlugin.getDescByValue('MESSAGE_TYPE_ENUM', messageDetail.messageType) }}
|
>{{ $smartEnumPlugin.getDescByValue('MESSAGE_TYPE_ENUM', messageDetail.messageType) }}
|
||||||
@ -10,6 +10,9 @@
|
|||||||
<pre>{{ messageDetail.content }}</pre>
|
<pre>{{ messageDetail.content }}</pre>
|
||||||
</a-descriptions-item>
|
</a-descriptions-item>
|
||||||
</a-descriptions>
|
</a-descriptions>
|
||||||
|
<template #footer>
|
||||||
|
<a-button type="primary" @click="showFlag = false">关闭</a-button>
|
||||||
|
</template>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
|
@ -10,31 +10,29 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<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-button type="text" @click="showMessage" style="padding: 4px 5px">
|
||||||
<a-badge :count="unreadMessageCount + toBeDoneCount">
|
<a-badge :count="unreadMessageCount + toBeDoneCount">
|
||||||
<div style="width: 26px; height: 26px">
|
<div style="width: 26px; height: 26px">
|
||||||
<BellOutlined :style="{ fontSize: '16px' }" />
|
<BellOutlined :style="{ fontSize: '16px' }"/>
|
||||||
</div>
|
</div>
|
||||||
</a-badge>
|
</a-badge>
|
||||||
</a-button>
|
</a-button>
|
||||||
|
|
||||||
<template #content>
|
<template #content>
|
||||||
<!-- 为了能在点击查看消息详情弹窗的同时防止消息气泡卡片关闭 所以加了一个手动关闭按钮 -->
|
|
||||||
<a-button type="text" @click="closeMessage" style="padding: 4px 5px"> 关闭 </a-button>
|
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
<a-tabs class="dropdown-tabs" centered :tabBarStyle="{ textAlign: 'center' }" style="width: 300px">
|
<a-tabs class="dropdown-tabs" centered :tabBarStyle="{ textAlign: 'center' }" style="width: 300px">
|
||||||
<a-tab-pane key="message">
|
<a-tab-pane key="message">
|
||||||
<template #tab>
|
<template #tab>
|
||||||
未读消息
|
未读消息
|
||||||
<a-badge :count="unreadMessageCount" showZero :offset="[0, -20]" />
|
<a-badge :count="unreadMessageCount" :show-zero="false" :offset="[-5, -15]"/>
|
||||||
</template>
|
</template>
|
||||||
<a-list class="tab-pane" size="small">
|
<a-list class="tab-pane" size="small">
|
||||||
<a-list-item v-for="item in messageList" :key="item.messageId">
|
<a-list-item v-for="item in messageList" :key="item.messageId">
|
||||||
<a-list-item-meta>
|
<a-list-item-meta>
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<a-badge status="error" />
|
<a-badge status="error"/>
|
||||||
<a @click="showMessageDetail(item)">{{ item.title }}</a>
|
<a @click="showMessageDetail(item)">{{ item.title }}</a>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -44,20 +42,20 @@
|
|||||||
</a-list-item-meta>
|
</a-list-item-meta>
|
||||||
</a-list-item>
|
</a-list-item>
|
||||||
<a-list-item v-if="unreadMessageCount > 3">
|
<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-item>
|
||||||
</a-list>
|
</a-list>
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
<a-tab-pane key="to_be_done">
|
<a-tab-pane key="to_be_done">
|
||||||
<template #tab>
|
<template #tab>
|
||||||
待办工作
|
待办工作
|
||||||
<a-badge :count="toBeDoneCount" showZero :offset="[0, -20]" />
|
<a-badge :count="toBeDoneCount" :show-zero="false" :offset="[-5, -15]"/>
|
||||||
</template>
|
</template>
|
||||||
<a-list class="tab-pane" size="small" :locale="{ emptyText: '暂无待办' }">
|
<a-list class="tab-pane" size="small" :locale="{ emptyText: '暂无待办' }">
|
||||||
<a-list-item v-for="(item, index) in toBeDoneList" :key="index">
|
<a-list-item v-for="(item, index) in toBeDoneList" :key="index">
|
||||||
<a-list-item-meta>
|
<a-list-item-meta>
|
||||||
<template #title>
|
<template #title>
|
||||||
<a-badge status="error" />
|
<a-badge status="error"/>
|
||||||
<a-tag v-if="item.starFlag" color="red">重要</a-tag>
|
<a-tag v-if="item.starFlag" color="red">重要</a-tag>
|
||||||
<span>{{ item.title }}</span>
|
<span>{{ item.title }}</span>
|
||||||
</template>
|
</template>
|
||||||
@ -69,189 +67,192 @@
|
|||||||
</a-spin>
|
</a-spin>
|
||||||
</template>
|
</template>
|
||||||
</a-popover>
|
</a-popover>
|
||||||
<MessageDetailModal ref="messageDetailModalRef" @refresh="queryMessage" />
|
<MessageDetailModal ref="messageDetailModalRef" @refresh="queryMessage"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref } from 'vue';
|
import {computed, ref} from 'vue';
|
||||||
import { BellOutlined } from '@ant-design/icons-vue';
|
import {BellOutlined} from '@ant-design/icons-vue';
|
||||||
import { useUserStore } from '/@/store/modules/system/user.js';
|
import {useUserStore} from '/@/store/modules/system/user.js';
|
||||||
import { smartSentry } from '/@/lib/smart-sentry.js';
|
import {smartSentry} from '/@/lib/smart-sentry.js';
|
||||||
import { messageApi } from '/@/api/support/message-api.js';
|
import {messageApi} from '/@/api/support/message-api.js';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { theme } from 'ant-design-vue';
|
import {theme} from 'ant-design-vue';
|
||||||
import { useRouter } from 'vue-router';
|
import {useRouter} from 'vue-router';
|
||||||
import MessageDetailModal from './header-message-detail-modal.vue';
|
import MessageDetailModal from './header-message-detail-modal.vue';
|
||||||
import localKey from '/@/constants/local-storage-key-const';
|
import localKey from '/@/constants/local-storage-key-const';
|
||||||
import { localRead } from '/@/utils/local-util';
|
import {localRead} from '/@/utils/local-util';
|
||||||
|
|
||||||
const { useToken } = theme;
|
const {useToken} = theme;
|
||||||
const { token } = useToken();
|
const {token} = useToken();
|
||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const show = ref(false);
|
const show = ref(false);
|
||||||
|
|
||||||
// 点击按钮打开消息气泡卡片的同时刷新消息
|
// 点击按钮打开消息气泡卡片的同时刷新消息
|
||||||
function showMessage() {
|
function showMessage() {
|
||||||
show.value = true;
|
show.value = true;
|
||||||
queryMessage();
|
queryMessage();
|
||||||
loadToBeDoneList();
|
loadToBeDoneList();
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeMessage() {
|
||||||
|
show.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------- 查询消息 -------------------------
|
||||||
|
|
||||||
|
// 未读消息
|
||||||
|
const unreadMessageCount = computed(() => {
|
||||||
|
return useUserStore().unreadMessageCount;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 消息列表
|
||||||
|
const messageList = ref([]);
|
||||||
|
|
||||||
|
// 查询我的未读消息
|
||||||
|
async function queryMessage() {
|
||||||
|
try {
|
||||||
|
loading.value = true;
|
||||||
|
let responseModel = await messageApi.queryMessage({
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 3,
|
||||||
|
readFlag: false,
|
||||||
|
});
|
||||||
|
messageList.value = responseModel.data.list;
|
||||||
|
// 若中途有新消息了 打开列表也能及时更新未读数量
|
||||||
|
useUserStore().queryUnreadMessageCount();
|
||||||
|
} catch (e) {
|
||||||
|
smartSentry.captureError(e);
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function closeMessage() {
|
const messageDetailModalRef = ref();
|
||||||
show.value = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------- 查询消息 -------------------------
|
function showMessageDetail(data) {
|
||||||
|
messageDetailModalRef.value.show(data);
|
||||||
|
closeMessage();
|
||||||
|
}
|
||||||
|
|
||||||
// 未读消息
|
const router = useRouter();
|
||||||
const unreadMessageCount = computed(() => {
|
|
||||||
return useUserStore().unreadMessageCount;
|
|
||||||
});
|
|
||||||
|
|
||||||
// 消息列表
|
function gotoMessage() {
|
||||||
const messageList = ref([]);
|
show.value = false;
|
||||||
|
router.push({path: '/account', query: {menuId: 'message'}});
|
||||||
|
}
|
||||||
|
|
||||||
// 查询我的未读消息
|
// ------------------------- 待办工作 -------------------------
|
||||||
async function queryMessage() {
|
|
||||||
try {
|
// 待办工作数
|
||||||
loading.value = true;
|
const toBeDoneCount = computed(() => {
|
||||||
let responseModel = await messageApi.queryMessage({
|
return useUserStore().toBeDoneCount;
|
||||||
pageNum: 1,
|
});
|
||||||
pageSize: 3,
|
|
||||||
readFlag: false,
|
// 待办工作列表
|
||||||
});
|
const toBeDoneList = ref([]);
|
||||||
messageList.value = responseModel.data.list;
|
|
||||||
// 若中途有新消息了 打开列表也能及时更新未读数量
|
const loadToBeDoneList = async () => {
|
||||||
useUserStore().queryUnreadMessageCount();
|
try {
|
||||||
} catch (e) {
|
loading.value = true;
|
||||||
smartSentry.captureError(e);
|
let localToBeDoneList = localRead(localKey.TO_BE_DONE);
|
||||||
} finally {
|
if (localToBeDoneList) {
|
||||||
loading.value = false;
|
toBeDoneList.value = JSON.parse(localToBeDoneList).filter((e) => !e.doneFlag);
|
||||||
}
|
}
|
||||||
|
} catch (err) {
|
||||||
|
smartSentry.captureError(err);
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const messageDetailModalRef = ref();
|
// ------------------------- 时间计算 -------------------------
|
||||||
function showMessageDetail(data) {
|
function timeago(dateStr) {
|
||||||
messageDetailModalRef.value.show(data);
|
let dateTimeStamp = dayjs(dateStr).toDate().getTime();
|
||||||
|
let result = '';
|
||||||
|
let minute = 1000 * 60; //把分,时,天,周,半个月,一个月用毫秒表示
|
||||||
|
let hour = minute * 60;
|
||||||
|
let day = hour * 24;
|
||||||
|
let week = day * 7;
|
||||||
|
let month = day * 30;
|
||||||
|
let now = new Date().getTime(); //获取当前时间毫秒
|
||||||
|
let diffValue = now - dateTimeStamp; //时间差
|
||||||
|
|
||||||
|
if (diffValue < 0) {
|
||||||
|
return '刚刚';
|
||||||
}
|
}
|
||||||
|
let minC = diffValue / minute; //计算时间差的分,时,天,周,月
|
||||||
const router = useRouter();
|
let hourC = diffValue / hour;
|
||||||
function gotoMessage() {
|
let dayC = diffValue / day;
|
||||||
show.value = false;
|
let weekC = diffValue / week;
|
||||||
router.push({ path: '/account', query: { menuId: 'message' } });
|
let monthC = diffValue / month;
|
||||||
}
|
if (monthC >= 1 && monthC <= 3) {
|
||||||
|
result = ' ' + parseInt(monthC) + '月前';
|
||||||
// ------------------------- 待办工作 -------------------------
|
} else if (weekC >= 1 && weekC <= 3) {
|
||||||
|
result = ' ' + parseInt(weekC) + '周前';
|
||||||
// 待办工作数
|
} else if (dayC >= 1 && dayC <= 6) {
|
||||||
const toBeDoneCount = computed(() => {
|
result = ' ' + parseInt(dayC) + '天前';
|
||||||
return useUserStore().toBeDoneCount;
|
} else if (hourC >= 1 && hourC <= 23) {
|
||||||
});
|
result = ' ' + parseInt(hourC) + '小时前';
|
||||||
|
} else if (minC >= 1 && minC <= 59) {
|
||||||
// 待办工作列表
|
result = ' ' + parseInt(minC) + '分钟前';
|
||||||
const toBeDoneList = ref([]);
|
} else if (diffValue >= 0 && diffValue <= minute) {
|
||||||
|
result = '刚刚';
|
||||||
const loadToBeDoneList = async () => {
|
} else {
|
||||||
try {
|
let datetime = new Date();
|
||||||
loading.value = true;
|
datetime.setTime(dateTimeStamp);
|
||||||
let localToBeDoneList = localRead(localKey.TO_BE_DONE);
|
let year = datetime.getFullYear();
|
||||||
if (localToBeDoneList) {
|
let month = datetime.getMonth() + 1 < 10 ? '0' + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
|
||||||
toBeDoneList.value = JSON.parse(localToBeDoneList).filter((e) => !e.doneFlag);
|
let date = datetime.getDate() < 10 ? '0' + datetime.getDate() : datetime.getDate();
|
||||||
}
|
result = year + '-' + month + '-' + date;
|
||||||
} catch (err) {
|
|
||||||
smartSentry.captureError(err);
|
|
||||||
} finally {
|
|
||||||
loading.value = false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// ------------------------- 时间计算 -------------------------
|
|
||||||
function timeago(dateStr) {
|
|
||||||
let dateTimeStamp = dayjs(dateStr).toDate().getTime();
|
|
||||||
let result = '';
|
|
||||||
let minute = 1000 * 60; //把分,时,天,周,半个月,一个月用毫秒表示
|
|
||||||
let hour = minute * 60;
|
|
||||||
let day = hour * 24;
|
|
||||||
let week = day * 7;
|
|
||||||
let month = day * 30;
|
|
||||||
let now = new Date().getTime(); //获取当前时间毫秒
|
|
||||||
let diffValue = now - dateTimeStamp; //时间差
|
|
||||||
|
|
||||||
if (diffValue < 0) {
|
|
||||||
return '刚刚';
|
|
||||||
}
|
|
||||||
let minC = diffValue / minute; //计算时间差的分,时,天,周,月
|
|
||||||
let hourC = diffValue / hour;
|
|
||||||
let dayC = diffValue / day;
|
|
||||||
let weekC = diffValue / week;
|
|
||||||
let monthC = diffValue / month;
|
|
||||||
if (monthC >= 1 && monthC <= 3) {
|
|
||||||
result = ' ' + parseInt(monthC) + '月前';
|
|
||||||
} else if (weekC >= 1 && weekC <= 3) {
|
|
||||||
result = ' ' + parseInt(weekC) + '周前';
|
|
||||||
} else if (dayC >= 1 && dayC <= 6) {
|
|
||||||
result = ' ' + parseInt(dayC) + '天前';
|
|
||||||
} else if (hourC >= 1 && hourC <= 23) {
|
|
||||||
result = ' ' + parseInt(hourC) + '小时前';
|
|
||||||
} else if (minC >= 1 && minC <= 59) {
|
|
||||||
result = ' ' + parseInt(minC) + '分钟前';
|
|
||||||
} else if (diffValue >= 0 && diffValue <= minute) {
|
|
||||||
result = '刚刚';
|
|
||||||
} else {
|
|
||||||
let datetime = new Date();
|
|
||||||
datetime.setTime(dateTimeStamp);
|
|
||||||
let year = datetime.getFullYear();
|
|
||||||
let month = datetime.getMonth() + 1 < 10 ? '0' + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
|
|
||||||
let date = datetime.getDate() < 10 ? '0' + datetime.getDate() : datetime.getDate();
|
|
||||||
result = year + '-' + month + '-' + date;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
@smart-page-tag-operate-width: 40px;
|
@smart-page-tag-operate-width: 40px;
|
||||||
@color-primary: v-bind('token.colorPrimary');
|
@color-primary: v-bind('token.colorPrimary');
|
||||||
|
|
||||||
.message-icon-div {
|
.message-icon-div {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
width: 42px;
|
width: 42px;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
}
|
}
|
||||||
.message-icon-div:hover {
|
|
||||||
background: @hover-bg-color !important;
|
.message-icon-div:hover {
|
||||||
|
background: @hover-bg-color !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-notice {
|
||||||
|
display: inline-block;
|
||||||
|
transition: all 0.3s;
|
||||||
|
|
||||||
|
span {
|
||||||
|
vertical-align: initial;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-notice {
|
.notice-badge {
|
||||||
display: inline-block;
|
color: inherit;
|
||||||
transition: all 0.3s;
|
|
||||||
|
|
||||||
span {
|
|
||||||
vertical-align: initial;
|
|
||||||
}
|
|
||||||
|
|
||||||
.notice-badge {
|
|
||||||
color: inherit;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdown-tabs {
|
.dropdown-tabs {
|
||||||
background-color: @base-bg-color;
|
background-color: @base-bg-color;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-pane {
|
.tab-pane {
|
||||||
height: 250px;
|
height: auto;
|
||||||
overflow-y: auto;
|
}
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -10,13 +10,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-space :size="10">
|
<a-space :size="10">
|
||||||
<div class="setting">
|
<div class="setting">
|
||||||
<a-input-search
|
|
||||||
@click="search"
|
|
||||||
style="margin-right: 30px; width: 250px"
|
|
||||||
placeholder="搜索:六边形工程师、1024"
|
|
||||||
enter-button="搜索"
|
|
||||||
size="small"
|
|
||||||
/>
|
|
||||||
<!---消息通知--->
|
<!---消息通知--->
|
||||||
<HeaderMessage ref="headerMessage" />
|
<HeaderMessage ref="headerMessage" />
|
||||||
<!---国际化--->
|
<!---国际化--->
|
||||||
@ -70,11 +63,6 @@
|
|||||||
return useAppConfigStore().helpDocExpandFlag;
|
return useAppConfigStore().helpDocExpandFlag;
|
||||||
});
|
});
|
||||||
|
|
||||||
//搜索
|
|
||||||
function search() {
|
|
||||||
window.open('https://1024lab.net');
|
|
||||||
}
|
|
||||||
|
|
||||||
const { useToken } = theme;
|
const { useToken } = theme;
|
||||||
const { token } = useToken();
|
const { token } = useToken();
|
||||||
</script>
|
</script>
|
||||||
|
@ -120,7 +120,6 @@ export const useUserStore = defineStore({
|
|||||||
this.token = '';
|
this.token = '';
|
||||||
this.menuList = [];
|
this.menuList = [];
|
||||||
this.tagNav = [];
|
this.tagNav = [];
|
||||||
this.userInfo = {};
|
|
||||||
this.unreadMessageCount = 0;
|
this.unreadMessageCount = 0;
|
||||||
localRemove(localKey.USER_TOKEN);
|
localRemove(localKey.USER_TOKEN);
|
||||||
localRemove(localKey.USER_POINTS);
|
localRemove(localKey.USER_POINTS);
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
<!--
|
<!--
|
||||||
* 代码生成 配置信息
|
* 代码生成 配置信息
|
||||||
*
|
*
|
||||||
* @Author: 1024创新实验室-主任:卓大
|
* @Author: 1024创新实验室-主任:卓大
|
||||||
* @Date: 2022-09-22 21:50:41
|
* @Date: 2022-09-22 21:50:41
|
||||||
* @Wechat: zhuda1024
|
* @Wechat: zhuda1024
|
||||||
* @Email: lab1024@163.com
|
* @Email: lab1024@163.com
|
||||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<a-drawer
|
<a-drawer
|
||||||
title="代码配置"
|
title="代码配置"
|
||||||
style=""
|
style=""
|
||||||
:open="visibleFlag"
|
:open="visibleFlag"
|
||||||
:width="1500"
|
:width="1200"
|
||||||
:footerStyle="{ textAlign: 'right' }"
|
:footerStyle="{ textAlign: 'right' }"
|
||||||
@close="onClose"
|
@close="onClose"
|
||||||
:maskClosable="false"
|
:maskClosable="false"
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
<!--
|
<!--
|
||||||
* 代码生成 预览代码
|
* 代码生成 预览代码
|
||||||
*
|
*
|
||||||
* @Author: 1024创新实验室-主任:卓大
|
* @Author: 1024创新实验室-主任:卓大
|
||||||
* @Date: 2022-09-22 21:50:41
|
* @Date: 2022-09-22 21:50:41
|
||||||
* @Wechat: zhuda1024
|
* @Wechat: zhuda1024
|
||||||
* @Email: lab1024@163.com
|
* @Email: lab1024@163.com
|
||||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<a-drawer
|
<a-drawer
|
||||||
title="代码预览"
|
title="代码预览"
|
||||||
:open="visibleFlag"
|
:open="visibleFlag"
|
||||||
:width="1500"
|
:width="1200"
|
||||||
:footerStyle="{ textAlign: 'right' }"
|
:footerStyle="{ textAlign: 'right' }"
|
||||||
:bodyStyle="{ padding: '8px 24px' }"
|
:bodyStyle="{ padding: '8px 24px' }"
|
||||||
@close="onClose"
|
@close="onClose"
|
||||||
|
@ -159,6 +159,7 @@
|
|||||||
title: '邮箱',
|
title: '邮箱',
|
||||||
dataIndex: 'email',
|
dataIndex: 'email',
|
||||||
width: 100,
|
width: 100,
|
||||||
|
ellipsis: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '超管',
|
title: '超管',
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user