mirror of
				https://gitee.com/lab1024/smart-admin.git
				synced 2025-11-04 02:13:42 +08:00 
			
		
		
		
	v3.6.0 三级等保重磅更新:1、【新增】双因子方式登录;2、【新增】定期修改密码;3、【新增】最大活跃时间;4、【新增】敏感数据脱敏;5、【新增】登录锁定配置;6、【新增】密码复杂度配置;7、【新增】三级等保可配置
This commit is contained in:
		@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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认证密码
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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}/
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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'
 | 
			
		||||
 
 | 
			
		||||
@@ -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列表
 | 
			
		||||
 
 | 
			
		||||
@@ -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>
 | 
			
		||||
 
 | 
			
		||||
@@ -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,189 +67,192 @@
 | 
			
		||||
        </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() {
 | 
			
		||||
    show.value = true;
 | 
			
		||||
    queryMessage();
 | 
			
		||||
    loadToBeDoneList();
 | 
			
		||||
// 点击按钮打开消息气泡卡片的同时刷新消息
 | 
			
		||||
function showMessage() {
 | 
			
		||||
  show.value = true;
 | 
			
		||||
  queryMessage();
 | 
			
		||||
  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() {
 | 
			
		||||
    show.value = false;
 | 
			
		||||
  }
 | 
			
		||||
const messageDetailModalRef = ref();
 | 
			
		||||
 | 
			
		||||
  // ------------------------- 查询消息  -------------------------
 | 
			
		||||
function showMessageDetail(data) {
 | 
			
		||||
  messageDetailModalRef.value.show(data);
 | 
			
		||||
  closeMessage();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
  // 未读消息
 | 
			
		||||
  const unreadMessageCount = computed(() => {
 | 
			
		||||
    return useUserStore().unreadMessageCount;
 | 
			
		||||
  });
 | 
			
		||||
const router = useRouter();
 | 
			
		||||
 | 
			
		||||
  // 消息列表
 | 
			
		||||
  const messageList = ref([]);
 | 
			
		||||
function gotoMessage() {
 | 
			
		||||
  show.value = false;
 | 
			
		||||
  router.push({path: '/account', query: {menuId: 'message'}});
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
  // 查询我的未读消息
 | 
			
		||||
  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;
 | 
			
		||||
// ------------------------- 待办工作  -------------------------
 | 
			
		||||
 | 
			
		||||
// 待办工作数
 | 
			
		||||
const toBeDoneCount = computed(() => {
 | 
			
		||||
  return useUserStore().toBeDoneCount;
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
// 待办工作列表
 | 
			
		||||
const toBeDoneList = ref([]);
 | 
			
		||||
 | 
			
		||||
const loadToBeDoneList = async () => {
 | 
			
		||||
  try {
 | 
			
		||||
    loading.value = true;
 | 
			
		||||
    let localToBeDoneList = localRead(localKey.TO_BE_DONE);
 | 
			
		||||
    if (localToBeDoneList) {
 | 
			
		||||
      toBeDoneList.value = JSON.parse(localToBeDoneList).filter((e) => !e.doneFlag);
 | 
			
		||||
    }
 | 
			
		||||
  } catch (err) {
 | 
			
		||||
    smartSentry.captureError(err);
 | 
			
		||||
  } finally {
 | 
			
		||||
    loading.value = false;
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
  const messageDetailModalRef = ref();
 | 
			
		||||
  function showMessageDetail(data) {
 | 
			
		||||
    messageDetailModalRef.value.show(data);
 | 
			
		||||
// ------------------------- 时间计算  -------------------------
 | 
			
		||||
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 '刚刚';
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  const router = useRouter();
 | 
			
		||||
  function gotoMessage() {
 | 
			
		||||
    show.value = false;
 | 
			
		||||
    router.push({ path: '/account', query: { menuId: 'message' } });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // ------------------------- 待办工作  -------------------------
 | 
			
		||||
 | 
			
		||||
  // 待办工作数
 | 
			
		||||
  const toBeDoneCount = computed(() => {
 | 
			
		||||
    return useUserStore().toBeDoneCount;
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  // 待办工作列表
 | 
			
		||||
  const toBeDoneList = ref([]);
 | 
			
		||||
 | 
			
		||||
  const loadToBeDoneList = async () => {
 | 
			
		||||
    try {
 | 
			
		||||
      loading.value = true;
 | 
			
		||||
      let localToBeDoneList = localRead(localKey.TO_BE_DONE);
 | 
			
		||||
      if (localToBeDoneList) {
 | 
			
		||||
        toBeDoneList.value = JSON.parse(localToBeDoneList).filter((e) => !e.doneFlag);
 | 
			
		||||
      }
 | 
			
		||||
    } 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;
 | 
			
		||||
  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;
 | 
			
		||||
}
 | 
			
		||||
</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 {
 | 
			
		||||
    cursor: pointer;
 | 
			
		||||
    height: 32px;
 | 
			
		||||
    width: 42px;
 | 
			
		||||
    padding-left: 10px;
 | 
			
		||||
  }
 | 
			
		||||
  .message-icon-div:hover {
 | 
			
		||||
    background: @hover-bg-color !important;
 | 
			
		||||
.message-icon-div {
 | 
			
		||||
  cursor: pointer;
 | 
			
		||||
  height: 32px;
 | 
			
		||||
  width: 42px;
 | 
			
		||||
  padding-left: 10px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.message-icon-div:hover {
 | 
			
		||||
  background: @hover-bg-color !important;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.header-notice {
 | 
			
		||||
  display: inline-block;
 | 
			
		||||
  transition: all 0.3s;
 | 
			
		||||
 | 
			
		||||
  span {
 | 
			
		||||
    vertical-align: initial;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  .header-notice {
 | 
			
		||||
    display: inline-block;
 | 
			
		||||
    transition: all 0.3s;
 | 
			
		||||
 | 
			
		||||
    span {
 | 
			
		||||
      vertical-align: initial;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .notice-badge {
 | 
			
		||||
      color: inherit;
 | 
			
		||||
    }
 | 
			
		||||
  .notice-badge {
 | 
			
		||||
    color: inherit;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
  .title {
 | 
			
		||||
    white-space: nowrap;
 | 
			
		||||
    overflow: hidden;
 | 
			
		||||
    text-overflow: ellipsis;
 | 
			
		||||
    cursor: pointer;
 | 
			
		||||
  }
 | 
			
		||||
.title {
 | 
			
		||||
  white-space: nowrap;
 | 
			
		||||
  overflow: hidden;
 | 
			
		||||
  text-overflow: ellipsis;
 | 
			
		||||
  cursor: pointer;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
  .dropdown-tabs {
 | 
			
		||||
    background-color: @base-bg-color;
 | 
			
		||||
    border-radius: 4px;
 | 
			
		||||
  }
 | 
			
		||||
.dropdown-tabs {
 | 
			
		||||
  background-color: @base-bg-color;
 | 
			
		||||
  border-radius: 4px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
  .tab-pane {
 | 
			
		||||
    height: 250px;
 | 
			
		||||
    overflow-y: auto;
 | 
			
		||||
  }
 | 
			
		||||
.tab-pane {
 | 
			
		||||
  height: auto;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -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>
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
 
 | 
			
		||||
@@ -1,18 +1,18 @@
 | 
			
		||||
<!--
 | 
			
		||||
  * 代码生成 配置信息
 | 
			
		||||
  * 
 | 
			
		||||
  * @Author:    1024创新实验室-主任:卓大 
 | 
			
		||||
  * @Date:      2022-09-22 21:50:41 
 | 
			
		||||
  * @Wechat:    zhuda1024 
 | 
			
		||||
  * @Email:     lab1024@163.com 
 | 
			
		||||
  * @Copyright  1024创新实验室 ( https://1024lab.net ),Since 2012 
 | 
			
		||||
  *
 | 
			
		||||
  * @Author:    1024创新实验室-主任:卓大
 | 
			
		||||
  * @Date:      2022-09-22 21:50:41
 | 
			
		||||
  * @Wechat:    zhuda1024
 | 
			
		||||
  * @Email:     lab1024@163.com
 | 
			
		||||
  * @Copyright  1024创新实验室 ( https://1024lab.net ),Since 2012
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <a-drawer
 | 
			
		||||
    title="代码配置"
 | 
			
		||||
    style=""
 | 
			
		||||
    :open="visibleFlag"
 | 
			
		||||
    :width="1500"
 | 
			
		||||
    :width="1200"
 | 
			
		||||
    :footerStyle="{ textAlign: 'right' }"
 | 
			
		||||
    @close="onClose"
 | 
			
		||||
    :maskClosable="false"
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,17 @@
 | 
			
		||||
<!--
 | 
			
		||||
  * 代码生成 预览代码
 | 
			
		||||
  * 
 | 
			
		||||
  * @Author:    1024创新实验室-主任:卓大 
 | 
			
		||||
  * @Date:      2022-09-22 21:50:41 
 | 
			
		||||
  * @Wechat:    zhuda1024 
 | 
			
		||||
  * @Email:     lab1024@163.com 
 | 
			
		||||
  * @Copyright  1024创新实验室 ( https://1024lab.net ),Since 2012 
 | 
			
		||||
  *
 | 
			
		||||
  * @Author:    1024创新实验室-主任:卓大
 | 
			
		||||
  * @Date:      2022-09-22 21:50:41
 | 
			
		||||
  * @Wechat:    zhuda1024
 | 
			
		||||
  * @Email:     lab1024@163.com
 | 
			
		||||
  * @Copyright  1024创新实验室 ( https://1024lab.net ),Since 2012
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <a-drawer
 | 
			
		||||
    title="代码预览"
 | 
			
		||||
    :open="visibleFlag"
 | 
			
		||||
    :width="1500"
 | 
			
		||||
    :width="1200"
 | 
			
		||||
    :footerStyle="{ textAlign: 'right' }"
 | 
			
		||||
    :bodyStyle="{ padding: '8px 24px' }"
 | 
			
		||||
    @close="onClose"
 | 
			
		||||
 
 | 
			
		||||
@@ -159,6 +159,7 @@
 | 
			
		||||
      title: '邮箱',
 | 
			
		||||
      dataIndex: 'email',
 | 
			
		||||
      width: 100,
 | 
			
		||||
      ellipsis: true,
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      title: '超管',
 | 
			
		||||
 
 | 
			
		||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Reference in New Issue
	
	Block a user