Kaynağa Gözat

feat:1.初始化

wangkun 6 gün önce
işleme
1985f6e51f
100 değiştirilmiş dosya ile 4862 ekleme ve 0 silme
  1. 13 0
      .docker-compose/nginx/conf.d/my.conf
  2. 10 0
      .env.development
  3. 11 0
      .env.production
  4. 26 0
      .env.ysf
  5. 4 0
      .eslintignore
  6. 256 0
      .eslintrc.js
  7. 8 0
      .gitignore
  8. 8 0
      .prettierrc.json
  9. 15 0
      Dockerfile
  10. 101 0
      README.md
  11. 8 0
      babel.config.js
  12. BIN
      favicon.ico
  13. 21 0
      index.html
  14. 10 0
      jsconfig.json
  15. 37 0
      limit.js
  16. 16 0
      loadEnv.js
  17. 23 0
      openDocument.js
  18. 77 0
      package.json
  19. 6 0
      postcss.config.js
  20. 16 0
      public/config.js
  21. 38 0
      src/App.vue
  22. 146 0
      src/api/api.js
  23. 85 0
      src/api/authority.js
  24. 27 0
      src/api/authorityBtn.js
  25. 142 0
      src/api/autoCode.js
  26. 43 0
      src/api/breakpoint.js
  27. 32 0
      src/api/casbin.js
  28. 31 0
      src/api/chatgpt.js
  29. 16 0
      src/api/config.js
  30. 80 0
      src/api/customer.js
  31. 14 0
      src/api/email.js
  32. 97 0
      src/api/exportTemplate.js
  33. 44 0
      src/api/fileUploadAndDownload.js
  34. 17 0
      src/api/github.js
  35. 81 0
      src/api/iam.js
  36. 26 0
      src/api/initdb.js
  37. 14 0
      src/api/jwt.js
  38. 23 0
      src/api/license.js
  39. 113 0
      src/api/menu.js
  40. 25 0
      src/api/sn.js
  41. 117 0
      src/api/sys/service.js
  42. 104 0
      src/api/sysApplication.js
  43. 80 0
      src/api/sysDictionary.js
  44. 80 0
      src/api/sysDictionaryDetail.js
  45. 48 0
      src/api/sysOperationRecord.js
  46. 42 0
      src/api/system.js
  47. 28 0
      src/api/upload.js
  48. 189 0
      src/api/user.js
  49. 0 0
      src/assets/background.svg
  50. BIN
      src/assets/banner.png
  51. BIN
      src/assets/dashboard.png
  52. BIN
      src/assets/docs.png
  53. BIN
      src/assets/flipped-aurora.png
  54. BIN
      src/assets/github.png
  55. 1 0
      src/assets/icons/customer-gva.svg
  56. BIN
      src/assets/kefu.png
  57. BIN
      src/assets/login_background.jpg
  58. 33 0
      src/assets/login_background.svg
  59. 10 0
      src/assets/login_left.svg
  60. BIN
      src/assets/login_right_banner.jpg
  61. BIN
      src/assets/logo.jpg
  62. BIN
      src/assets/logo.png
  63. BIN
      src/assets/logo_login.png
  64. BIN
      src/assets/nav_logo.png
  65. BIN
      src/assets/noBody.png
  66. BIN
      src/assets/notFound.png
  67. BIN
      src/assets/qm.png
  68. BIN
      src/assets/video.png
  69. 211 0
      src/components/chooseImg/index.vue
  70. 201 0
      src/components/commandMenu/index.vue
  71. 91 0
      src/components/customPic/index.vue
  72. 32 0
      src/components/exportExcel/exportExcel.vue
  73. 28 0
      src/components/exportExcel/exportTemplate.vue
  74. 37 0
      src/components/exportExcel/importExcel.vue
  75. 31 0
      src/components/office/docx.vue
  76. 36 0
      src/components/office/excel.vue
  77. 53 0
      src/components/office/index.vue
  78. 40 0
      src/components/office/pdf.vue
  79. 90 0
      src/components/richtext/rich-edit.vue
  80. 63 0
      src/components/richtext/rich-view.vue
  81. 82 0
      src/components/selectFile/selectFile.vue
  82. 512 0
      src/components/selectImage/selectImage.vue
  83. 33 0
      src/components/svgIcon/svgIcon.vue
  84. 57 0
      src/components/upload/CommonUpload.vue
  85. 76 0
      src/components/upload/common.vue
  86. 98 0
      src/components/upload/image.vue
  87. 35 0
      src/components/warningBar/warningBar.vue
  88. 36 0
      src/config/index.js
  89. 12 0
      src/core/config.js
  90. 12 0
      src/core/gin-vue-admin.js
  91. 45 0
      src/core/global.js
  92. 41 0
      src/directive/auth.js
  93. 23 0
      src/hooks/use-windows-resize.js
  94. 61 0
      src/main.js
  95. 125 0
      src/permission.js
  96. 7 0
      src/pinia/index.js
  97. 47 0
      src/pinia/modules/dictionary.js
  98. 18 0
      src/pinia/modules/license.js
  99. 26 0
      src/pinia/modules/paper.js
  100. 111 0
      src/pinia/modules/router.js

+ 13 - 0
.docker-compose/nginx/conf.d/my.conf

@@ -0,0 +1,13 @@
+# IAMHtml 前端 nginx 配置(Dockerfile 引用此文件)
+# 前端静态页面托管 + SPA 路由兜底;IAM 后端经 VITE_IAM_SERVER 直连,不走本代理
+server {
+    listen 80;
+    server_name _;
+
+    root /usr/share/nginx/html;
+    index index.html;
+
+    location / {
+        try_files $uri $uri/ /index.html;
+    }
+}

+ 10 - 0
.env.development

@@ -0,0 +1,10 @@
+ENV = 'development'
+VITE_CLI_PORT = 9056
+VITE_GVA_PORT = 8888
+VITE_BASE_API = /api
+VITE_FILE_API = /api
+VITE_BASE_PATH = http://10.10.10.30
+VITE_POSITION = close
+VITE_EDITOR = vscode
+# IAM 后端地址,本地开发连 10.10.10.66
+VITE_SERVER_PATH = http://10.10.10.88:9055

+ 11 - 0
.env.production

@@ -0,0 +1,11 @@
+ENV = 'production'
+
+VITE_CLI_PORT = 9056
+VITE_GVA_PORT = 8888
+VITE_BASE_API = /api
+VITE_FILE_API = /api
+VITE_BASE_PATH = http://10.10.10.30
+VITE_POSITION = close
+VITE_EDITOR = vscode
+# 后端地址
+VITE_SERVER_PATH = http://10.10.10.30:9055

+ 26 - 0
.env.ysf

@@ -0,0 +1,26 @@
+ENV = 'ysf'
+VITE_CLI_PORT = 8080
+VITE_SERVER_PORT = 8888
+VITE_BASE_API = /api
+VITE_FILE_API = /api
+VITE_BASE_PATH = http://172.16.48.29
+VITE_POSITION = close
+VITE_EDITOR = vscode
+// 业务端服务
+VITE_SERVICE_PATH = http://172.16.48.29
+VITE_SERVICE_PORT = 9200
+// 业务端WS
+VITE_WEBSOCKET_PATH = ws://172.16.48.29:9200
+VITE_QRCODE_BASE_PATH = http://172.16.48.29:9200 # 生成二维码接口调用的地址
+// 业务端邀请注册链接
+VITE_INVITE_BASE_PATH = "http://172.16.48.29:8080/#/user/register?code="
+// 学员端登录链接(需要启动学员端项目)
+VITE_STUDENT_LOGIN_PATH = "http://172.16.48.29:8070/#/login"
+// 视频切片统一后缀
+VITE_VIDEO_SUFFIX = "-style.m3u8"
+// 客户端标记
+VITE_USER_AGENT = "cms"
+
+// VITE_EDITOR = webstorm 如果使用webstorm开发且要使用dom定位到代码行功能 请先自定添加 webstorm到环境变量 再将VITE_EDITOR值修改为webstorm
+// 如果使用docker-compose开发模式,设置为下面的地址或本机主机IP
+//VITE_BASE_PATH = http://177.7.0.12

+ 4 - 0
.eslintignore

@@ -0,0 +1,4 @@
+build/*.js
+src/assets
+public
+dist

+ 256 - 0
.eslintrc.js

@@ -0,0 +1,256 @@
+module.exports = {
+  root: true,
+  parserOptions: {
+    parser: '@babel/eslint-parser',
+    sourceType: 'module'
+  },
+  env: {
+    browser: true,
+    node: true,
+    es6: true
+  },
+  extends: ['plugin:vue/recommended', 'eslint:recommended'],
+  rules: {
+    'vue/no-v-model-argument': 0,
+    'vue/max-attributes-per-line': 2,
+    'vue/singleline-html-element-content-newline': 'off',
+    'vue/multiline-html-element-content-newline': 'off',
+    'vue/multi-word-component-names': 'off',
+    'vue/no-v-html': 'off',
+    'accessor-pairs': 2,
+    'arrow-spacing': [
+      2,
+      {
+        before: true,
+        after: true
+      }
+    ],
+    'block-spacing': [2, 'always'],
+    'brace-style': [
+      2,
+      '1tbs',
+      {
+        allowSingleLine: true
+      }
+    ],
+    camelcase: [
+      0,
+      {
+        properties: 'always'
+      }
+    ],
+    'comma-dangle': [2, 'only-multiline'],
+    'comma-spacing': [
+      2,
+      {
+        before: false,
+        after: true
+      }
+    ],
+    'comma-style': [2, 'last'],
+    'constructor-super': 2,
+    curly: [2, 'multi-line'],
+    'dot-location': [2, 'property'],
+    'eol-last': 2,
+    eqeqeq: ['error', 'always', { null: 'ignore' }],
+    'generator-star-spacing': [
+      2,
+      {
+        before: true,
+        after: true
+      }
+    ],
+    'handle-callback-err': [2, '^(err|error)$'],
+    indent: [
+      2,
+      2,
+      {
+        SwitchCase: 1
+      }
+    ],
+    'jsx-quotes': [2, 'prefer-single'],
+    'key-spacing': [
+      2,
+      {
+        beforeColon: false,
+        afterColon: true
+      }
+    ],
+    'keyword-spacing': [
+      2,
+      {
+        before: true,
+        after: true
+      }
+    ],
+    'new-cap': [
+      2,
+      {
+        newIsCap: true,
+        capIsNew: false
+      }
+    ],
+    'new-parens': 2,
+    'no-array-constructor': 2,
+    'no-caller': 2,
+    'no-console': 'off',
+    'no-class-assign': 2,
+    'no-cond-assign': 2,
+    'no-const-assign': 2,
+    'no-control-regex': 0,
+    'no-delete-var': 2,
+    'no-dupe-args': 2,
+    'no-dupe-class-members': 2,
+    'no-dupe-keys': 2,
+    'no-duplicate-case': 2,
+    'no-empty-character-class': 2,
+    'no-empty-pattern': 2,
+    'no-eval': 2,
+    'no-ex-assign': 2,
+    'no-extend-native': 2,
+    'no-extra-bind': 2,
+    'no-extra-boolean-cast': 2,
+    'no-extra-parens': [2, 'functions'],
+    'no-fallthrough': 2,
+    'no-floating-decimal': 2,
+    'no-func-assign': 2,
+    'no-implied-eval': 2,
+    'no-inner-declarations': [2, 'functions'],
+    'no-invalid-regexp': 2,
+    'no-irregular-whitespace': 2,
+    'no-iterator': 2,
+    'no-label-var': 2,
+    'no-labels': [
+      2,
+      {
+        allowLoop: false,
+        allowSwitch: false
+      }
+    ],
+    'no-lone-blocks': 2,
+    'no-mixed-spaces-and-tabs': 2,
+    'no-multi-spaces': 2,
+    'no-multi-str': 2,
+    'no-multiple-empty-lines': [
+      2,
+      {
+        max: 1
+      }
+    ],
+    'no-native-reassign': 2,
+    'no-negated-in-lhs': 2,
+    'no-new-object': 2,
+    'no-new-require': 2,
+    'no-new-symbol': 2,
+    'no-new-wrappers': 2,
+    'no-obj-calls': 2,
+    'no-octal': 2,
+    'no-octal-escape': 2,
+    'no-path-concat': 2,
+    'no-proto': 2,
+    'no-redeclare': 2,
+    'no-regex-spaces': 2,
+    'no-return-assign': [2, 'except-parens'],
+    'no-self-assign': 2,
+    'no-self-compare': 2,
+    'no-sequences': 2,
+    'no-shadow-restricted-names': 2,
+    'no-spaced-func': 2,
+    'no-sparse-arrays': 2,
+    'no-this-before-super': 2,
+    'no-throw-literal': 2,
+    'no-trailing-spaces': 2,
+    'no-undef': 'off',
+    'no-undef-init': 2,
+    'no-unexpected-multiline': 2,
+    'no-unmodified-loop-condition': 2,
+    'no-unneeded-ternary': [
+      2,
+      {
+        defaultAssignment: false
+      }
+    ],
+    'no-unreachable': 2,
+    'no-unsafe-finally': 2,
+    'no-unused-vars': [
+      2,
+      {
+        vars: 'all',
+        args: 'none'
+      }
+    ],
+    'no-useless-call': 2,
+    'no-useless-computed-key': 2,
+    'no-useless-constructor': 2,
+    'no-useless-escape': 0,
+    'no-whitespace-before-property': 2,
+    'no-with': 2,
+    'one-var': [
+      2,
+      {
+        initialized: 'never'
+      }
+    ],
+    'operator-linebreak': [
+      2,
+      'after',
+      {
+        overrides: {
+          '?': 'before',
+          ':': 'before'
+        }
+      }
+    ],
+    'padded-blocks': [2, 'never'],
+    quotes: [
+      2,
+      'single',
+      {
+        avoidEscape: true,
+        allowTemplateLiterals: true
+      }
+    ],
+    semi: [2, 'never'],
+    'semi-spacing': [
+      2,
+      {
+        before: false,
+        after: true
+      }
+    ],
+    'space-before-blocks': [2, 'always'],
+    'space-before-function-paren': [2, 'never'],
+    'space-in-parens': [2, 'never'],
+    'space-infix-ops': 2,
+    'space-unary-ops': [
+      2,
+      {
+        words: true,
+        nonwords: false
+      }
+    ],
+    'spaced-comment': [
+      2,
+      'always',
+      {
+        markers: ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
+      }
+    ],
+    'template-curly-spacing': [2, 'never'],
+    'use-isnan': 2,
+    'valid-typeof': 2,
+    'wrap-iife': [2, 'any'],
+    'yield-star-spacing': [2, 'both'],
+    yoda: [2, 'never'],
+    'prefer-const': 2,
+    'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
+    'object-curly-spacing': [
+      2,
+      'always',
+      {
+        objectsInObjects: false
+      }
+    ],
+    'array-bracket-spacing': [2, 'never']
+  }
+}

+ 8 - 0
.gitignore

@@ -0,0 +1,8 @@
+node_modules/*
+package-lock.json
+yarn.lock
+.idea
+dist/
+dist.zip
+/node_modules/
+/.dockerignore

+ 8 - 0
.prettierrc.json

@@ -0,0 +1,8 @@
+{
+  "semi": false,
+  "singleQuote": true,
+  "bracketSpacing": true,
+  "trailingComma":"none",
+  "arrowParens": "avoid"
+}
+

+ 15 - 0
Dockerfile

@@ -0,0 +1,15 @@
+FROM node:16
+
+WORKDIR /gva_web/
+COPY . .
+
+RUN yarn && yarn build
+
+FROM nginx:alpine
+LABEL MAINTAINER="SliverHorn@sliver_horn@qq.com"
+
+COPY .docker-compose/nginx/conf.d/my.conf /etc/nginx/conf.d/my.conf
+COPY --from=0 /gva_web/dist /usr/share/nginx/html
+RUN cat /etc/nginx/nginx.conf
+RUN cat /etc/nginx/conf.d/my.conf
+RUN ls -al /usr/share/nginx/html

+ 101 - 0
README.md

@@ -0,0 +1,101 @@
+# gin-vue-admin web 
+
+## Project setup
+```
+npm install
+```
+
+### Compiles and hot-reloads for development
+```
+npm run serve
+```
+
+### Compiles and minifies for production
+```
+npm run build
+```
+
+### Run your tests
+```
+npm run test
+```
+
+### Lints and fixes files
+```
+npm run lint
+```
+
+
+整理代码结构
+``` lua
+web
+ ├── babel.config.js
+ ├── Dockerfile
+ ├── favicon.ico
+ ├── index.html                 -- 主页面
+ ├── limit.js                   -- 助手代码
+ ├── package.json               -- 包管理器代码
+ ├── src                        -- 源代码
+ │   ├── api                    -- api 组
+ │   ├── App.vue                -- 主页面
+ │   ├── assets                 -- 静态资源
+ │   ├── components             -- 全局组件
+ │   ├── core                   -- gva 组件包
+ │   │   ├── config.js          -- gva网站配置文件
+ │   │   ├── gin-vue-admin.js   -- 注册欢迎文件
+ │   │   └── global.js          -- 统一导入文件
+ │   ├── directive              -- v-auth 注册文件
+ │   ├── main.js                -- 主文件
+ │   ├── permission.js          -- 路由中间件
+ │   ├── pinia                  -- pinia 状态管理器,取代vuex
+ │   │   ├── index.js           -- 入口文件
+ │   │   └── modules            -- modules
+ │   │       ├── dictionary.js
+ │   │       ├── router.js
+ │   │       └── user.js
+ │   ├── router                 -- 路由声明文件
+ │   │   └── index.js
+ │   ├── style                  -- 全局样式
+ │   │   ├── base.scss
+ │   │   ├── basics.scss
+ │   │   ├── element_visiable.scss  -- 此处可以全局覆盖 element-plus 样式
+ │   │   ├── iconfont.css           -- 顶部几个icon的样式文件
+ │   │   ├── main.scss
+ │   │   ├── mobile.scss
+ │   │   └── newLogin.scss
+ │   ├── utils                  -- 方法包库
+ │   │   ├── asyncRouter.js     -- 动态路由相关
+ │   │   ├── bus.js             -- 全局mitt声明文件
+ │   │   ├── date.js            -- 日期相关
+ │   │   ├── dictionary.js      -- 获取字典方法 
+ │   │   ├── downloadImg.js     -- 下载图片方法
+ │   │   ├── format.js          -- 格式整理相关
+ │   │   ├── image.js           -- 图片相关方法
+ │   │   ├── page.js            -- 设置页面标题
+ │   │   ├── request.js         -- 请求
+ │   │   └── stringFun.js       -- 字符串文件
+ |   ├── view -- 主要view代码
+ |   |   ├── about -- 关于我们
+ |   |   ├── dashboard -- 面板
+ |   |   ├── error -- 错误
+ |   |   ├── example --上传案例
+ |   |   ├── iconList -- icon列表
+ |   |   ├── init -- 初始化数据  
+ |   |   |   ├── index -- 新版本
+ |   |   |   ├── init -- 旧版本
+ |   |   ├── layout  --  layout约束页面 
+ |   |   |   ├── aside 
+ |   |   |   ├── bottomInfo     -- bottomInfo
+ |   |   |   ├── screenfull     -- 全屏设置
+ |   |   |   ├── setting        -- 系统设置
+ |   |   |   └── index.vue      -- base 约束
+ |   |   ├── login              --登录 
+ |   |   ├── person             --个人中心 
+ |   |   ├── superAdmin         -- 超级管理员操作
+ |   |   ├── system             -- 系统检测页面
+ |   |   ├── systemTools        -- 系统配置相关页面
+ |   |   └── routerHolder.vue   -- page 入口页面 
+ ├── vite.config.js             -- vite 配置文件
+ └── yarn.lock
+
+```

+ 8 - 0
babel.config.js

@@ -0,0 +1,8 @@
+module.exports = {
+  presets: [
+
+  ],
+  'plugins': [
+
+  ]
+}

BIN
favicon.ico


+ 21 - 0
index.html

@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="zh-cn">
+
+<head>
+  <meta charset="utf-8">
+  <meta content="IE=edge" http-equiv="X-UA-Compatible">
+  <meta content="width=device-width,initial-scale=1.0" name="viewport">
+  <meta
+    content="Gin,Vue,Admin.Gin-Vue-Admin,GVA,gin-vue-admin,后台管理框架,vue后台管理框架,gin-vue-admin文档,gin-vue-admin首页,gin-vue-admin"
+    name="keywords" />
+  <link href="src/assets/logo.png" rel="icon">
+  <title></title>
+</head>
+
+<body>
+<div id="app"></div>
+<script src="/config.js"></script>
+<script src="./src/main.js" type="module"></script>
+</body>
+
+</html>

+ 10 - 0
jsconfig.json

@@ -0,0 +1,10 @@
+{
+    "compilerOptions": {
+      "baseUrl": "./",
+      "paths": {
+        "@/*": ["src/*"],
+      }
+    },
+    "exclude": ["node_modules", "dist"],
+    "include": ["src/**/*"]
+  }

+ 37 - 0
limit.js

@@ -0,0 +1,37 @@
+// 运行项目前通过node执行此脚本 (此脚本与 node_modules 目录同级)
+const fs = require('fs')
+const path = require('path')
+const wfPath = path.resolve(__dirname, './node_modules/.bin')
+
+fs.readdir(wfPath, (err, files) => {
+  if (err) {
+    console.log(err)
+  } else {
+    if (files.length !== 0) {
+      files.forEach((item) => {
+        if (item.split('.')[1] === 'cmd') {
+          replaceStr(`${wfPath}/${item}`, /"%_prog%"/, '%_prog%')
+        }
+      })
+    }
+  }
+})
+
+// 参数:[文件路径、 需要修改的字符串、修改后的字符串] (替换对应文件内字符串的公共函数)
+function replaceStr(filePath, sourceRegx, targetSrt) {
+  fs.readFile(filePath, (err, data) => {
+    if (err) {
+      console.log(err)
+    } else {
+      let str = data.toString()
+      str = str.replace(sourceRegx, targetSrt)
+      fs.writeFile(filePath, str, (err) => {
+        if (err) {
+          console.log(err)
+        } else {
+          console.log('\x1B[42m%s\x1B[0m', '文件修改成功')
+        }
+      })
+    }
+  })
+}

+ 16 - 0
loadEnv.js

@@ -0,0 +1,16 @@
+import * as dotenv from 'dotenv'
+
+export function loadEnv(mode) {
+  const ret = {}
+  // 在应用之前咱们先指定加载哪个环境变量
+  dotenv.config({
+    path: `.env.${mode}`
+  })
+
+  Object.keys(process.env).forEach(envName => {
+    const realName = process.env[envName].replace(/\\n/g, '\n')
+    ret[envName] = realName
+    process.env[envName] = realName
+  })
+  return ret
+}

+ 23 - 0
openDocument.js

@@ -0,0 +1,23 @@
+/*
+                    商用代码公司自用产品无需授权
+    若作为代码出售的产品(任何涉及代码交付第三方作为后续开发)必须保留此脚本
+                         或标注原作者信息
+                          否则将依法维权
+*/
+
+var child_process = require('child_process')
+
+var url = 'https://www.gin-vue-admin.com'
+var cmd = ''
+console.log(process.platform)
+switch (process.platform) {
+  case 'win32':
+    cmd = 'start'
+    // child_process.exec(cmd + ' ' + url)
+    break
+
+  case 'darwin':
+    cmd = 'open'
+    child_process.exec(cmd + ' ' + url)
+    break
+}

+ 77 - 0
package.json

@@ -0,0 +1,77 @@
+{
+  "name": "gin-vue-admin",
+  "version": "2.6.0",
+  "private": true,
+  "scripts": {
+    "serve": "node openDocument.js && vite --host --mode development",
+    "build:ysf": "vite build --mode ysf",
+    "build:dev": "vite build --mode development",
+    "build": "vite build --mode production",
+    "preview": "vite preview",
+    "fix-memory-limit": "cross-env LIMIT=4096 increase-memory-limit"
+  },
+  "dependencies": {
+    "@element-plus/icons-vue": "^2.1.0",
+    "@kangc/v-md-editor": "^2.3.18",
+    "@vue-office/docx": "^1.3.0",
+    "@vue-office/excel": "^1.4.5",
+    "@vue-office/pdf": "^1.5.3",
+    "@vueuse/core": "^10.7.2",
+    "@wangeditor/editor": "^5.1.23",
+    "@wangeditor/editor-for-vue": "^5.1.12",
+    "axios": "^1.4.0",
+    "core-js": "^3.31.1",
+    "dayjs": "^1.11.13",
+    "echarts": "^5.4.3",
+    "editor.md": "^1.5.0",
+    "element-plus": "^2.7.8",
+    "highlight.js": "^11.8.0",
+    "js-cookie": "^3.0.5",
+    "lodash": "^4.17.21",
+    "marked": "4.3.0",
+    "mitt": "^3.0.1",
+    "nprogress": "^0.2.0",
+    "path": "^0.12.7",
+    "pinia": "^2.1.4",
+    "prismjs": "^1.29.0",
+    "qiniu-js": "^3.4.2",
+    "qrcode": "^1.5.4",
+    "qs": "^6.11.2",
+    "screenfull": "^6.0.2",
+    "spark-md5": "^3.0.2",
+    "tailwindcss": "^3.3.3",
+    "uuid": "^11.0.5",
+    "vditor": "^3.10.4",
+    "vue": "^3.3.4",
+    "vue-cropper": "^1.1.4",
+    "vue-router": "^4.2.4",
+    "xlsx": "^0.18.5"
+  },
+  "devDependencies": {
+    "@babel/eslint-parser": "^7.22.9",
+    "@eslint/js": "^9.15.0",
+    "@vitejs/plugin-legacy": "^4.1.0",
+    "@vitejs/plugin-vue": "^4.2.3",
+    "@vue/cli-plugin-babel": "~5.0.8",
+    "@vue/cli-plugin-eslint": "~5.0.8",
+    "@vue/cli-plugin-router": "~5.0.8",
+    "@vue/cli-plugin-vuex": "~5.0.8",
+    "@vue/cli-service": "~5.0.8",
+    "@vue/compiler-sfc": "^3.3.4",
+    "babel-plugin-import": "^1.13.6",
+    "chalk": "^4.1.2",
+    "dotenv": "^16.4.7",
+    "eslint": "^8.57.1",
+    "eslint-plugin-vue": "^9.31.0",
+    "globals": "^15.12.0",
+    "husky": "^9.1.6",
+    "lint-staged": "^15.2.10",
+    "sass": "^1.54.0",
+    "terser": "^5.19.1",
+    "unplugin-auto-import": "^0.16.6",
+    "unplugin-vue-components": "^0.25.1",
+    "vite": "^4.4.6",
+    "vite-plugin-banner": "^0.7.0",
+    "vite-plugin-importer": "^0.2.5"
+  }
+}

+ 6 - 0
postcss.config.js

@@ -0,0 +1,6 @@
+module.exports = {
+  plugins: {
+    tailwindcss: {},
+    autoprefixer: {},
+  },
+}

+ 16 - 0
public/config.js

@@ -0,0 +1,16 @@
+// public/config.js
+window.APP_CONFIG = {
+  // HTTP API
+  BASE_API: '/api',              // 给 axios 用(走 nginx)
+  // 后端原始地址(如果代码里用到)
+  BASE_PATH: 'http://127.0.0.1:9200',
+  SERVICE_PATH: 'http://127.0.0.1:9200',
+  // WebSocket
+  WEBSOCKET_PATH: 'ws://127.0.0.1:9200/QRCode',
+
+  QRCODE_BASE_PATH: 'http://127.0.0.1:9200',
+
+  INVITE_BASE_PATH: 'http://127.0.0.1:8080/#/user/register?code=',
+  // 学员端登录链接(需要启动学员端项目)
+  STUDENT_LOGIN_PATH: 'http://127.0.0.1:8070/#/login',
+}

+ 38 - 0
src/App.vue

@@ -0,0 +1,38 @@
+<template>
+  <div id="app">
+    <el-config-provider :locale="zhCn">
+      <router-view />
+    </el-config-provider>
+  </div>
+</template>
+
+<script setup>
+import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
+import { onUpdated, reactive } from 'vue'
+// element 2.3.8之前使用下面的语句
+// import zhCn from 'element-plus/lib/locale/lang/zh-cn'
+
+defineOptions({
+  name: 'App',
+})
+
+</script>
+<style lang="scss">
+@tailwind base;
+@tailwind components;
+@tailwind utilities;
+// 引入初始化样式
+#app {
+  background: #eee;
+  height: 100vh;
+  overflow: hidden;
+  font-weight: 400 !important;
+}
+.el-button {
+  font-weight: 400 !important;
+}
+.el-menu--collapse .el-menu .el-submenu,
+.el-menu--popup {
+  min-width: 100px !important;
+}
+</style>

+ 146 - 0
src/api/api.js

@@ -0,0 +1,146 @@
+import service from '@/utils/request'
+
+// @Tags api
+// @Summary 分页获取角色列表
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body modelInterface.PageInfo true "分页获取用户列表"
+// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /api/getApiList [post]
+// {
+//  page     int
+//	pageSize int
+// }
+export const getApiList = (data) => {
+  return service({
+    url: '/api/getApiList',
+    method: 'post',
+    data
+  })
+}
+
+// @Tags Api
+// @Summary 创建基础api
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body api.CreateApiParams true "创建api"
+// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /api/createApi [post]
+export const createApi = (data) => {
+  return service({
+    url: '/api/createApi',
+    method: 'post',
+    data
+  })
+}
+
+// @Tags menu
+// @Summary 根据id获取菜单
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body api.GetById true "根据id获取菜单"
+// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /menu/getApiById [post]
+export const getApiById = (data) => {
+  return service({
+    url: '/api/getApiById',
+    method: 'post',
+    data
+  })
+}
+
+// @Tags Api
+// @Summary 更新api
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body api.CreateApiParams true "更新api"
+// @Success 200 {string} json "{"success":true,"data":{},"msg":"更新成功"}"
+// @Router /api/updateApi [post]
+export const updateApi = (data) => {
+  return service({
+    url: '/api/updateApi',
+    method: 'post',
+    data
+  })
+}
+
+// @Tags Api
+// @Summary 更新api
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body api.CreateApiParams true "更新api"
+// @Success 200 {string} json "{"success":true,"data":{},"msg":"更新成功"}"
+// @Router /api/setAuthApi [post]
+export const setAuthApi = (data) => {
+  return service({
+    url: '/api/setAuthApi',
+    method: 'post',
+    data
+  })
+}
+
+// @Tags Api
+// @Summary 获取所有的Api 不分页
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /api/getAllApis [post]
+export const getAllApis = (data) => {
+  return service({
+    url: '/api/getAllApis',
+    method: 'post',
+    data
+  })
+}
+
+// @Tags Api
+// @Summary 删除指定api
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body dbModel.Api true "删除api"
+// @Success 200 {string} json "{"success":true,"data":{},"msg":"删除成功"}"
+// @Router /api/deleteApi [post]
+export const deleteApi = (data) => {
+  return service({
+    url: '/api/deleteApi',
+    method: 'post',
+    data
+  })
+}
+
+// @Tags SysApi
+// @Summary 删除选中Api
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body request.IdsReq true "ID"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
+// @Router /api/deleteApisByIds [delete]
+export const deleteApisByIds = (data) => {
+  return service({
+    url: '/api/deleteApisByIds',
+    method: 'delete',
+    data
+  })
+}
+
+// FreshCasbin
+// @Tags      SysApi
+// @Summary   刷新casbin缓存
+// @accept    application/json
+// @Produce   application/json
+// @Success   200   {object}  response.Response{msg=string}  "刷新成功"
+// @Router    /api/freshCasbin [get]
+export const freshCasbin = () => {
+  return service({
+    url: '/api/freshCasbin',
+    method: 'get'
+  })
+}

+ 85 - 0
src/api/authority.js

@@ -0,0 +1,85 @@
+import service from '@/utils/request'
+// @Router /authority/getAuthorityList [post]
+export const getAuthorityList = (data) => {
+  return service({
+    url: '/authority/getAuthorityList',
+    method: 'post',
+    data
+  })
+}
+
+// @Summary 删除角色
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body {authorityId uint} true "删除角色"
+// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /authority/deleteAuthority [post]
+export const deleteAuthority = (data) => {
+  return service({
+    url: '/authority/deleteAuthority',
+    method: 'post',
+    data
+  })
+}
+
+// @Summary 创建角色
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body api.CreateAuthorityPatams true "创建角色"
+// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /authority/createAuthority [post]
+export const createAuthority = (data) => {
+  return service({
+    url: '/authority/createAuthority',
+    method: 'post',
+    data
+  })
+}
+
+// @Tags authority
+// @Summary 拷贝角色
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body api.CreateAuthorityPatams true "拷贝角色"
+// @Success 200 {string} json "{"success":true,"data":{},"msg":"拷贝成功"}"
+// @Router /authority/copyAuthority [post]
+export const copyAuthority = (data) => {
+  return service({
+    url: '/authority/copyAuthority',
+    method: 'post',
+    data
+  })
+}
+
+// @Summary 设置角色资源权限
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body sysModel.SysAuthority true "设置角色资源权限"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"设置成功"}"
+// @Router /authority/setDataAuthority [post]
+export const setDataAuthority = (data) => {
+  return service({
+    url: '/authority/setDataAuthority',
+    method: 'post',
+    data
+  })
+}
+
+// @Summary 修改角色
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.SysAuthority true "修改角色"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"设置成功"}"
+// @Router /authority/setDataAuthority [post]
+export const updateAuthority = (data) => {
+  return service({
+    url: '/authority/updateAuthority',
+    method: 'put',
+    data
+  })
+}

+ 27 - 0
src/api/authorityBtn.js

@@ -0,0 +1,27 @@
+
+import service from '@/utils/request'
+
+export const getAuthorityBtnApi = (data) => {
+  return service({
+    url: '/authorityBtn/getAuthorityBtn',
+    method: 'post',
+    data
+  })
+}
+
+export const setAuthorityBtnApi = (data) => {
+  return service({
+    url: '/authorityBtn/setAuthorityBtn',
+    method: 'post',
+    data
+  })
+}
+
+export const canRemoveAuthorityBtnApi = (params) => {
+  return service({
+    url: '/authorityBtn/canRemoveAuthorityBtn',
+    method: 'post',
+    params
+  })
+}
+

+ 142 - 0
src/api/autoCode.js

@@ -0,0 +1,142 @@
+import service from '@/utils/request'
+
+export const preview = (data) => {
+  return service({
+    url: '/autoCode/preview',
+    method: 'post',
+    data
+  })
+}
+
+export const createTemp = (data) => {
+  return service({
+    url: '/autoCode/createTemp',
+    method: 'post',
+    data,
+    responseType: 'blob'
+  })
+}
+
+// @Tags SysApi
+// @Summary 获取当前所有数据库
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
+// @Router /autoCode/getDatabase [get]
+export const getDB = (params) => {
+  return service({
+    url: '/autoCode/getDB',
+    method: 'get',
+    params
+  })
+}
+
+// @Tags SysApi
+// @Summary 获取当前数据库所有表
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
+// @Router /autoCode/getTables [get]
+export const getTable = (params) => {
+  return service({
+    url: '/autoCode/getTables',
+    method: 'get',
+    params
+  })
+}
+
+// @Tags SysApi
+// @Summary 获取当前数据库所有表
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
+// @Router /autoCode/getColumn [get]
+export const getColumn = (params) => {
+  return service({
+    url: '/autoCode/getColumn',
+    method: 'get',
+    params
+  })
+}
+
+export const getSysHistory = (data) => {
+  return service({
+    url: '/autoCode/getSysHistory',
+    method: 'post',
+    data
+  })
+}
+
+export const rollback = (data) => {
+  return service({
+    url: '/autoCode/rollback',
+    method: 'post',
+    data
+  })
+}
+
+export const getMeta = (data) => {
+  return service({
+    url: '/autoCode/getMeta',
+    method: 'post',
+    data
+  })
+}
+
+export const delSysHistory = (data) => {
+  return service({
+    url: '/autoCode/delSysHistory',
+    method: 'post',
+    data
+  })
+}
+
+export const createPackageApi = (data) => {
+  return service({
+    url: '/autoCode/createPackage',
+    method: 'post',
+    data
+  })
+}
+
+export const getPackageApi = () => {
+  return service({
+    url: '/autoCode/getPackage',
+    method: 'post'
+  })
+}
+
+export const deletePackageApi = (data) => {
+  return service({
+    url: '/autoCode/delPackage',
+    method: 'post',
+    data
+  })
+}
+
+export const createPlugApi = (data) => {
+  return service({
+    url: '/autoCode/createPlug',
+    method: 'post',
+    data
+  })
+}
+
+export const installPlug = (data) => {
+  return service({
+    url: '/autoCode/installPlug',
+    method: 'post',
+    data
+  })
+}
+
+export const pubPlug = (params) => {
+  return service({
+    url: '/autoCode/pubPlug',
+    method: 'post',
+    params
+  })
+}

+ 43 - 0
src/api/breakpoint.js

@@ -0,0 +1,43 @@
+import service from '@/utils/request'
+// @Summary 设置角色资源权限
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body sysModel.SysAuthority true "设置角色资源权限"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"设置成功"}"
+// @Router /authority/setDataAuthority [post]
+
+export const findFile = (params) => {
+  return service({
+    url: '/fileUploadAndDownload/findFile',
+    method: 'get',
+    params
+  })
+}
+
+export const breakpointContinue = (data) => {
+  return service({
+    url: '/fileUploadAndDownload/breakpointContinue',
+    method: 'post',
+    donNotShowLoading: true,
+    headers: { 'Content-Type': 'multipart/form-data' },
+    data
+  })
+}
+
+export const breakpointContinueFinish = (params) => {
+  return service({
+    url: '/fileUploadAndDownload/breakpointContinueFinish',
+    method: 'post',
+    params
+  })
+}
+
+export const removeChunk = (data, params) => {
+  return service({
+    url: '/fileUploadAndDownload/removeChunk',
+    method: 'post',
+    data,
+    params
+  })
+}

+ 32 - 0
src/api/casbin.js

@@ -0,0 +1,32 @@
+import service from '@/utils/request'
+// @Tags authority
+// @Summary 更改角色api权限
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body api.CreateAuthorityPatams true "更改角色api权限"
+// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /casbin/UpdateCasbin [post]
+export const UpdateCasbin = (data) => {
+  return service({
+    url: '/casbin/updateCasbin',
+    method: 'post',
+    data
+  })
+}
+
+// @Tags casbin
+// @Summary 获取权限列表
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body api.CreateAuthorityPatams true "获取权限列表"
+// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /casbin/getPolicyPathByAuthorityId [post]
+export const getPolicyPathByAuthorityId = (data) => {
+  return service({
+    url: '/casbin/getPolicyPathByAuthorityId',
+    method: 'post',
+    data
+  })
+}

+ 31 - 0
src/api/chatgpt.js

@@ -0,0 +1,31 @@
+import service from '@/utils/request'
+
+export const getTableApi = (data) => {
+  return service({
+    url: '/chatGpt/getTable',
+    method: 'post',
+    data
+  })
+}
+
+export const createSKApi = (data) => {
+  return service({
+    url: '/chatGpt/createSK',
+    method: 'post',
+    data
+  })
+}
+
+export const getSKApi = () => {
+  return service({
+    url: '/chatGpt/getSK',
+    method: 'get',
+  })
+}
+
+export const deleteSKApi = () => {
+  return service({
+    url: '/chatGpt/deleteSK',
+    method: 'delete'
+  })
+}

+ 16 - 0
src/api/config.js

@@ -0,0 +1,16 @@
+import service from '@/utils/request'
+
+export const getLoginType = () => {
+  return service({
+    url: '/config/getLoginType',
+    method: 'get'
+  })
+}
+
+export const checkLoginType = (data) => {
+  return service({
+    url: '/config/checkLoginType',
+    method: 'post',
+    data
+  })
+}

+ 80 - 0
src/api/customer.js

@@ -0,0 +1,80 @@
+import service from '@/utils/request'
+// @Tags SysApi
+// @Summary 删除客户
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body dbModel.ExaCustomer true "删除客户"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /customer/customer [post]
+export const createExaCustomer = (data) => {
+  return service({
+    url: '/customer/customer',
+    method: 'post',
+    data
+  })
+}
+
+// @Tags SysApi
+// @Summary 更新客户信息
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body dbModel.ExaCustomer true "更新客户信息"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /customer/customer [put]
+export const updateExaCustomer = (data) => {
+  return service({
+    url: '/customer/customer',
+    method: 'put',
+    data
+  })
+}
+
+// @Tags SysApi
+// @Summary 创建客户
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body dbModel.ExaCustomer true "创建客户"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /customer/customer [delete]
+export const deleteExaCustomer = (data) => {
+  return service({
+    url: '/customer/customer',
+    method: 'delete',
+    data
+  })
+}
+
+// @Tags SysApi
+// @Summary 获取单一客户信息
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body dbModel.ExaCustomer true "获取单一客户信息"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /customer/customer [get]
+export const getExaCustomer = (params) => {
+  return service({
+    url: '/customer/customer',
+    method: 'get',
+    params
+  })
+}
+
+// @Tags SysApi
+// @Summary 获取权限客户列表
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body modelInterface.PageInfo true "获取权限客户列表"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /customer/customerList [get]
+export const getExaCustomerList = (params) => {
+  return service({
+    url: '/customer/customerList',
+    method: 'get',
+    params
+  })
+}

+ 14 - 0
src/api/email.js

@@ -0,0 +1,14 @@
+import service from '@/utils/request'
+// @Tags email
+// @Summary 发送测试邮件
+// @Security ApiKeyAuth
+// @Produce  application/json
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}"
+// @Router /email/emailTest [post]
+export const emailTest = (data) => {
+  return service({
+    url: '/email/emailTest',
+    method: 'post',
+    data
+  })
+}

+ 97 - 0
src/api/exportTemplate.js

@@ -0,0 +1,97 @@
+import service from '@/utils/request'
+
+// @Tags SysExportTemplate
+// @Summary 创建导出模板
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.SysExportTemplate true "创建导出模板"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
+// @Router /sysExportTemplate/createSysExportTemplate [post]
+export const createSysExportTemplate = (data) => {
+  return service({
+    url: '/sysExportTemplate/createSysExportTemplate',
+    method: 'post',
+    data
+  })
+}
+
+// @Tags SysExportTemplate
+// @Summary 删除导出模板
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.SysExportTemplate true "删除导出模板"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
+// @Router /sysExportTemplate/deleteSysExportTemplate [delete]
+export const deleteSysExportTemplate = (data) => {
+  return service({
+    url: '/sysExportTemplate/deleteSysExportTemplate',
+    method: 'delete',
+    data
+  })
+}
+
+// @Tags SysExportTemplate
+// @Summary 批量删除导出模板
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body request.IdsReq true "批量删除导出模板"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
+// @Router /sysExportTemplate/deleteSysExportTemplate [delete]
+export const deleteSysExportTemplateByIds = (data) => {
+  return service({
+    url: '/sysExportTemplate/deleteSysExportTemplateByIds',
+    method: 'delete',
+    data
+  })
+}
+
+// @Tags SysExportTemplate
+// @Summary 更新导出模板
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.SysExportTemplate true "更新导出模板"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
+// @Router /sysExportTemplate/updateSysExportTemplate [put]
+export const updateSysExportTemplate = (data) => {
+  return service({
+    url: '/sysExportTemplate/updateSysExportTemplate',
+    method: 'put',
+    data
+  })
+}
+
+// @Tags SysExportTemplate
+// @Summary 用id查询导出模板
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data query model.SysExportTemplate true "用id查询导出模板"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
+// @Router /sysExportTemplate/findSysExportTemplate [get]
+export const findSysExportTemplate = (params) => {
+  return service({
+    url: '/sysExportTemplate/findSysExportTemplate',
+    method: 'get',
+    params
+  })
+}
+
+// @Tags SysExportTemplate
+// @Summary 分页获取导出模板列表
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data query request.PageInfo true "分页获取导出模板列表"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /sysExportTemplate/getSysExportTemplateList [get]
+export const getSysExportTemplateList = (params) => {
+  return service({
+    url: '/sysExportTemplate/getSysExportTemplateList',
+    method: 'get',
+    params
+  })
+}

+ 44 - 0
src/api/fileUploadAndDownload.js

@@ -0,0 +1,44 @@
+import service from '@/utils/request'
+// @Tags FileUploadAndDownload
+// @Summary 分页文件列表
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body modelInterface.PageInfo true "分页获取文件户列表"
+// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /fileUploadAndDownload/getFileList [post]
+export const getFileList = (data) => {
+  return service({
+    url: '/fileUploadAndDownload/getFileList',
+    method: 'post',
+    data
+  })
+}
+
+// @Tags FileUploadAndDownload
+// @Summary 删除文件
+// @Security ApiKeyAuth
+// @Produce  application/json
+// @Param data body dbModel.FileUploadAndDownload true "传入文件里面id即可"
+// @Success 200 {string} json "{"success":true,"data":{},"msg":"返回成功"}"
+// @Router /fileUploadAndDownload/deleteFile [post]
+export const deleteFile = (data) => {
+  return service({
+    url: '/fileUploadAndDownload/deleteFile',
+    method: 'post',
+    data
+  })
+}
+
+/**
+ * 编辑文件名或者备注
+ * @param data
+ * @returns {*}
+ */
+export const editFileName = (data) => {
+  return service({
+    url: '/fileUploadAndDownload/editFileName',
+    method: 'post',
+    data
+  })
+}

+ 17 - 0
src/api/github.js

@@ -0,0 +1,17 @@
+import axios from 'axios'
+
+const service = axios.create()
+
+export function Commits(page) {
+  return service({
+    url: 'https://api.github.com/repos/flipped-aurora/gin-vue-admin/commits?page=' + page,
+    method: 'get'
+  })
+}
+
+export function Members() {
+  return service({
+    url: 'https://api.github.com/orgs/FLIPPED-AURORA/members',
+    method: 'get'
+  })
+}

+ 81 - 0
src/api/iam.js

@@ -0,0 +1,81 @@
+import axios from 'axios'
+import { ElMessage } from 'element-plus'
+
+// IAM 后端直连(不走 vite 代理,也不复用 @/utils/request:
+// 该全局封装会把 baseURL 强制覆盖为 /api 且只认 code===100000)。
+// 后端地址通过环境变量 VITE_IAM_SERVER 配置,默认 http://localhost:8888(本地开发)。
+const service = axios.create({
+  baseURL: import.meta.env.VITE_IAM_SERVER || 'http://localhost:9990',
+  timeout: 30000
+})
+
+service.interceptors.response.use(
+  response => {
+    // 文件下载(导入模板)直接返回 blob
+    if (response.config.responseType === 'blob') {
+      return response.data
+    }
+    const res = response.data
+    // 统一信封 {code, msg, data}:成功只认 code === 100000
+    if (res && typeof res === 'object' && 'code' in res) {
+      if (res.code === 100000) {
+        return res.data
+      }
+      ElMessage({ showClose: true, type: 'error', message: res.msg || '请求失败' })
+      return Promise.reject(new Error(res.msg || '请求失败'))
+    }
+    return res
+  },
+  error => {
+    ElMessage({
+      showClose: true,
+      type: 'error',
+      message: error.response?.data?.msg || error.message || '网络错误'
+    })
+    return Promise.reject(error)
+  }
+)
+
+// 分页查询用户(page / pageSize / authMethod / keyword)
+export const getUserList = params => service.get('/api/v1/users', { params })
+
+// 编辑用户:双数据源后仅更新 IAM 属性(认证方式/标识/启用),身份字段以客户用户库为准
+export const updateUser = (id, data) => service.put(`/api/v1/users/${id}`, data)
+
+// 启用/禁用(1 启用 / 2 禁用)
+export const updateUserEnable = (id, enable) =>
+  service.patch(`/api/v1/users/${id}/enable`, { enable })
+
+// 更新二次认证方式
+export const updateUserAuth = (id, data) => service.put(`/api/v1/users/${id}/auth`, data)
+
+// 管理端 OTP 绑定:注册令牌 + 生成绑定二维码(入参 userName)
+export const otpRegister = data => service.post('/api/v1/otp/register', data)
+
+// 刷新 OTP 绑定二维码(入参 tid)
+export const otpBindInfo = data => service.post('/api/v1/otp/bind-info', data)
+
+// 动态令牌(OTP)配置
+export const getOtpConfig = () => service.get('/api/v1/config/otp')
+export const updateOtpConfig = data => service.put('/api/v1/config/otp', data)
+export const testOtp = data => service.post('/api/v1/config/otp/test', data)
+
+// 签名验签配置
+export const getSignConfig = () => service.get('/api/v1/config/sign')
+export const updateSignConfig = data => service.put('/api/v1/config/sign', data)
+export const testSign = () => service.post('/api/v1/config/sign/test')
+
+// 短信渠道配置
+export const listSmsConfigs = (params) => service({ url: '/api/v1/config/sms', method: 'get', params })
+export const createSmsConfig = (data) => service({ url: '/api/v1/config/sms', method: 'post', data })
+export const updateSmsConfig = (id, data) => service({ url: `/api/v1/config/sms/${id}`, method: 'put', data })
+export const deleteSmsConfig = (id) => service({ url: `/api/v1/config/sms/${id}`, method: 'delete' })
+export const updateSmsStatus = (id, status) => service({ url: `/api/v1/config/sms/${id}/status`, method: 'patch', data: { status }})
+export const testSms = (data) => service({ url: '/api/v1/config/sms/test', method: 'post', data })
+export const refreshSmsClient = () => service({ url: '/api/v1/config/sms/refresh', method: 'post' })
+
+// 用户库字段映射配置(产品化:前端可视化配置客户库映射)
+export const getUserdbTables = () => service.get('/api/v1/config/userdb/tables')
+export const getUserdbFields = (table) => service.get('/api/v1/config/userdb/fields', { params: { table } })
+export const getUserdbMapping = () => service.get('/api/v1/config/userdb/mapping')
+export const updateUserdbMapping = (data) => service.put('/api/v1/config/userdb/mapping', data)

+ 26 - 0
src/api/initdb.js

@@ -0,0 +1,26 @@
+import service from '@/utils/request'
+// @Tags InitDB
+// @Summary 初始化用户数据库
+// @Produce  application/json
+// @Param data body request.InitDB true "初始化数据库参数"
+// @Success 200 {string} string "{"code":0,"data":{},"msg":"自动创建数据库成功"}"
+// @Router /init/initdb [post]
+export const initDB = (data) => {
+  return service({
+    url: '/init/initdb',
+    method: 'post',
+    data
+  })
+}
+
+// @Tags CheckDB
+// @Summary 初始化用户数据库
+// @Produce  application/json
+// @Success 200 {string} string "{"code":0,"data":{},"msg":"探测完成"}"
+// @Router /init/checkdb [post]
+export const checkDB = () => {
+  return service({
+    url: '/init/checkdb',
+    method: 'post'
+  })
+}

+ 14 - 0
src/api/jwt.js

@@ -0,0 +1,14 @@
+import service from '@/utils/request'
+// @Tags jwt
+// @Summary jwt加入黑名单
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"拉黑成功"}"
+// @Router /jwt/jsonInBlacklist [post]
+export const jsonInBlacklist = () => {
+  return service({
+    url: '/jwt/jsonInBlacklist',
+    method: 'post'
+  })
+}

+ 23 - 0
src/api/license.js

@@ -0,0 +1,23 @@
+import service from '@/utils/request'
+
+export const getMachineCode = () => {
+  return service({
+    url: '/license/getMachineCode',
+    method: 'get'
+  })
+}
+
+export const updateLicenseCode = (data) => {
+  return service({
+    url: '/license/updateLicenseCode',
+    method: 'post',
+    data: data
+  })
+}
+
+export const getValidityPeriod = () => {
+  return service({
+    url: '/license/getValidityPeriod',
+    method: 'get'
+  })
+}

+ 113 - 0
src/api/menu.js

@@ -0,0 +1,113 @@
+import service from '@/utils/request'
+// @Summary 用户登录 获取动态路由
+// @Produce  application/json
+// @Param 可以什么都不填 调一下即可
+// @Router /menu/getMenu [post]
+export const asyncMenu = () => {
+  return service({
+    url: '/menu/getMenu',
+    method: 'post'
+  })
+}
+
+// @Summary 获取menu列表
+// @Produce  application/json
+// @Param {
+//  page     int
+//	pageSize int
+// }
+// @Router /menu/getMenuList [post]
+export const getMenuList = (data) => {
+  return service({
+    url: '/menu/getMenuList',
+    method: 'post',
+    data
+  })
+}
+
+// @Summary 新增基础menu
+// @Produce  application/json
+// @Param menu Object
+// @Router /menu/getMenuList [post]
+export const addBaseMenu = (data) => {
+  return service({
+    url: '/menu/addBaseMenu',
+    method: 'post',
+    data
+  })
+}
+
+// @Summary 获取基础路由列表
+// @Produce  application/json
+// @Param 可以什么都不填 调一下即可
+// @Router /menu/getBaseMenuTree [post]
+export const getBaseMenuTree = () => {
+  return service({
+    url: '/menu/getBaseMenuTree',
+    method: 'post'
+  })
+}
+
+// @Summary 添加用户menu关联关系
+// @Produce  application/json
+// @Param menus Object authorityId string
+// @Router /menu/getMenuList [post]
+export const addMenuAuthority = (data) => {
+  return service({
+    url: '/menu/addMenuAuthority',
+    method: 'post',
+    data
+  })
+}
+
+// @Summary 获取用户menu关联关系
+// @Produce  application/json
+// @Param authorityId string
+// @Router /menu/getMenuAuthority [post]
+export const getMenuAuthority = (data) => {
+  return service({
+    url: '/menu/getMenuAuthority',
+    method: 'post',
+    data
+  })
+}
+
+// @Summary 删除menu
+// @Produce  application/json
+// @Param ID float64
+// @Router /menu/deleteBaseMenu [post]
+export const deleteBaseMenu = (data) => {
+  return service({
+    url: '/menu/deleteBaseMenu',
+    method: 'post',
+    data
+  })
+}
+
+// @Summary 修改menu列表
+// @Produce  application/json
+// @Param menu Object
+// @Router /menu/updateBaseMenu [post]
+export const updateBaseMenu = (data) => {
+  return service({
+    url: '/menu/updateBaseMenu',
+    method: 'post',
+    data
+  })
+}
+
+// @Tags menu
+// @Summary 根据id获取菜单
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body api.GetById true "根据id获取菜单"
+// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /menu/getBaseMenuById [post]
+export const getBaseMenuById = (data) => {
+  return service({
+    url: '/menu/getBaseMenuById',
+    method: 'post',
+    data
+  })
+}

+ 25 - 0
src/api/sn.js

@@ -0,0 +1,25 @@
+import service from '@/utils/request'
+
+export const info = (params) => {
+  return service({
+    url: 'sysUserSn/info',
+    method: 'get',
+    params
+  })
+}
+
+export const bind = (data) => {
+  return service({
+    url: 'sysUserSn/bind',
+    method: 'post',
+    data: data
+  })
+}
+
+export const unbind = (data) => {
+  return service({
+    url: 'sysUserSn/unbind',
+    method: 'post',
+    data: data
+  })
+}

+ 117 - 0
src/api/sys/service.js

@@ -0,0 +1,117 @@
+import service from '@/utils/request'
+
+export const serviceList = (data) => {
+  return service({
+    url: '/v1/regulated/list',
+    method: 'post',
+    data
+  })
+}
+
+export const serviceAdd = (data) => {
+  return service({
+    url: '/v1/regulated/create',
+    method: 'post',
+    data
+  })
+}
+export const serviceUpdate = (data) => {
+  return service({
+    url: '/v1/regulated/update',
+    method: 'post',
+    data
+  })
+}
+export const serviceDelete = (data) => {
+  return service({
+    url: '/v1/regulated/delete?iden=' + data,
+    method: 'post'
+  })
+}
+
+export const apiListByRegulatedIden = (data) => {
+  return service({
+    url: '/v1/apis/listByRegulatedIden?regulatedIden=' + data,
+    method: 'post'
+  })
+}
+
+export const apiAdd = (data) => {
+  return service({
+    url: '/v1/apis/create',
+    method: 'post',
+    data
+  })
+}
+
+// 修改采集接口启停状态:1-启用,2-停用
+export const apiChangeStatus = (id, status) => {
+  return service({
+    url: `/v1/apis/changeStatus/${id}/${status}`,
+    method: 'post'
+  })
+}
+
+// 应用接口列表采集
+export const appApiList = (data) => {
+  return service({
+    url: '/v1/remote/appApiList',
+    method: 'post',
+    data
+  })
+}
+
+// 应用接口启停(传 id + regulatedIden,服务端按 id 切换状态)
+export const appApiToggle = (data) => {
+  return service({
+    url: '/v1/remote/appApiToggle',
+    method: 'post',
+    data
+  })
+}
+
+// 采集接口连通性测试
+export const appApiTest = (data) => {
+  return service({
+    url: '/v1/remote/appApiTest',
+    method: 'post',
+    data
+  })
+}
+
+export const apiUpdate = (data) => {
+  return service({
+    url: '/v1/apis/update',
+    method: 'post',
+    data
+  })
+}
+
+export const getStatic = (data) => {
+  return service({
+    url: '/v1/remote/static',
+    method: 'post',
+    data
+  })
+}
+export const getDynamic = (data) => {
+  return service({
+    url: '/v1/remote/dynamic',
+    method: 'post',
+    data
+  })
+}
+export const getApiStatTotal = (data) => {
+  return service({
+    url: '/v1/remote/total',
+    method: 'post',
+    data
+  })
+}
+export const getApiStatWeek = (data) => {
+  return service({
+    url: '/v1/remote/recentWeek',
+    method: 'post',
+    data
+  })
+}

+ 104 - 0
src/api/sysApplication.js

@@ -0,0 +1,104 @@
+import service from '@/utils/request'
+
+// @Tags SysApplication
+// @Summary 创建业务应用系统
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.SysApplication true "创建业务应用系统"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
+// @Router /app/createSysApplication [post]
+export const createSysApplication = (data) => {
+  return service({
+    url: '/app/createSysApplication',
+    method: 'post',
+    data
+  })
+}
+
+// @Tags SysApplication
+// @Summary 删除业务应用系统
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.SysApplication true "删除业务应用系统"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
+// @Router /app/deleteSysApplication [delete]
+export const deleteSysApplication = (params) => {
+  return service({
+    url: '/app/deleteSysApplication',
+    method: 'delete',
+    params
+  })
+}
+
+// @Tags SysApplication
+// @Summary 批量删除业务应用系统
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body request.IdsReq true "批量删除业务应用系统"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
+// @Router /app/deleteSysApplication [delete]
+export const deleteSysApplicationByIds = (params) => {
+  return service({
+    url: '/app/deleteSysApplicationByIds',
+    method: 'delete',
+    params
+  })
+}
+
+// @Tags SysApplication
+// @Summary 更新业务应用系统
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.SysApplication true "更新业务应用系统"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
+// @Router /app/updateSysApplication [put]
+export const updateSysApplication = (data) => {
+  return service({
+    url: '/app/updateSysApplication',
+    method: 'put',
+    data
+  })
+}
+
+// @Tags SysApplication
+// @Summary 用id查询业务应用系统
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data query model.SysApplication true "用id查询业务应用系统"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
+// @Router /app/findSysApplication [get]
+export const findSysApplication = (params) => {
+  return service({
+    url: '/app/findSysApplication',
+    method: 'get',
+    params
+  })
+}
+
+// @Tags SysApplication
+// @Summary 分页获取业务应用系统列表
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data query request.PageInfo true "分页获取业务应用系统列表"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /app/getSysApplicationList [get]
+export const getSysApplicationList = (params) => {
+  return service({
+    url: '/app/getSysApplicationList',
+    method: 'get',
+    params
+  })
+}
+
+export const cmsTest = () => {
+  return service({
+    url: '/cms/test',
+    method: 'get'
+  })
+}

+ 80 - 0
src/api/sysDictionary.js

@@ -0,0 +1,80 @@
+import service from '@/utils/request'
+// @Tags SysDictionary
+// @Summary 创建SysDictionary
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.SysDictionary true "创建SysDictionary"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /sysDictionary/createSysDictionary [post]
+export const createSysDictionary = (data) => {
+  return service({
+    url: '/sysDictionary/createSysDictionary',
+    method: 'post',
+    data
+  })
+}
+
+// @Tags SysDictionary
+// @Summary 删除SysDictionary
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.SysDictionary true "删除SysDictionary"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
+// @Router /sysDictionary/deleteSysDictionary [delete]
+export const deleteSysDictionary = (data) => {
+  return service({
+    url: '/sysDictionary/deleteSysDictionary',
+    method: 'delete',
+    data
+  })
+}
+
+// @Tags SysDictionary
+// @Summary 更新SysDictionary
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.SysDictionary true "更新SysDictionary"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
+// @Router /sysDictionary/updateSysDictionary [put]
+export const updateSysDictionary = (data) => {
+  return service({
+    url: '/sysDictionary/updateSysDictionary',
+    method: 'put',
+    data
+  })
+}
+
+// @Tags SysDictionary
+// @Summary 用id查询SysDictionary
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.SysDictionary true "用id查询SysDictionary"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
+// @Router /sysDictionary/findSysDictionary [get]
+export const findSysDictionary = (params) => {
+  return service({
+    url: '/sysDictionary/findSysDictionary',
+    method: 'get',
+    params
+  })
+}
+
+// @Tags SysDictionary
+// @Summary 分页获取SysDictionary列表
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body request.PageInfo true "分页获取SysDictionary列表"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /sysDictionary/getSysDictionaryList [get]
+export const getSysDictionaryList = (params) => {
+  return service({
+    url: '/sysDictionary/getSysDictionaryList',
+    method: 'get',
+    params
+  })
+}

+ 80 - 0
src/api/sysDictionaryDetail.js

@@ -0,0 +1,80 @@
+import service from '@/utils/request'
+// @Tags SysDictionaryDetail
+// @Summary 创建SysDictionaryDetail
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.SysDictionaryDetail true "创建SysDictionaryDetail"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /sysDictionaryDetail/createSysDictionaryDetail [post]
+export const createSysDictionaryDetail = (data) => {
+  return service({
+    url: '/sysDictionaryDetail/createSysDictionaryDetail',
+    method: 'post',
+    data
+  })
+}
+
+// @Tags SysDictionaryDetail
+// @Summary 删除SysDictionaryDetail
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.SysDictionaryDetail true "删除SysDictionaryDetail"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
+// @Router /sysDictionaryDetail/deleteSysDictionaryDetail [delete]
+export const deleteSysDictionaryDetail = (data) => {
+  return service({
+    url: '/sysDictionaryDetail/deleteSysDictionaryDetail',
+    method: 'delete',
+    data
+  })
+}
+
+// @Tags SysDictionaryDetail
+// @Summary 更新SysDictionaryDetail
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.SysDictionaryDetail true "更新SysDictionaryDetail"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
+// @Router /sysDictionaryDetail/updateSysDictionaryDetail [put]
+export const updateSysDictionaryDetail = (data) => {
+  return service({
+    url: '/sysDictionaryDetail/updateSysDictionaryDetail',
+    method: 'put',
+    data
+  })
+}
+
+// @Tags SysDictionaryDetail
+// @Summary 用id查询SysDictionaryDetail
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.SysDictionaryDetail true "用id查询SysDictionaryDetail"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
+// @Router /sysDictionaryDetail/findSysDictionaryDetail [get]
+export const findSysDictionaryDetail = (params) => {
+  return service({
+    url: '/sysDictionaryDetail/findSysDictionaryDetail',
+    method: 'get',
+    params
+  })
+}
+
+// @Tags SysDictionaryDetail
+// @Summary 分页获取SysDictionaryDetail列表
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body request.PageInfo true "分页获取SysDictionaryDetail列表"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /sysDictionaryDetail/getSysDictionaryDetailList [get]
+export const getSysDictionaryDetailList = (params) => {
+  return service({
+    url: '/sysDictionaryDetail/getSysDictionaryDetailList',
+    method: 'get',
+    params
+  })
+}

+ 48 - 0
src/api/sysOperationRecord.js

@@ -0,0 +1,48 @@
+import service from '@/utils/request'
+// @Tags SysOperationRecord
+// @Summary 删除SysOperationRecord
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.SysOperationRecord true "删除SysOperationRecord"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
+// @Router /sysOperationRecord/deleteSysOperationRecord [delete]
+export const deleteSysOperationRecord = (data) => {
+  return service({
+    url: '/sysOperationRecord/deleteSysOperationRecord',
+    method: 'delete',
+    data
+  })
+}
+
+// @Tags SysOperationRecord
+// @Summary 删除SysOperationRecord
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body request.IdsReq true "删除SysOperationRecord"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
+// @Router /sysOperationRecord/deleteSysOperationRecord [delete]
+export const deleteSysOperationRecordByIds = (data) => {
+  return service({
+    url: '/sysOperationRecord/deleteSysOperationRecordByIds',
+    method: 'delete',
+    data
+  })
+}
+
+// @Tags SysOperationRecord
+// @Summary 分页获取SysOperationRecord列表
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body request.PageInfo true "分页获取SysOperationRecord列表"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /sysOperationRecord/getSysOperationRecordList [get]
+export const getSysOperationRecordList = (params) => {
+  return service({
+    url: '/sysOperationRecord/getSysOperationRecordList',
+    method: 'get',
+    params
+  })
+}

+ 42 - 0
src/api/system.js

@@ -0,0 +1,42 @@
+import service from '@/utils/request'
+// @Tags systrm
+// @Summary 获取配置文件内容
+// @Security ApiKeyAuth
+// @Produce  application/json
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}"
+// @Router /system/getSystemConfig [post]
+export const getSystemConfig = () => {
+  return service({
+    url: '/system/getSystemConfig',
+    method: 'post'
+  })
+}
+
+// @Tags system
+// @Summary 设置配置文件内容
+// @Security ApiKeyAuth
+// @Produce  application/json
+// @Param data body sysModel.System true
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}"
+// @Router /system/setSystemConfig [post]
+export const setSystemConfig = (data) => {
+  return service({
+    url: '/system/setSystemConfig',
+    method: 'post',
+    data
+  })
+}
+
+// @Tags system
+// @Summary 获取服务器运行状态
+// @Security ApiKeyAuth
+// @Produce  application/json
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}"
+// @Router /system/getServerInfo [post]
+export const getSystemState = () => {
+  return service({
+    url: '/system/getServerInfo',
+    method: 'post',
+    donNotShowLoading: true
+  })
+}

+ 28 - 0
src/api/upload.js

@@ -0,0 +1,28 @@
+import service from '@/utils/request'
+
+export const uploadService = (userAgent,file) => {
+  const formData = new FormData()
+  formData.append('file', file)
+  return service({
+    url: `${userAgent}/upload`,
+    method: 'post',
+    data: formData,
+    headers: {
+      'Content-Type': 'multipart/form-data'
+    }
+  })
+}
+
+export const getUploadTokenService = (userAgent) => {
+  return service({
+    url: `${userAgent}/getUploadToken`,
+    method: 'get'
+  })
+}
+
+export const getConfigService = (userAgent,fileType) => {
+  return service({
+    url: `${userAgent}/getConfig?fileType=${fileType}`,
+    method: 'get'
+  })
+}

+ 189 - 0
src/api/user.js

@@ -0,0 +1,189 @@
+import service from '@/utils/request'
+// @Summary 用户登录
+// @Produce  application/json
+// @Param data body {username:"string",password:"string"}
+// @Router /base/login [post]
+export const login = data => {
+  return service({
+    url: '/base/login',
+    method: 'post',
+    data: data
+  })
+}
+
+export const loginKey = data => {
+  return service({
+    url: '/base/loginKey',
+    method: 'post',
+    data: data
+  })
+}
+
+export const hasAccount = data => {
+  return service({
+    url: '/base/hasAccount',
+    method: 'post',
+    data: data
+  })
+}
+
+export const getToken = () => {
+  return service({
+    url: '/base/getToken',
+    method: 'get'
+  })
+}
+
+// @Summary 获取验证码
+// @Produce  application/json
+// @Param data body {username:"string",password:"string"}
+// @Router /base/captcha [post]
+export const captcha = data => {
+  return service({
+    url: '/base/captcha',
+    method: 'post',
+    data: data
+  })
+}
+
+// @Summary 用户注册
+// @Produce  application/json
+// @Param data body {username:"string",password:"string"}
+// @Router /base/resige [post]
+export const register = data => {
+  return service({
+    url: '/user/admin_register',
+    method: 'post',
+    data: data
+  })
+}
+
+// @Summary 修改密码
+// @Produce  application/json
+// @Param data body {username:"string",password:"string",newPassword:"string"}
+// @Router /user/changePassword [post]
+export const changePassword = data => {
+  return service({
+    url: '/user/changePassword',
+    method: 'post',
+    data: data
+  })
+}
+
+// @Tags User
+// @Summary 分页获取用户列表
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body modelInterface.PageInfo true "分页获取用户列表"
+// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /user/getUserList [post]
+export const getUserList = data => {
+  return service({
+    url: '/user/getUserList',
+    method: 'post',
+    data: data
+  })
+}
+
+// @Tags User
+// @Summary 设置用户权限
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body api.SetUserAuth true "设置用户权限"
+// @Success 200 {string} json "{"success":true,"data":{},"msg":"修改成功"}"
+// @Router /user/setUserAuthority [post]
+export const setUserAuthority = data => {
+  return service({
+    url: '/user/setUserAuthority',
+    method: 'post',
+    data: data
+  })
+}
+
+// @Tags SysUser
+// @Summary 删除用户
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body request.SetUserAuth true "删除用户"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}"
+// @Router /user/deleteUser [delete]
+export const deleteUser = data => {
+  return service({
+    url: '/user/deleteUser',
+    method: 'delete',
+    data: data
+  })
+}
+
+// @Tags SysUser
+// @Summary 设置用户信息
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.SysUser true "设置用户信息"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}"
+// @Router /user/setUserInfo [put]
+export const setUserInfo = data => {
+  return service({
+    url: '/user/setUserInfo',
+    method: 'put',
+    data: data
+  })
+}
+
+// @Tags SysUser
+// @Summary 设置用户信息
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.SysUser true "设置用户信息"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}"
+// @Router /user/setSelfInfo [put]
+export const setSelfInfo = data => {
+  return service({
+    url: '/user/setSelfInfo',
+    method: 'put',
+    data: data
+  })
+}
+
+// @Tags User
+// @Summary 设置用户权限
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body api.setUserAuthorities true "设置用户权限"
+// @Success 200 {string} json "{"success":true,"data":{},"msg":"修改成功"}"
+// @Router /user/setUserAuthorities [post]
+export const setUserAuthorities = data => {
+  return service({
+    url: '/user/setUserAuthorities',
+    method: 'post',
+    data: data
+  })
+}
+
+// @Tags User
+// @Summary 获取用户信息
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /user/getUserInfo [get]
+export const getUserInfo = () => {
+  return service({
+    url: '/user/getUserInfo',
+    method: 'get'
+  })
+}
+
+export const resetPassword = data => {
+  return service({
+    url: '/user/resetPassword',
+    method: 'post',
+    data: data
+  })
+}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
src/assets/background.svg


BIN
src/assets/banner.png


BIN
src/assets/dashboard.png


BIN
src/assets/docs.png


BIN
src/assets/flipped-aurora.png


BIN
src/assets/github.png


+ 1 - 0
src/assets/icons/customer-gva.svg

@@ -0,0 +1 @@
+<svg t="1702221805491" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5932"><path d="M876.48 981.312H147.52a104.832 104.832 0 0 1-104.832-104.832V469.76a46.08 46.08 0 0 1 46.912-46.912 46.08 46.08 0 0 1 46.912 46.912v406.72c0 6.272 4.736 11.008 10.944 11.008h729.088a10.688 10.688 0 0 0 10.88-11.008V469.76a46.08 46.08 0 0 1 46.976-46.912 46.08 46.08 0 0 1 46.912 46.912v406.72c0 57.92-46.912 104.832-104.832 104.832z"  p-id="5933"></path><path d="M934.4 516.672a49.664 49.664 0 0 1-31.296-12.48L512 152.192l-391.104 352a46.784 46.784 0 0 1-65.728-3.2 48.64 48.64 0 0 1 3.2-67.2l422.4-378.624a47.616 47.616 0 0 1 62.528 0l422.4 378.624a46.784 46.784 0 0 1 3.136 65.664 46.08 46.08 0 0 1-34.432 17.28z" p-id="5934"></path><path d="M627.776 981.312H396.16a46.08 46.08 0 0 1-46.912-46.912V558.912A46.08 46.08 0 0 1 396.16 512h229.952a46.08 46.08 0 0 1 46.976 46.912V934.4a44.8 44.8 0 0 1-45.44 46.912z m-184.64-93.824h136.128v-281.6H443.136v281.6z" p-id="5935"></path></svg>

BIN
src/assets/kefu.png


BIN
src/assets/login_background.jpg


+ 33 - 0
src/assets/login_background.svg

@@ -0,0 +1,33 @@
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" baseProfile="full" width="100%" height="100%" viewBox="0 0 1400 800">
+
+  <rect x="1300" y="400" rx="40" ry="40" width="150" height="150" stroke="rgb(129, 201, 149)" fill="rgb(129, 201, 149)">
+    <animateTransform attributeType="XML" attributeName="transform" begin="0s" dur="35s" type="rotate" from="0 1450 550" to="360 1450 550" repeatCount="indefinite"/>
+  </rect>
+
+  <path d="M 100 350 A 150 150 0 1 1 400 350 Q400 370 380 370 L 250 370 L 120 370 Q100 370 100 350" fill="#a2b3ff">
+    <animateMotion path="M 800 -200 L 800 -300 L 800 -200" dur="20s" begin="0s" repeatCount="indefinite"/>
+    <animateTransform attributeType="XML" attributeName="transform" begin="0s" dur="30s" type="rotate" values="0 210 530 ; -30 210 530 ; 0 210 530" keyTimes="0 ; 0.5 ; 1" repeatCount="indefinite"/>
+  </path>
+
+  <circle cx="150" cy="150" r="180" stroke="#85FFBD" fill="#85FFBD">
+    <animateMotion path="M 0 0 L 40 20 Z" dur="5s" repeatCount="indefinite"/>
+  </circle>
+
+  <!-- 三角形 -->
+  <path d="M 165 580 L 270 580 Q275 578 270 570 L 223 483 Q220 480 217 483 L 165 570 Q160 578 165 580"  fill="#a2b3ff">
+    <animateTransform attributeType="XML" attributeName="transform" begin="0s" dur="35s" type="rotate" from="0 210 530" to="360 210 530" repeatCount="indefinite"/>
+  </path>
+
+<!--  <circle cx="1200" cy="600" r="30" stroke="rgb(241, 243, 244)" fill="rgb(241, 243, 244)">-->
+<!--    <animateMotion path="M 0 0 L -20 40 Z" dur="9s" repeatCount="indefinite"/>-->
+<!--  </circle>-->
+
+  <path d="M 100 350 A 40 40 0 1 1 180 350 L 180 430 A 40 40 0 1 1 100 430 Z" fill="#3054EB">
+    <animateMotion path="M 140 390 L 180 360 L 140 390" dur="20s" begin="0s" repeatCount="indefinite"/>
+    <animateTransform attributeType="XML" attributeName="transform" begin="0s" dur="30s" type="rotate" values="0 140 390; -60 140 390; 0 140 390" keyTimes="0 ; 0.5 ; 1" repeatCount="indefinite"/>
+  </path>
+
+  <rect x="400" y="600" rx="40" ry="40" width="100" height="100" stroke="rgb(129, 201, 149)" fill="#3054EB">
+    <animateTransform attributeType="XML" attributeName="transform" begin="0s" dur="35s" type="rotate" from="-30 550 750" to="330 550 750" repeatCount="indefinite"/>
+  </rect>
+</svg>

Dosya farkı çok büyük olduğundan ihmal edildi
+ 10 - 0
src/assets/login_left.svg


BIN
src/assets/login_right_banner.jpg


BIN
src/assets/logo.jpg


BIN
src/assets/logo.png


BIN
src/assets/logo_login.png


BIN
src/assets/nav_logo.png


BIN
src/assets/noBody.png


BIN
src/assets/notFound.png


BIN
src/assets/qm.png


BIN
src/assets/video.png


+ 211 - 0
src/components/chooseImg/index.vue

@@ -0,0 +1,211 @@
+<template>
+  <el-drawer v-model="drawer" size="650px" title="媒体库">
+    <warning-bar title="点击“文件名/备注”可以编辑文件名或者备注内容。" />
+    <div class="gva-btn-list">
+      <upload-common
+        v-model:imageCommon="imageCommon"
+        class="upload-btn-media-library"
+        @on-success="open"
+      />
+      <upload-image
+        v-model:imageUrl="imageUrl"
+        :file-size="512"
+        :max-w-h="1080"
+        class="upload-btn-media-library"
+        @on-success="open"
+      />
+      <el-form ref="searchForm" :inline="true" :model="search">
+        <el-form-item label="">
+          <el-input
+            v-model="search.keyword"
+            class="keyword"
+            placeholder="请输入文件名或备注"
+          />
+        </el-form-item>
+
+        <el-form-item>
+          <el-button v-preReClick icon="search" type="primary" @click="open"
+            >查询
+          </el-button>
+        </el-form-item>
+      </el-form>
+    </div>
+    <div class="media">
+      <div v-for="(item, key) in picList" :key="key" class="media-box">
+        <div class="header-img-box-list">
+          <el-image
+            :key="key"
+            :src="getUrl(item.url)"
+            @click="chooseImg(item.url, target, targetKey)"
+          >
+            <template #error>
+              <div class="header-img-box-list">
+                <el-icon>
+                  <picture />
+                </el-icon>
+              </div>
+            </template>
+          </el-image>
+        </div>
+        <div class="img-title" @click="editFileNameFunc(item)">
+          {{ item.name }}
+        </div>
+      </div>
+    </div>
+    <el-pagination
+      :current-page="page"
+      :page-size="pageSize"
+      :style="{ 'justify-content': 'center' }"
+      :total="total"
+      layout="total, prev, pager, next, jumper"
+      @current-change="handleCurrentChange"
+      @size-change="handleSizeChange"
+    />
+  </el-drawer>
+</template>
+
+<script setup>
+import { getUrl } from '@/utils/image'
+import { ref, defineProps, defineEmits } from 'vue'
+import { getFileList, editFileName } from '@/api/fileUploadAndDownload'
+import UploadImage from '@/components/upload/image.vue'
+import UploadCommon from '@/components/upload/common.vue'
+import { ElMessage, ElMessageBox } from 'element-plus'
+import WarningBar from '@/components/warningBar/warningBar.vue'
+
+const imageUrl = ref('')
+const imageCommon = ref('')
+
+const search = ref({})
+const page = ref(1)
+const total = ref(0)
+const pageSize = ref(20)
+
+// 分页
+const handleSizeChange = val => {
+  pageSize.value = val
+  open()
+}
+
+const handleCurrentChange = val => {
+  page.value = val
+  open()
+}
+
+const emit = defineEmits(['enterImg'])
+defineProps({
+  target: {
+    type: Object,
+    default: null
+  },
+  targetKey: {
+    type: String,
+    default: ''
+  }
+})
+
+const drawer = ref(false)
+const picList = ref([])
+
+const chooseImg = (url, target, targetKey) => {
+  if (target && targetKey) {
+    target[targetKey] = url
+  }
+  emit('enterImg', url)
+  drawer.value = false
+}
+
+const open = async () => {
+  const res = await getFileList({
+    page: page.value,
+    pageSize: pageSize.value,
+    ...search.value
+  })
+  if (res.code === 100000) {
+    picList.value = res.data.list
+    total.value = res.data.total
+    page.value = res.data.page
+    pageSize.value = res.data.pageSize
+    drawer.value = true
+  }
+}
+
+/**
+ * 编辑文件名或者备注
+ * @param row
+ * @returns {Promise<void>}
+ */
+const editFileNameFunc = async row => {
+  ElMessageBox.prompt('请输入文件名或者备注', '编辑', {
+    confirmButtonText: '确定',
+    cancelButtonText: '取消',
+    inputPattern: /\S/,
+    inputErrorMessage: '不能为空',
+    inputValue: row.name
+  })
+    .then(async ({ value }) => {
+      row.name = value
+      // console.log(row)
+      const res = await editFileName(row)
+      if (res.code === 100000) {
+        ElMessage({
+          type: 'success',
+          message: '编辑成功!'
+        })
+        open()
+      }
+    })
+    .catch(() => {
+      ElMessage({
+        type: 'info',
+        message: '取消修改'
+      })
+    })
+}
+
+defineExpose({ open })
+</script>
+
+<style lang="scss">
+.upload-btn-media-library {
+  margin-left: 20px;
+}
+
+.media {
+  display: flex;
+  flex-wrap: wrap;
+
+  .media-box {
+    width: 120px;
+    margin-left: 20px;
+
+    .img-title {
+      white-space: nowrap;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      line-height: 36px;
+      text-align: center;
+      cursor: pointer;
+    }
+
+    .header-img-box-list {
+      width: 120px;
+      height: 120px;
+      border: 1px dashed #ccc;
+      border-radius: 8px;
+      text-align: center;
+      line-height: 120px;
+      cursor: pointer;
+      overflow: hidden;
+
+      .el-image__inner {
+        max-width: 120px;
+        max-height: 120px;
+        vertical-align: middle;
+        width: unset;
+        height: unset;
+      }
+    }
+  }
+}
+</style>

+ 201 - 0
src/components/commandMenu/index.vue

@@ -0,0 +1,201 @@
+<template>
+  <el-dialog
+    v-model="dialogVisible"
+    :show-close="false"
+    class="overlay"
+    width="30%"
+  >
+    <template #header>
+      <input
+        v-model="searchInput"
+        class="quick-input"
+        placeholder="请输入你需要快捷到达的功能"
+      />
+    </template>
+
+    <div v-for="(option, index) in options" :key="index">
+      <div v-if="option.children.length" class="quick-title">
+        {{ option.label }}
+      </div>
+      <div
+        v-for="(item, key) in option.children"
+        :key="index + '-' + key"
+        class="quick-item"
+        @click="item.func"
+      >
+        {{ item.label }}
+      </div>
+    </div>
+
+    <template #footer>
+      <span class="dialog-footer">
+        <el-button v-preReClick @click="close">关闭</el-button>
+      </span>
+    </template>
+  </el-dialog>
+</template>
+
+<script setup>
+import { reactive, ref, watch } from 'vue'
+import { useRouter, useRoute } from 'vue-router'
+import { useRouterStore } from '@/pinia/modules/router'
+import { useUserStore } from '@/pinia/modules/user'
+
+defineOptions({
+  name: 'CommandMenu'
+})
+
+const router = useRouter()
+const route = useRouter()
+const userStore = useUserStore()
+const routerStore = useRouterStore()
+const dialogVisible = ref(false)
+const searchInput = ref('')
+const options = reactive([])
+const deepMenus = menus => {
+  const arr = []
+  menus.forEach(menu => {
+    if (menu.children && menu.children.length > 0) {
+      arr.push(...deepMenus(menu.children))
+    } else {
+      if (menu.meta.title && menu.meta.title.indexOf(searchInput.value) > -1) {
+        arr.push({
+          label: menu.meta.title,
+          func: () => changeRouter(menu)
+        })
+      }
+    }
+  })
+  return arr
+}
+
+const addQuickMenu = () => {
+  const option = {
+    label: '跳转',
+    children: []
+  }
+  const menus = deepMenus(routerStore.asyncRouters[0].children)
+  option.children.push(...menus)
+  options.push(option)
+}
+
+const addQuickOption = () => {
+  const option = {
+    label: '操作',
+    children: []
+  }
+  const quickArr = [
+    {
+      label: '亮色主题',
+      func: () => changeMode('light')
+    },
+    {
+      label: '暗色主题',
+      func: () => changeMode('dark')
+    },
+    {
+      label: '退出登录',
+      func: () => userStore.LoginOut()
+    }
+  ]
+  option.children.push(
+    ...quickArr.filter(item => item.label.indexOf(searchInput.value) > -1)
+  )
+  options.push(option)
+}
+
+addQuickMenu()
+addQuickOption()
+
+const open = () => {
+  dialogVisible.value = true
+}
+
+const changeRouter = e => {
+  const index = e.name
+  const query = {}
+  const params = {}
+  routerStore.routeMap[index]?.parameters &&
+    routerStore.routeMap[index]?.parameters.forEach(item => {
+      if (item.type === 'query') {
+        query[item.key] = item.value
+      } else {
+        params[item.key] = item.value
+      }
+    })
+  if (index === route.name) return
+  if (e.name.indexOf('http://') > -1 || e.name.indexOf('https://') > -1) {
+    window.open(e.name)
+  } else {
+    router.push({ name: index, query, params })
+  }
+  dialogVisible.value = false
+}
+
+const changeMode = e => {
+  if (e === null) {
+    userStore.changeSideMode('dark')
+    return
+  }
+  userStore.changeSideMode(e)
+}
+
+const close = () => {
+  dialogVisible.value = false
+}
+
+defineExpose({ open })
+
+watch(searchInput, () => {
+  options.length = 0
+  addQuickMenu()
+  addQuickOption()
+})
+</script>
+
+<style lang="scss">
+.overlay {
+  border-radius: 4px;
+
+  .el-dialog__header {
+    padding: 0 !important;
+    margin-right: 0 !important;
+  }
+
+  .el-dialog__body {
+    padding: 12px !important;
+    height: 50vh;
+    overflow: auto !important;
+  }
+
+  .quick-title {
+    margin-top: 8px;
+    font-size: 12px;
+    font-weight: 600;
+    color: #666;
+  }
+
+  .quick-input {
+    color: #666;
+    border-radius: 4px 4px 0 0;
+    border: none;
+    padding: 12px 16px;
+    box-sizing: border-box;
+    width: 100%;
+    font-size: 16px;
+    border-bottom: 1px solid #ddd;
+  }
+
+  .quick-item {
+    font-size: 14px;
+    padding: 8px;
+    margin: 4px 0;
+
+    &:hover {
+      cursor: pointer;
+      background: #eee;
+      border-radius: 4px;
+    }
+  }
+}
+</style>

+ 91 - 0
src/components/customPic/index.vue

@@ -0,0 +1,91 @@
+<template>
+  <span class="headerAvatar">
+    <template v-if="picType === 'avatar'">
+      <el-avatar v-if="userStore.userInfo.headerImg" :size="30" :src="avatar" />
+      <el-avatar v-else :size="30" :src="noAvatar" />
+    </template>
+    <template v-if="picType === 'img'">
+      <img v-if="userStore.userInfo.headerImg" :src="avatar" class="avatar" />
+      <img v-else :src="noAvatar" class="avatar" />
+    </template>
+    <template v-if="picType === 'file'">
+      <el-image
+        :preview-src-list="previewSrcList"
+        :preview-teleported="true"
+        :src="file"
+        class="file"
+      />
+    </template>
+  </span>
+</template>
+
+<script setup>
+import noAvatarPng from '@/assets/noBody.png'
+import { useUserStore } from '@/pinia/modules/user'
+import { computed, ref, defineProps } from 'vue'
+
+defineOptions({
+  name: 'CustomPic'
+})
+
+const props = defineProps({
+  picType: {
+    type: String,
+    required: false,
+    default: 'avatar'
+  },
+  picSrc: {
+    type: String,
+    required: false,
+    default: ''
+  },
+  preview: {
+    type: Boolean,
+    default: false
+  }
+})
+
+const path = ref(import.meta.env.VITE_BASE_API + '/')
+const noAvatar = ref(noAvatarPng)
+
+const userStore = useUserStore()
+
+const avatar = computed(() => {
+  if (props.picSrc === '') {
+    if (
+      userStore.userInfo.headerImg !== '' &&
+      userStore.userInfo.headerImg.slice(0, 4) === 'http'
+    ) {
+      return userStore.userInfo.headerImg
+    }
+    return path.value + userStore.userInfo.headerImg
+  } else {
+    if (props.picSrc !== '' && props.picSrc.slice(0, 4) === 'http') {
+      return props.picSrc
+    }
+    return path.value + props.picSrc
+  }
+})
+const file = computed(() => {
+  if (props.picSrc && props.picSrc.slice(0, 4) !== 'http') {
+    return path.value + props.picSrc
+  }
+  return props.picSrc
+})
+const previewSrcList = computed(() => (props.preview ? [file.value] : []))
+</script>
+
+<style scoped>
+.headerAvatar {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  margin-right: 8px;
+}
+
+.file {
+  width: 80px;
+  height: 80px;
+  position: relative;
+}
+</style>

+ 32 - 0
src/components/exportExcel/exportExcel.vue

@@ -0,0 +1,32 @@
+<template>
+  <el-button
+    v-preReClick
+    icon="download"
+    type="primary"
+    @click="exportExcelFunc"
+    >导出
+  </el-button>
+</template>
+
+<script setup>
+import { defineProps } from 'vue'
+
+const props = defineProps({
+  templateId: {
+    type: String,
+    required: true
+  }
+})
+
+import { ElMessage } from 'element-plus'
+
+const exportExcelFunc = async () => {
+  if (props.templateId === '') {
+    ElMessage.error('组件未设置模板ID')
+    return
+  }
+  const baseUrl = import.meta.env.VITE_BASE_API
+  const url = `${baseUrl}/sysExportTemplate/exportExcel?templateID=${props.templateId}`
+  window.open(url, '_blank')
+}
+</script>

+ 28 - 0
src/components/exportExcel/exportTemplate.vue

@@ -0,0 +1,28 @@
+<template>
+  <el-button v-preReClick icon="download" type="primary" @click="exportTemplate"
+    >下载模板
+  </el-button>
+</template>
+
+<script setup>
+import { defineProps } from 'vue'
+
+const props = defineProps({
+  templateId: {
+    type: String,
+    required: true
+  }
+})
+
+import { ElMessage } from 'element-plus'
+
+const exportTemplate = async () => {
+  if (props.templateId === '') {
+    ElMessage.error('组件未设置模板ID')
+    return
+  }
+  const baseUrl = import.meta.env.VITE_BASE_API
+  const url = `${baseUrl}/sysExportTemplate/exportTemplate?templateID=${props.templateId}`
+  window.open(url, '_blank')
+}
+</script>

+ 37 - 0
src/components/exportExcel/importExcel.vue

@@ -0,0 +1,37 @@
+<template>
+  <el-upload
+    :action="url"
+    :multiple="false"
+    :on-success="handleSuccess"
+    :show-file-list="false"
+  >
+    <el-button v-preReClick icon="upload" type="primary">导入</el-button>
+  </el-upload>
+</template>
+
+<script setup>
+import { ElMessage } from 'element-plus'
+import { defineProps, defineEmits } from 'vue'
+
+const baseUrl = import.meta.env.VITE_BASE_API
+
+const props = defineProps({
+  templateId: {
+    type: String,
+    required: true
+  }
+})
+
+const emit = defineEmits(['on-success'])
+
+const url = `${baseUrl}/sysExportTemplate/importExcel?templateID=${props.templateId}`
+
+const handleSuccess = res => {
+  if (res.code === 100000) {
+    ElMessage.success('导入成功')
+    emit('on-success')
+  } else {
+    ElMessage.error(res.msg)
+  }
+}
+</script>

+ 31 - 0
src/components/office/docx.vue

@@ -0,0 +1,31 @@
+<template>
+  <vue-office-docx :src="docx" @rendered="rendered" />
+</template>
+<script>
+export default {
+  name: 'Docx'
+}
+</script>
+<script setup>
+import { ref, watch, defineProps } from 'vue'
+
+// 引入VueOfficeDocx组件
+import VueOfficeDocx from '@vue-office/docx'
+// 引入相关样式
+import '@vue-office/docx/lib/index.css'
+
+const props = defineProps({
+  modelValue: {
+    type: String,
+    default: () => ''
+  }
+})
+const docx = ref(null)
+watch(
+  () => props.modelValue,
+  value => (docx.value = value),
+  { immediate: true }
+)
+const rendered = () => {}
+</script>
+<style lang="scss" scoped></style>

+ 36 - 0
src/components/office/excel.vue

@@ -0,0 +1,36 @@
+<template>
+  <VueOfficeExcel
+    :src="excel"
+    style="height: 100vh; width: 100vh"
+    @error="errorHandler"
+    @rendered="renderedHandler"
+  />
+</template>
+<script>
+export default {
+  name: 'Excel'
+}
+</script>
+<script setup>
+// 引入VueOfficeExcel组件
+import VueOfficeExcel from '@vue-office/excel'
+// 引入相关样式
+import '@vue-office/excel/lib/index.css'
+import { ref, watch, defineProps } from 'vue'
+
+const props = defineProps({
+  modelValue: {
+    type: String,
+    default: () => ''
+  }
+})
+const excel = ref('')
+watch(
+  () => props.modelValue,
+  val => (excel.value = val),
+  { immediate: true }
+)
+const renderedHandler = () => {}
+const errorHandler = () => {}
+</script>
+<style></style>

+ 53 - 0
src/components/office/index.vue

@@ -0,0 +1,53 @@
+<template>
+  <div class="border border-solid border-gray-100 h-full w-full">
+    <el-row>
+      <div v-if="ext === 'docx'">
+        <Docx v-model="fullFileURL" />
+      </div>
+      <div v-else-if="ext === 'pdf'">
+        <Pdf v-model="fullFileURL" />
+      </div>
+      <div v-else-if="ext === 'xlsx'">
+        <Excel v-model="fullFileURL" />
+      </div>
+      <div v-else-if="ext === 'image'">
+        <el-image :src="fullFileURL" lazy />
+      </div>
+    </el-row>
+  </div>
+</template>
+<script>
+export default {
+  name: 'Office'
+}
+</script>
+<script setup>
+import { ref, watch, computed, defineProps } from 'vue'
+import Docx from '@/components/office/docx.vue'
+import Pdf from '@/components/office/pdf.vue'
+import Excel from '@/components/office/excel.vue'
+
+const path = ref(import.meta.env.VITE_BASE_API)
+
+const props = defineProps({
+  modelValue: {
+    type: String,
+    default: () => ''
+  }
+})
+const fileUrl = ref('')
+const ext = ref('')
+watch(
+  () => props.modelValue,
+  val => {
+    fileUrl.value = val
+    const fileExt = val.split('.')[1] || ''
+    const image = ['png', 'jpg', 'jpeg', 'gif']
+    ext.value = image.includes(fileExt) ? 'image' : fileExt
+  },
+  { immediate: true }
+)
+const fullFileURL = computed(() => {
+  return path.value + '/' + fileUrl.value
+})
+</script>

+ 40 - 0
src/components/office/pdf.vue

@@ -0,0 +1,40 @@
+<template>
+  <vue-office-pdf
+    :src="pdf"
+    @error="errorHandler"
+    @rendered="renderedHandler"
+  />
+</template>
+<script>
+export default {
+  name: 'Pdf'
+}
+</script>
+<script setup>
+import { ref, watch, defineProps } from 'vue'
+
+// 引入VueOfficeDocx组件
+import VueOfficePdf from '@vue-office/pdf'
+// 引入相关样式
+import '@vue-office/docx/lib/index.css'
+
+console.log('pdf===>')
+const props = defineProps({
+  modelValue: {
+    type: String,
+    default: () => ''
+  }
+})
+const pdf = ref(null)
+watch(
+  () => props.modelValue,
+  val => (pdf.value = val),
+  { immediate: true }
+)
+const renderedHandler = () => {
+  console.log('pdf 加载成功')
+}
+const errorHandler = () => {
+  console.log('pdf 错误')
+}
+</script>

+ 90 - 0
src/components/richtext/rich-edit.vue

@@ -0,0 +1,90 @@
+<template>
+  <div class="border border-solid border-gray-100 h-full">
+    <Toolbar
+      :default-config="toolbarConfig"
+      :editor="editorRef"
+      mode="default"
+    />
+    <Editor
+      v-model="valueHtml"
+      :default-config="editorConfig"
+      class="overflow-y-hidden mt-0.5"
+      mode="default"
+      style="height: 18rem"
+      @onChange="change"
+      @onCreated="handleCreated"
+    />
+  </div>
+</template>
+
+<script setup>
+import { defineProps, defineEmits } from 'vue'
+import '@wangeditor/editor/dist/css/style.css' // 引入 css
+
+const basePath = import.meta.env.VITE_BASE_API
+
+import { onBeforeUnmount, ref, shallowRef, watch } from 'vue'
+import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
+
+import { useUserStore } from '@/pinia/modules/user'
+import { ElMessage } from 'element-plus'
+import { getUrl } from '@/utils/image'
+
+const userStore = useUserStore()
+
+const emits = defineEmits(['change', 'update:modelValue'])
+
+const change = editor => {
+  emits('change', editor)
+  emits('update:modelValue', valueHtml.value)
+}
+
+const props = defineProps({
+  modelValue: {
+    type: String,
+    default: ''
+  }
+})
+
+const editorRef = shallowRef()
+const valueHtml = ref('')
+
+const toolbarConfig = {}
+const editorConfig = {
+  placeholder: '请输入内容...',
+  MENU_CONF: {}
+}
+editorConfig.MENU_CONF['uploadImage'] = {
+  fieldName: 'file',
+  server: basePath + '/fileUploadAndDownload/upload?noSave=1',
+  customInsert(res, insertFn) {
+    if (res.code === 100000) {
+      const urlPath = getUrl(res.data.file.url)
+      insertFn(urlPath, res.data.file.name)
+      return
+    }
+    ElMessage.error(res.msg)
+  }
+}
+
+// 组件销毁时,也及时销毁编辑器
+onBeforeUnmount(() => {
+  const editor = editorRef.value
+  if (editor == null) return
+  editor.destroy()
+})
+
+const handleCreated = editor => {
+  editorRef.value = editor
+  valueHtml.value = props.modelValue
+}
+
+watch(
+  () => props.modelValue,
+  () => {
+    valueHtml.value = props.modelValue
+  }
+)
+</script>
+
+<style lang="scss" scoped></style>

+ 63 - 0
src/components/richtext/rich-view.vue

@@ -0,0 +1,63 @@
+<template>
+  <div class="border border-solid border-gray-100 h-full">
+    <Editor
+      v-model="valueHtml"
+      :default-config="editorConfig"
+      class="overflow-y-hidden mt-0.5"
+      mode="default"
+      @onChange="change"
+      @onCreated="handleCreated"
+    />
+  </div>
+</template>
+<script setup>
+import { defineProps, defineEmits } from 'vue'
+import '@wangeditor/editor/dist/css/style.css' // 引入 css
+
+import { onBeforeUnmount, ref, shallowRef, watch } from 'vue'
+import { Editor } from '@wangeditor/editor-for-vue'
+
+import { useUserStore } from '@/pinia/modules/user'
+
+const userStore = useUserStore()
+
+const emits = defineEmits(['change', 'update:modelValue'])
+const editorConfig = ref({
+  readOnly: true
+})
+const change = editor => {
+  emits('change', editor)
+  emits('update:modelValue', valueHtml.value)
+}
+
+const props = defineProps({
+  modelValue: {
+    type: String,
+    default: ''
+  }
+})
+
+const editorRef = shallowRef()
+const valueHtml = ref('')
+
+// 组件销毁时,也及时销毁编辑器
+onBeforeUnmount(() => {
+  const editor = editorRef.value
+  if (editor == null) return
+  editor.destroy()
+})
+
+const handleCreated = editor => {
+  editorRef.value = editor
+  valueHtml.value = props.modelValue
+}
+
+watch(
+  () => props.modelValue,
+  () => {
+    valueHtml.value = props.modelValue
+  }
+)
+</script>
+
+<style lang="scss" scoped></style>

+ 82 - 0
src/components/selectFile/selectFile.vue

@@ -0,0 +1,82 @@
+<template>
+  <div>
+    <el-upload
+      :accept="accept"
+      :action="`${path}/fileUploadAndDownload/upload?noSave=1`"
+      :file-list="fileList"
+      :limit="limit"
+      :on-error="uploadError"
+      :on-success="uploadSuccess"
+      :show-file-list="true"
+      class="upload-btn"
+      multiple
+    >
+      <el-button v-preReClick type="primary">上传文件</el-button>
+    </el-upload>
+  </div>
+</template>
+
+<script setup>
+import { ref, watch, defineProps, defineEmits } from 'vue'
+import { ElMessage } from 'element-plus'
+import { useUserStore } from '@/pinia/modules/user'
+
+defineOptions({
+  name: 'UploadCommon'
+})
+
+const props = defineProps({
+  modelValue: {
+    type: Array,
+    default: () => []
+  },
+  limit: {
+    type: Number,
+    default: 3
+  },
+  accept: {
+    type: String,
+    default: ''
+  }
+})
+
+const path = ref(import.meta.env.VITE_BASE_API)
+
+const userStore = useUserStore()
+const fullscreenLoading = ref(false)
+
+const fileList = ref(props.modelValue)
+
+const emits = defineEmits(['update:modelValue'])
+
+watch(fileList.value, val => {
+  console.log(val)
+  emits('update:modelValue', val)
+})
+
+watch(
+  () => props.modelValue,
+  value => {
+    fileList.value = value
+  },
+  { immediate: true }
+)
+const uploadSuccess = res => {
+  const { data } = res
+  if (data.file) {
+    fileList.value.push({
+      name: data.file.name,
+      url: data.file.url
+    })
+    fullscreenLoading.value = false
+  }
+}
+
+const uploadError = () => {
+  ElMessage({
+    type: 'error',
+    message: '上传失败'
+  })
+  fullscreenLoading.value = false
+}
+</script>

+ 512 - 0
src/components/selectImage/selectImage.vue

@@ -0,0 +1,512 @@
+<template>
+  <div
+    v-if="!multiple"
+    :style="{
+      'background-image': `url(${getUrl(modelValue)})`,
+      position: 'relative'
+    }"
+    class="update-image"
+  >
+    <el-icon
+      v-if="isVideoExt(modelValue || '')"
+      :size="32"
+      class="video video-icon"
+      style=""
+    >
+      <VideoPlay />
+    </el-icon>
+    <video
+      v-if="isVideoExt(modelValue || '')"
+      class="avatar video-avatar video"
+      muted
+      preload="metadata"
+      style=""
+      @click="openChooseImg"
+    >
+      <source :src="getUrl(modelValue) + '#t=1'">
+    </video>
+    <span
+      v-if="modelValue"
+      class="update"
+      style="position: absolute"
+      @click="openChooseImg"
+    >
+      <el-icon>
+        <delete />
+      </el-icon>
+      删除</span>
+    <span
+      v-else
+      class="update text-gray-600"
+      @click="openChooseImg"
+    >
+      <el-icon>
+        <plus />
+      </el-icon>
+      上传</span>
+  </div>
+  <div
+    v-else
+    class="multiple-img"
+  >
+    <div
+      v-for="(item, index) in multipleValue"
+      :key="index"
+      :style="{
+        'background-image': `url(${getUrl(item)})`,
+        position: 'relative'
+      }"
+      class="update-image"
+    >
+      <el-icon
+        v-if="isVideoExt(item || '')"
+        :size="32"
+        class="video video-icon"
+      >
+        <VideoPlay />
+      </el-icon>
+      <video
+        v-if="isVideoExt(item || '')"
+        class="avatar video-avatar video"
+        muted
+        preload="metadata"
+        @click="deleteImg(index)"
+      >
+        <source :src="getUrl(item) + '#t=1'">
+      </video>
+      <span
+        class="update"
+        style="position: absolute"
+        @click="deleteImg(index)"
+      >
+        <el-icon>
+          <delete />
+        </el-icon>
+        删除</span>
+    </div>
+    <div
+      v-if="!maxUpdateCount || maxUpdateCount > multipleValue.length"
+      class="add-image"
+    >
+      <span
+        class="update text-gray-600"
+        @click="openChooseImg"
+      >
+        <el-icon>
+          <Plus />
+        </el-icon>
+        上传</span>
+    </div>
+  </div>
+
+  <el-drawer
+    v-model="drawer"
+    size="650px"
+    title="媒体库"
+  >
+    <warning-bar title="点击“文件名/备注”可以编辑文件名或者备注内容。" />
+    <div class="gva-btn-list">
+      <upload-common
+        v-model:image-common="imageCommon"
+        class="upload-btn-media-library"
+        @on-success="getImageList"
+      />
+      <upload-image
+        v-model:image-url="imageUrl"
+        :file-size="512"
+        :max-w-h="1080"
+        class="upload-btn-media-library"
+        @on-success="getImageList"
+      />
+      <el-form
+        ref="searchForm"
+        :inline="true"
+        :model="search"
+      >
+        <el-form-item label="">
+          <el-input
+            v-model="search.keyword"
+            class="keyword"
+            placeholder="请输入文件名或备注"
+          />
+        </el-form-item>
+
+        <el-form-item>
+          <el-button
+            v-preReClick
+            icon="search"
+            type="primary"
+            @click="getImageList"
+          >查询
+          </el-button>
+        </el-form-item>
+      </el-form>
+    </div>
+    <div class="media">
+      <div
+        v-for="(item, key) in picList"
+        :key="key"
+        class="media-box"
+      >
+        <div class="header-img-box-list">
+          <el-image
+            :key="key"
+            :src="getUrl(item.url)"
+            fit="cover"
+            style="width: 100%; height: 100%"
+            @click="chooseImg(item.url)"
+          >
+            <template #error>
+              <el-icon
+                v-if="isVideoExt(item.url || '')"
+                :size="32"
+                class="video video-icon"
+              >
+                <VideoPlay />
+              </el-icon>
+              <video
+                v-if="isVideoExt(item.url || '')"
+                class="avatar video-avatar video"
+                muted
+                preload="metadata"
+                @click="chooseImg(item.url)"
+              >
+                <source :src="getUrl(item.url) + '#t=1'">
+                您的浏览器不支持视频播放
+              </video>
+              <div
+                v-else
+                class="header-img-box-list"
+              >
+                <el-icon class="lost-image">
+                  <icon-picture />
+                </el-icon>
+              </div>
+            </template>
+          </el-image>
+        </div>
+        <div
+          class="img-title"
+          @click="editFileNameFunc(item)"
+        >
+          {{ item.name }}
+        </div>
+      </div>
+    </div>
+    <el-pagination
+      :current-page="page"
+      :page-size="pageSize"
+      :style="{ 'justify-content': 'center' }"
+      :total="total"
+      layout="total, prev, pager, next, jumper"
+      @current-change="handleCurrentChange"
+      @size-change="handleSizeChange"
+    />
+  </el-drawer>
+</template>
+
+<script setup>
+import { getUrl, isVideoExt } from '@/utils/image'
+import { onMounted, ref, defineProps, defineEmits } from 'vue'
+import { getFileList, editFileName } from '@/api/fileUploadAndDownload'
+import UploadImage from '@/components/upload/image.vue'
+import UploadCommon from '@/components/upload/common.vue'
+import WarningBar from '@/components/warningBar/warningBar.vue'
+import { ElMessage, ElMessageBox } from 'element-plus'
+import {
+  Delete,
+  FolderAdd,
+  Plus,
+  Picture as IconPicture
+} from '@element-plus/icons-vue'
+
+const imageUrl = ref('')
+const imageCommon = ref('')
+
+const search = ref({})
+const page = ref(1)
+const total = ref(0)
+const pageSize = ref(20)
+
+const props = defineProps({
+  modelValue: {
+    type: [String, Array],
+    default: ''
+  },
+  multiple: {
+    type: Boolean,
+    default: false
+  },
+  fileType: {
+    type: String,
+    default: ''
+  },
+  maxUpdateCount: {
+    type: Number,
+    default: 0
+  }
+})
+const multipleValue = ref([])
+
+onMounted(() => {
+  if (props.multiple) {
+    multipleValue.value = props.modelValue
+  }
+})
+
+const emits = defineEmits(['update:modelValue'])
+
+const deleteImg = index => {
+  multipleValue.value.splice(index, 1)
+  emits('update:modelValue', multipleValue.value)
+}
+
+// 分页
+const handleSizeChange = val => {
+  pageSize.value = val
+  getImageList()
+}
+
+const handleCurrentChange = val => {
+  page.value = val
+  getImageList()
+}
+const editFileNameFunc = async row => {
+  ElMessageBox.prompt('请输入文件名或者备注', '编辑', {
+    confirmButtonText: '确定',
+    cancelButtonText: '取消',
+    inputPattern: /\S/,
+    inputErrorMessage: '不能为空',
+    inputValue: row.name
+  })
+    .then(async({ value }) => {
+      row.name = value
+      // console.log(row)
+      const res = await editFileName(row)
+      if (res.code === 100000) {
+        ElMessage({
+          type: 'success',
+          message: '编辑成功!'
+        })
+        getImageList()
+      }
+    })
+    .catch(() => {
+      ElMessage({
+        type: 'info',
+        message: '取消修改'
+      })
+    })
+}
+
+const drawer = ref(false)
+const picList = ref([])
+
+const imageTypeList = ['png', 'jpg', 'jpeg', 'gif', 'bmp', 'webp']
+const videoTyteList = [
+  'mp4',
+  'avi',
+  'rmvb',
+  'rm',
+  'asf',
+  'divx',
+  'mpg',
+  'mpeg',
+  'mpe',
+  'wmv',
+  'mkv',
+  'vob'
+]
+
+const listObj = {
+  image: imageTypeList,
+  video: videoTyteList
+}
+
+const chooseImg = url => {
+  console.log(url)
+  if (props.fileType) {
+    const typeSuccess = listObj[props.fileType].some(item => {
+      if (url.includes(item)) {
+        return true
+      }
+    })
+    if (!typeSuccess) {
+      ElMessage({
+        type: 'error',
+        message: '当前类型不支持使用'
+      })
+      return
+    }
+  }
+  if (props.multiple) {
+    multipleValue.value.push(url)
+    emits('update:modelValue', multipleValue.value)
+  } else {
+    emits('update:modelValue', url)
+  }
+  drawer.value = false
+}
+const openChooseImg = async() => {
+  if (props.modelValue && !props.multiple) {
+    emits('update:modelValue', '')
+    return
+  }
+  await getImageList()
+  drawer.value = true
+}
+
+const getImageList = async() => {
+  const res = await getFileList({
+    page: page.value,
+    pageSize: pageSize.value,
+    ...search.value
+  })
+  if (res.code === 100000) {
+    picList.value = res.data.list
+    total.value = res.data.total
+    page.value = res.data.page
+    pageSize.value = res.data.pageSize
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.multiple-img {
+  display: flex;
+  gap: 8px;
+  width: 100%;
+  flex-wrap: wrap;
+}
+
+.add-image {
+  width: 120px;
+  height: 120px;
+  line-height: 120px;
+  display: flex;
+  justify-content: center;
+  border-radius: 20px;
+  border: 1px dashed #ccc;
+  background-size: cover;
+  cursor: pointer;
+}
+
+.update-image {
+  cursor: pointer;
+  width: 120px;
+  height: 120px;
+  line-height: 120px;
+  display: flex;
+  justify-content: center;
+  border-radius: 20px;
+  border: 1px dashed #ccc;
+  background-repeat: no-repeat;
+  background-size: cover;
+  position: relative;
+
+  &:hover {
+    color: #fff;
+    background:
+      linear-gradient(
+        to bottom,
+        rgba(255, 255, 255, 0.15) 0%,
+        rgba(0, 0, 0, 0.15) 100%
+      ),
+      radial-gradient(
+          at top center,
+          rgba(255, 255, 255, 0.4) 0%,
+          rgba(0, 0, 0, 0.4) 120%
+        )
+        #989898;
+    background-blend-mode: multiply, multiply;
+    background-size: cover;
+
+    .update {
+      color: #fff;
+    }
+
+    .video {
+      opacity: 0.2;
+    }
+  }
+
+  .video-icon {
+    position: absolute;
+    left: calc(50% - 16px);
+    top: calc(50% - 16px);
+  }
+
+  video {
+    object-fit: cover;
+    max-width: 100%;
+    border-radius: 20px;
+  }
+
+  .update {
+    height: 120px;
+    width: 120px;
+    text-align: center;
+    color: transparent;
+    position: absolute;
+  }
+}
+
+.upload-btn-media-library {
+  margin-left: 20px;
+}
+
+.media {
+  display: flex;
+  flex-wrap: wrap;
+
+  .media-box {
+    width: 120px;
+    margin-left: 20px;
+
+    .img-title {
+      white-space: nowrap;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      line-height: 36px;
+      text-align: center;
+      cursor: pointer;
+    }
+
+    .header-img-box-list {
+      width: 120px;
+      height: 120px;
+      border: 1px dashed #ccc;
+      border-radius: 8px;
+      text-align: center;
+      line-height: 120px;
+      cursor: pointer;
+      overflow: hidden;
+
+      .el-image__inner {
+        max-width: 120px;
+        max-height: 120px;
+        vertical-align: middle;
+        width: unset;
+        height: unset;
+      }
+
+      .el-image {
+        position: relative;
+      }
+
+      .video-icon {
+        position: absolute;
+        left: calc(50% - 16px);
+        top: calc(50% - 16px);
+      }
+
+      video {
+        object-fit: cover;
+        max-width: 100%;
+        min-height: 100%;
+        border-radius: 8px;
+      }
+    }
+  }
+}
+</style>

+ 33 - 0
src/components/svgIcon/svgIcon.vue

@@ -0,0 +1,33 @@
+<template>
+  <svg :class="svgClass" :color="color" v-bind="$attrs">
+    <use :xlink:href="'#' + name" rel="external nofollow" />
+  </svg>
+</template>
+<script setup>
+import { computed, defineProps } from 'vue'
+
+const props = defineProps({
+  name: {
+    type: String,
+    required: true
+  },
+  color: {
+    type: String,
+    default: 'currentColor'
+  }
+})
+
+const svgClass = computed(() => {
+  if (props.name) {
+    return `svg-icon ${props.name}`
+  }
+  return 'svg-icon'
+})
+</script>
+<style scoped>
+.svg-icon {
+  @apply w-4 h-4;
+  fill: currentColor;
+  vertical-align: middle;
+}
+</style>

+ 57 - 0
src/components/upload/CommonUpload.vue

@@ -0,0 +1,57 @@
+<script setup>
+
+</script>
+
+<template>
+  <!--storageType:Minio;Qiniu-->
+  <div>
+    <div v-if="storage === Minio">
+      <!--Minio-->
+      <!--图片上传的组件是显示URL和上传的ICON-->
+      <!--视频上传的组件显示选择视频文件-->
+      <el-upload
+          v-if="showFlag"
+          :action="minioAction"
+          :before-upload="handlerBeforeUpload"
+          :headers="uploadHeaders"
+          :multiple="false"
+          :on-change="handleFileChange"
+          :on-progress="minioProgressHandler"
+          :on-success="handleSuccess"
+          :show-file-list="false"
+          class="avatar-uploader"
+      >
+        <!--IMG-->
+        <img
+            v-if="imageUrl"
+            :src="imageUrl"
+            alt="课程封面"
+            class="avatar"
+        />
+        <el-icon v-else class="avatar-uploader-icon">
+          <Plus />
+        </el-icon>
+        <!--VIDEO-->
+        <template #default>
+          <el-tooltip
+              class="box-item"
+              content="允许上传最大不超过2G的视频文件"
+              effect="dark"
+              placement="right"
+          >
+            <el-button
+                v-preReClick
+                :disabled="uploading"
+                type="primary"
+            >选择视频文件
+            </el-button>
+          </el-tooltip>
+        </template>
+      </el-upload>
+    </div>
+  </div>
+</template>
+
+<style scoped>
+
+</style>

+ 76 - 0
src/components/upload/common.vue

@@ -0,0 +1,76 @@
+<template>
+  <div>
+    <el-upload
+      :action="`${path}/fileUploadAndDownload/upload`"
+      :before-upload="checkFile"
+      :on-error="uploadError"
+      :on-success="uploadSuccess"
+      :show-file-list="false"
+      class="upload-btn"
+    >
+      <el-button v-preReClick type="primary">普通上传</el-button>
+    </el-upload>
+  </div>
+</template>
+
+<script setup>
+import { ref, defineEmits } from 'vue'
+import { ElMessage } from 'element-plus'
+import { useUserStore } from '@/pinia/modules/user'
+import { isVideoMime, isImageMime } from '@/utils/image'
+
+defineOptions({
+  name: 'UploadCommon'
+})
+
+const emit = defineEmits(['on-success'])
+const path = ref(import.meta.env.VITE_BASE_API)
+
+const userStore = useUserStore()
+const fullscreenLoading = ref(false)
+
+const checkFile = file => {
+  fullscreenLoading.value = true
+  const isLt500K = file.size / 1024 / 1024 < 0.5 // 500K, @todo 应支持在项目中设置
+  const isLt5M = file.size / 1024 / 1024 < 5 // 5MB, @todo 应支持项目中设置
+  const isVideo = isVideoMime(file.type)
+  const isImage = isImageMime(file.type)
+  let pass = true
+  if (!isVideo && !isImage) {
+    ElMessage.error(
+      '上传图片只能是 jpg,png,svg,webp 格式, 上传视频只能是 mp4,webm 格式!'
+    )
+    fullscreenLoading.value = false
+    pass = false
+  }
+  if (!isLt5M && isVideo) {
+    ElMessage.error('上传视频大小不能超过 5MB')
+    fullscreenLoading.value = false
+    pass = false
+  }
+  if (!isLt500K && isImage) {
+    ElMessage.error('未压缩的上传图片大小不能超过 500KB,请使用压缩上传')
+    fullscreenLoading.value = false
+    pass = false
+  }
+
+  console.log('upload file check result: ', pass)
+
+  return pass
+}
+
+const uploadSuccess = res => {
+  const { data } = res
+  if (data.file) {
+    emit('on-success', data.file.url)
+  }
+}
+
+const uploadError = () => {
+  ElMessage({
+    type: 'error',
+    message: '上传失败'
+  })
+  fullscreenLoading.value = false
+}
+</script>

+ 98 - 0
src/components/upload/image.vue

@@ -0,0 +1,98 @@
+<template>
+  <div>
+    <el-upload
+      :action="`${path}/fileUploadAndDownload/upload`"
+      :before-upload="beforeImageUpload"
+      :multiple="false"
+      :on-success="handleImageSuccess"
+      :show-file-list="false"
+    >
+      <el-button v-preReClick type="primary">压缩上传</el-button>
+    </el-upload>
+  </div>
+</template>
+
+<script setup>
+import ImageCompress from '@/utils/image'
+import { ref, defineProps, defineEmits } from 'vue'
+import { ElMessage } from 'element-plus'
+import { useUserStore } from '@/pinia/modules/user'
+
+defineOptions({
+  name: 'UploadImage'
+})
+
+const emit = defineEmits(['on-success'])
+const props = defineProps({
+  imageUrl: {
+    type: String,
+    default: ''
+  },
+  fileSize: {
+    type: Number,
+    default: 2048 // 2M 超出后执行压缩
+  },
+  maxWH: {
+    type: Number,
+    default: 1920 // 图片长宽上限
+  }
+})
+
+const path = ref(import.meta.env.VITE_BASE_API)
+
+const userStore = useUserStore()
+
+const beforeImageUpload = file => {
+  const isJPG = file.type === 'image/jpeg'
+  const isPng = file.type === 'image/png'
+  if (!isJPG && !isPng) {
+    ElMessage.error('上传头像图片只能是 jpg或png 格式!')
+    return false
+  }
+
+  const isRightSize = file.size / 1024 < props.fileSize
+  if (!isRightSize) {
+    // 压缩
+    const compress = new ImageCompress(file, props.fileSize, props.maxWH)
+    return compress.compress()
+  }
+  return isRightSize
+}
+
+const handleImageSuccess = res => {
+  const { data } = res
+  if (data.file) {
+    emit('on-success', data.file.url)
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.image-uploader {
+  border: 1px dashed #d9d9d9;
+  width: 180px;
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+}
+
+.image-uploader {
+  border-color: #409eff;
+}
+
+.image-uploader-icon {
+  font-size: 28px;
+  color: #8c939d;
+  width: 178px;
+  height: 178px;
+  line-height: 178px;
+  text-align: center;
+}
+
+.image {
+  width: 178px;
+  height: 178px;
+  display: block;
+}
+</style>

+ 35 - 0
src/components/warningBar/warningBar.vue

@@ -0,0 +1,35 @@
+<template>
+  <div
+    :class="href && 'cursor-pointer'"
+    class="px-1.5 py-2 flex items-center bg-amber-50 rounded gap-2 mb-3 text-amber-500"
+    @click="open"
+  >
+    <el-icon class="text-xl">
+      <warning-filled />
+    </el-icon>
+    <span>
+      {{ title }}
+    </span>
+  </div>
+</template>
+<script setup>
+import { defineProps } from 'vue'
+import { WarningFilled } from '@element-plus/icons-vue'
+
+const prop = defineProps({
+  title: {
+    type: String,
+    default: ''
+  },
+  href: {
+    type: String,
+    default: ''
+  }
+})
+
+const open = () => {
+  if (prop.href) {
+    window.open(prop.href)
+  }
+}
+</script>

+ 36 - 0
src/config/index.js

@@ -0,0 +1,36 @@
+// src/config/index.ts
+const runtimeConfig = window.APP_CONFIG || {}
+
+export const BASE_API =
+  runtimeConfig.BASE_API ||
+  import.meta.env.VITE_BASE_API ||
+  '/api'
+
+export const BASE_PATH =
+  runtimeConfig.BASE_PATH ||
+  import.meta.env.VITE_BASE_PATH ||
+  ''
+
+export const SERVICE_PATH =
+  runtimeConfig.DOCUMENT_SERVER_URL ||
+  import.meta.env.VITE_DOCUMENT_SERVER_URL ||
+  ''
+
+export const WEBSOCKET_PATH =
+  runtimeConfig.WEBSOCKET_PATH ||
+  import.meta.env.VITE_WEBSOCKET_PATH ||
+  ' '
+
+export const QRCODE_BASE_PATH =
+  runtimeConfig.QRCODE_BASE_PATH ||
+  import.meta.env.VITE_QRCODE_BASE_PATH ||
+  ''
+export const INVITE_BASE_PATH =
+  runtimeConfig.INVITE_BASE_PATH ||
+  import.meta.env.VITE_INVITE_BASE_PATH ||
+  ''
+
+export const STUDENT_LOGIN_PATH =
+  runtimeConfig.STUDENT_LOGIN_PATH ||
+  import.meta.env.VITE_STUDENT_LOGIN_PATH ||
+  ''

+ 12 - 0
src/core/config.js

@@ -0,0 +1,12 @@
+/**
+ * 网站配置文件
+ */
+
+const config = {
+  appName: '密码服务监管平台',
+  appLogo: '@/assets/logo.png',
+  showViteLogo: true,
+  logs: [],
+}
+
+export default config

+ 12 - 0
src/core/gin-vue-admin.js

@@ -0,0 +1,12 @@
+/*
+ * gin-vue-admin web框架组
+ *
+ * */
+// 加载网站配置文件夹
+import { register } from './global'
+
+export default {
+  install: (app) => {
+    register(app)
+  }
+}

+ 45 - 0
src/core/global.js

@@ -0,0 +1,45 @@
+import config from './config'
+import { h } from 'vue'
+
+// 统一导入el-icon图标
+import * as ElIconModules from '@element-plus/icons-vue'
+import svgIcon from '@/components/svgIcon/svgIcon.vue'
+// 导入转换图标名称的函数
+
+const createIconComponent = (name) => ({
+  name: 'SvgIcon',
+  render() {
+    return h(svgIcon, {
+      name: name,
+    })
+  },
+})
+
+const registerIcons = async(app) => {
+  const iconModules = import.meta.glob('@/assets/icons/**/*.svg')
+  for (const path in iconModules) {
+    const iconName = path.split('/').pop().replace(/\.svg$/, '')
+    // 如果iconName带空格则不加入到图标库中并且提示名称不合法
+    console.log(iconName)
+    if (iconName.indexOf(' ') !== -1) {
+      console.error(`icon ${iconName}.svg includes whitespace`)
+      continue
+    }
+    const iconComponent = createIconComponent(iconName)
+    config.logs.push({
+      'key': iconName,
+      'label': iconName,
+    })
+    app.component(iconName, iconComponent)
+  }
+}
+
+export const register = (app) => {
+  // 统一注册el-icon图标
+  for (const iconName in ElIconModules) {
+    app.component(iconName, ElIconModules[iconName])
+  }
+  app.component('SvgIcon', svgIcon)
+  registerIcons(app)
+  app.config.globalProperties.$GIN_VUE_ADMIN = config
+}

+ 41 - 0
src/directive/auth.js

@@ -0,0 +1,41 @@
+// 权限按钮展示指令
+import { useUserStore } from '@/pinia/modules/user'
+export default {
+  install: (app) => {
+    const userStore = useUserStore()
+    app.directive('auth', {
+      // 当被绑定的元素插入到 DOM 中时……
+      mounted: function(el, binding) {
+        const userInfo = userStore.userInfo
+        let type = ''
+        switch (Object.prototype.toString.call(binding.value)) {
+          case '[object Array]':
+            type = 'Array'
+            break
+          case '[object String]':
+            type = 'String'
+            break
+          case '[object Number]':
+            type = 'Number'
+            break
+          default:
+            type = ''
+            break
+        }
+        if (type === '') {
+          el.parentNode.removeChild(el)
+          return
+        }
+        const waitUse = binding.value.toString().split(',')
+        let flag = waitUse.some(item => Number(item) === userInfo.authorityId)
+        if (binding.modifiers.not) {
+          flag = !flag
+        }
+        if (!flag) {
+          el.parentNode.removeChild(el)
+        }
+      }
+    })
+  }
+}
+

+ 23 - 0
src/hooks/use-windows-resize.js

@@ -0,0 +1,23 @@
+// 监听 window 的 resize 事件,返回当前窗口的宽高
+import { shallowRef } from 'vue'
+import { tryOnMounted, useEventListener } from '@vueuse/core'
+
+const width = shallowRef(0)
+const height = shallowRef(0)
+
+export const useWindowResize = (cb) => {
+  const onResize = () => {
+    width.value = window.innerWidth
+    height.value = window.innerHeight
+    if (cb && typeof cb === 'function') {
+      cb(width.value, height.value)
+    }
+  }
+
+  tryOnMounted(onResize)
+  useEventListener('resize', onResize, { passive: true })
+  return {
+    width,
+    height,
+  }
+}

+ 61 - 0
src/main.js

@@ -0,0 +1,61 @@
+import 'element-plus/es/components/message/style/css'
+import 'element-plus/es/components/loading/style/css'
+import 'element-plus/es/components/notification/style/css'
+import 'element-plus/es/components/message-box/style/css'
+import './style/element_visiable.scss'
+import { createApp } from 'vue'
+// 引入gin-vue-admin前端初始化相关内容
+import './core/gin-vue-admin'
+// 引入封装的router
+import router from '@/router/index'
+import '@/permission'
+import run from '@/core/gin-vue-admin.js'
+import auth from '@/directive/auth'
+import { store } from '@/pinia'
+import App from './App.vue'
+import { initDom } from './utils/positionToCode'
+// 引入富文本编辑器
+import VueMarkdownEditor from '@kangc/v-md-editor'
+import '@kangc/v-md-editor/lib/style/base-editor.css'
+import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js'
+import '@kangc/v-md-editor/lib/theme/style/vuepress.css'
+import Prism from 'prismjs'
+import VMdPreview from '@kangc/v-md-editor/lib/preview'
+// 防抖函数
+import preReClick from '@/utils/preReClick'
+
+VMdPreview.use(vuepressTheme, {
+  Prism
+})
+VueMarkdownEditor.use(vuepressTheme, {
+  Prism
+})
+
+initDom()
+/**
+ * @description 导入加载进度条,防止首屏加载时间过长,用户等待
+ *
+ * */
+import Nprogress from 'nprogress'
+import 'nprogress/nprogress.css'
+
+Nprogress.configure({ showSpinner: false, ease: 'ease', speed: 500 })
+Nprogress.start()
+
+/**
+ * 无需在这块结束,会在路由中间件中结束此块内容
+ * */
+const app = createApp(App)
+app.config.productionTip = false
+
+app
+  .use(run)
+  .use(store)
+  .use(auth)
+  .use(router)
+  .use(VMdPreview)
+  .use(VueMarkdownEditor)
+  .use(preReClick)
+  .mount('#app')
+
+export default app

+ 125 - 0
src/permission.js

@@ -0,0 +1,125 @@
+import { useUserStore } from '@/pinia/modules/user'
+import { useRouterStore } from '@/pinia/modules/router'
+import getPageTitle from '@/utils/page'
+import router from '@/router'
+import Nprogress from 'nprogress'
+
+const whiteList = ['Login', 'Init', 'License','Register','RegisterSuccess']
+
+const getRouter = async(userStore) => {
+  const routerStore = useRouterStore()
+  await routerStore.SetAsyncRouter()
+  await userStore.GetUserInfo()
+  const asyncRouters = routerStore.asyncRouters
+  asyncRouters.forEach(asyncRouter => {
+    router.addRoute(asyncRouter)
+  })
+}
+
+async function handleKeepAlive(to) {
+  if (to.matched.some(item => item.meta.keepAlive)) {
+    if (to.matched && to.matched.length > 2) {
+      for (let i = 1; i < to.matched.length; i++) {
+        const element = to.matched[i - 1]
+        if (element.name === 'layout') {
+          to.matched.splice(i, 1)
+          await handleKeepAlive(to)
+        }
+        // 如果没有按需加载完成则等待加载
+        if (typeof element.components.default === 'function') {
+          await element.components.default()
+          await handleKeepAlive(to)
+        }
+      }
+    }
+  }
+}
+
+router.beforeEach(async(to, from) => {
+  const routerStore = useRouterStore()
+  Nprogress.start()
+  const userStore = useUserStore()
+  to.meta.matched = [...to.matched]
+  handleKeepAlive(to)
+  const token = userStore.token
+  // 在白名单中的判断情况
+  document.title = getPageTitle(to.meta.title, to)
+  if (to.meta.client) {
+    return true
+  }
+  if (whiteList.indexOf(to.name) > -1) {
+    if (token) {
+      if (!routerStore.asyncRouterFlag && whiteList.indexOf(from.name) < 0) {
+        await getRouter(userStore)
+      }
+      // token 可以解析但是却是不存在的用户 id 或角色 id 会导致无限调用
+      if (userStore.userInfo?.authority?.defaultRouter != null) {
+        if (to.name === 'License') {
+          return true
+        }
+        if (router.hasRoute(userStore.userInfo.authority.defaultRouter)) {
+          return { name: userStore.userInfo.authority.defaultRouter }
+        } else {
+          return { path: '/layout/404' }
+        }
+      } else {
+        // 强制退出账号
+        userStore.ClearStorage()
+        return {
+          name: 'Login',
+          query: {
+            redirect: document.location.hash
+          }
+        }
+      }
+    } else {
+      return true
+    }
+  } else {
+    // 不在白名单中并且已经登录的时候
+    if (token) {
+      // 添加flag防止多次获取动态路由和栈溢出
+      if (!routerStore.asyncRouterFlag && whiteList.indexOf(from.name) < 0) {
+        await getRouter(userStore)
+        if (userStore.token) {
+          if (router.hasRoute(userStore.userInfo.authority.defaultRouter)) {
+            return { ...to, replace: true }
+          } else {
+            return { path: '/layout/404' }
+          }
+        } else {
+          return {
+            name: 'Login',
+            query: { redirect: to.href }
+          }
+        }
+      } else {
+        if (to.matched.length) {
+          return true
+        } else {
+          return { path: '/layout/404' }
+        }
+      }
+    }
+    // 不在白名单中并且未登录的时候
+    if (!token) {
+      return {
+        name: 'Login',
+        query: {
+          redirect: document.location.hash
+        }
+      }
+    }
+  }
+})
+
+router.afterEach(() => {
+  // 路由加载完成后关闭进度条
+  document.getElementsByClassName('main-cont main-right')[0]?.scrollTo(0, 0)
+  Nprogress.done()
+})
+
+router.onError(() => {
+  // 路由发生错误后销毁进度条
+  Nprogress.remove()
+})

+ 7 - 0
src/pinia/index.js

@@ -0,0 +1,7 @@
+import { createPinia } from 'pinia'
+
+const store = createPinia()
+
+export {
+  store
+}

+ 47 - 0
src/pinia/modules/dictionary.js

@@ -0,0 +1,47 @@
+import { findSysDictionary } from '@/api/sysDictionary'
+
+import { defineStore } from 'pinia'
+import { ref } from 'vue'
+
+export const useDictionaryStore = defineStore(
+  'dictionary',
+  () => {
+    const dictionaryMap = ref({})
+
+    const setDictionaryMap = dictionaryRes => {
+      dictionaryMap.value = { ...dictionaryMap.value, ...dictionaryRes }
+    }
+
+    const getDictionary = async type => {
+      if (dictionaryMap.value[type] && dictionaryMap.value[type].length) {
+        return dictionaryMap.value[type]
+      } else {
+        const res = await findSysDictionary({ type })
+        if (res.code === 100000) {
+          const dictionaryRes = {}
+          const dict = []
+          res.data.resysDictionary.sysDictionaryDetails &&
+            res.data.resysDictionary.sysDictionaryDetails.forEach(item => {
+              dict.push({
+                label: item.label,
+                value: item.value,
+                extend: item.extend
+              })
+            })
+          dictionaryRes[res.data.resysDictionary.type] = dict
+          setDictionaryMap(dictionaryRes)
+          return dictionaryMap.value[type]
+        }
+      }
+    }
+
+    return {
+      dictionaryMap,
+      setDictionaryMap,
+      getDictionary
+    }
+  },
+  {
+    persist: true // 启用持久化
+  }
+)

+ 18 - 0
src/pinia/modules/license.js

@@ -0,0 +1,18 @@
+import { defineStore } from 'pinia'
+import { ref } from 'vue'
+
+export const useLicenseStore = defineStore(
+  'license',
+  () => {
+    const license = ref('')
+
+    const setLicense = data => {
+      license.value = data
+    }
+
+    return { license, setLicense }
+  },
+  {
+    persist: true // 启用持久化
+  }
+)

+ 26 - 0
src/pinia/modules/paper.js

@@ -0,0 +1,26 @@
+import { defineStore } from 'pinia'
+
+export const usePaperStore = defineStore(
+  'paperId',
+  {
+    state() {
+      return {
+        paperId: null
+      }
+    },
+    actions: {
+      setParams(paperId) {
+        this.paperId = paperId
+        // 保存参数到 localStorage
+        localStorage.setItem('paperId', paperId)
+      },
+      loadParamsFromStorage() {
+        // 从 localStorage 加载参数
+        this.paperId = localStorage.getItem('paperId')
+      }
+    }
+  },
+  {
+    persist: true // 启用持久化
+  }
+)

+ 111 - 0
src/pinia/modules/router.js

@@ -0,0 +1,111 @@
+import { asyncRouterHandle } from '@/utils/asyncRouter'
+import { emitter } from '@/utils/bus.js'
+import { asyncMenu } from '@/api/menu'
+import { defineStore } from 'pinia'
+import { ref } from 'vue'
+
+const notLayoutRouterArr = []
+const keepAliveRoutersArr = []
+const nameMap = {}
+
+const formatRouter = (routes, routeMap, parent) => {
+  routes &&
+    routes.forEach(item => {
+      item.parent = parent
+      item.meta.btns = item.btns
+      item.meta.hidden = item.hidden
+      if (item.meta.defaultMenu === true) {
+        if (!parent) {
+          item = { ...item, path: `/${item.path}` }
+          notLayoutRouterArr.push(item)
+        }
+      }
+      routeMap[item.name] = item
+      if (item.children && item.children.length > 0) {
+        formatRouter(item.children, routeMap, item)
+      }
+    })
+}
+
+const KeepAliveFilter = routes => {
+  routes &&
+    routes.forEach(item => {
+      // 子菜单中有 keep-alive 的,父菜单也必须 keep-alive,否则无效。这里将子菜单中有 keep-alive 的父菜单也加入。
+      if (
+        (item.children && item.children.some(ch => ch.meta.keepAlive)) ||
+        item.meta.keepAlive
+      ) {
+        item.component &&
+          item.component().then(val => {
+            keepAliveRoutersArr.push(val.default.name)
+            nameMap[item.name] = val.default.name
+          })
+      }
+      if (item.children && item.children.length > 0) {
+        KeepAliveFilter(item.children)
+      }
+    })
+}
+
+export const useRouterStore = defineStore('router', () => {
+  const keepAliveRouters = ref([])
+  const asyncRouterFlag = ref(0)
+  const setKeepAliveRouters = history => {
+    const keepArrTemp = []
+    history.forEach(item => {
+      if (nameMap[item.name]) {
+        keepArrTemp.push(nameMap[item.name])
+      }
+    })
+    keepAliveRouters.value = Array.from(new Set(keepArrTemp))
+  }
+  emitter.on('setKeepAlive', setKeepAliveRouters)
+
+  const asyncRouters = ref([])
+  const routeMap = {}
+  // 从后台获取动态路由
+  const SetAsyncRouter = async () => {
+    asyncRouterFlag.value++
+    const baseRouter = [
+      {
+        path: '/layout',
+        name: 'layout',
+        component: 'view/layout/index.vue',
+        meta: {
+          title: '底层layout'
+        },
+        children: []
+      }
+    ]
+    const asyncRouterRes = await asyncMenu()
+    const asyncRouter = asyncRouterRes.data.menus
+    asyncRouter &&
+      asyncRouter.push({
+        path: 'reload',
+        name: 'Reload',
+        hidden: true,
+        meta: {
+          title: '',
+          closeTab: true
+        },
+        component: 'view/error/reload.vue'
+      })
+    formatRouter(asyncRouter, routeMap)
+    baseRouter[0].children = asyncRouter
+    if (notLayoutRouterArr.length !== 0) {
+      baseRouter.push(...notLayoutRouterArr)
+    }
+    asyncRouterHandle(baseRouter)
+    KeepAliveFilter(asyncRouter)
+    asyncRouters.value = baseRouter
+    return true
+  }
+
+  return {
+    asyncRouters,
+    keepAliveRouters,
+    asyncRouterFlag,
+    SetAsyncRouter,
+    routeMap
+  }
+})

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor