Compare commits

..

No commits in common. "master" and "v2.2.4" have entirely different histories.

76 changed files with 15801 additions and 3084 deletions

View File

@ -102,7 +102,7 @@ snowy
|-layout == 基础布局
|-locales == 多语言配置
|-router == 基础路由配置
|-store == Pinia缓存配置
|-store == VUEX缓存配置
|-style == 样式风格配置
|-utils == 工具类
|-views == 所有视图界面
@ -232,4 +232,4 @@ QQ技术群732230670已满、685395081
- 二次开发如用于开源竞品请先联系群主沟通,未经审核视为侵权
- 请不要删除和修改Snowy源码头部的版权与作者声明及出处
- 请不要删除和修改Snowy源码头部的版权与作者声明及出处

View File

@ -1,8 +1,6 @@
.DS_Store
node_modules
/dist
*.lock
package-lock.json
# local env files
.env.local
@ -16,6 +14,7 @@ pnpm-debug.log*
# other files
stats.html
package-lock.json
auto-imports.d.ts
# Editor directories and files

14689
snowy-admin-web/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -10,73 +10,72 @@
"license": "Apache-2.0",
"author": "yubaoshan",
"scripts": {
"serve": "vite --host 0.0.0.0",
"dev": "vite --mode development --host 0.0.0.0",
"serve": "vite",
"dev": "vite --mode development",
"preview": "vite preview",
"build": "vite build --mode production",
"prod": "vite --mode production"
},
"dependencies": {
"@ant-design/colors": "7.0.0",
"@ant-design/icons-vue": "6.1.0",
"@antv/g2plot": "2.4.28",
"@ant-design/colors": "6.0.0",
"@ant-design/icons-vue": "^6.1.0",
"@antv/g2plot": "2.4.10",
"@chenfengyuan/vue-qrcode": "2.0.0",
"@highlightjs/vue-plugin": "2.1.0",
"@highlightjs/vue-plugin": "^2.1.0",
"@tinymce/tinymce-vue": "5.0.0",
"ant-design-vue": "3.2.14",
"axios": "1.1.3",
"cropperjs": "1.5.12",
"dayjs": "1.11.7",
"echarts": "5.4.0",
"echarts-stat": "1.2.0",
"enquire.js": "2.1.6",
"fuse.js": "6.6.2",
"highlight.js": "11.6.0",
"hotkeys-js": "3.10.1",
"js-pinyin": "0.1.9",
"lodash-es": "4.17.21",
"dayjs": "^1.11.6",
"echarts": "^5.4.0",
"echarts-stat": "^1.2.0",
"enquire.js": "^2.1.6",
"fuse.js": "^6.6.2",
"highlight.js": "^11.6.0",
"hotkeys-js": "^3.10.0",
"js-pinyin": "^0.1.9",
"lodash-es": "^4.17.21",
"nprogress": "0.2.0",
"pinia": "2.0.33",
"qs": "6.11.1",
"screenfull": "6.0.2",
"sm-crypto": "0.3.11",
"snowflake-id": "1.1.0",
"sortablejs": "1.15.0",
"screenfull": "^6.0.2",
"sm-crypto": "^0.3.11",
"snowflake-id": "^1.1.0",
"sortablejs": "^1.15.0",
"tinymce": "6.2.0",
"vue": "3.2.44",
"vue-cropper": "1.0.5",
"vue-i18n": "9.2.2",
"vue-router": "4.1.6",
"vue-cropper": "^1.0.1",
"vue-i18n": "^9.2.2",
"vue-router": "^4.1.6",
"vue3-colorpicker": "2.0.4",
"vue3-tree-org": "4.1.1",
"vuedraggable-es": "4.1.1"
"vue3-tree-org": "^4.1.1",
"vuedraggable-es": "^4.1.1",
"vuex": "^4.1.0"
},
"devDependencies": {
"@antfu/eslint-config": "0.29.4",
"@babel/eslint-parser": "7.19.1",
"@vitejs/plugin-legacy": "3.0.2",
"@vitejs/plugin-vue": "4.1.0",
"@vitejs/plugin-vue-jsx": "3.0.1",
"@vue/compiler-sfc": "3.2.47",
"@vue/eslint-config-standard": "8.0.1",
"antd-less-to-css-variable": "1.0.5",
"autoprefixer": "10.4.13",
"eslint": "8.26.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-vue": "9.7.0",
"less": "4.1.3",
"postcss": "8.4.21",
"prettier": "2.8.7",
"rollup-plugin-visualizer": "5.8.3",
"tailwindcss": "3.2.7",
"typescript": "4.9.5",
"unplugin-auto-import": "0.15.2",
"unplugin-vue-components": "0.24.1",
"vite": "4.2.1",
"vite-plugin-compression": "0.5.1",
"vite-plugin-vue-setup-extend": "0.4.0",
"vue-eslint-parser": "9.1.0"
"@antfu/eslint-config": "^0.29.3",
"@babel/eslint-parser": "^7.19.1",
"@vitejs/plugin-legacy": "^1.6.4",
"@vitejs/plugin-vue": "^2.1.0",
"@vitejs/plugin-vue-jsx": "^1.3.8",
"@vue/compiler-sfc": "^3.2.41",
"@vue/eslint-config-standard": "^8.0.1",
"antd-less-to-css-variable": "^1.0.5",
"autoprefixer": "^10.4.13",
"eslint": "^8.26.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.7.0",
"less": "^4.1.3",
"postcss": "^8.4.18",
"prettier": "^2.7.1",
"rollup-plugin-visualizer": "^5.8.3",
"tailwindcss": "^3.2.1",
"typescript": "^4.8.4",
"unplugin-auto-import": "^0.11.4",
"unplugin-vue-components": "^0.22.9",
"vite": "2.8.6",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-vue-setup-extend": "^0.4.0",
"vue-eslint-parser": "^9.1.0"
},
"browserslist": [
"> 1%",

View File

@ -31,6 +31,15 @@ module.exports = {
jsxBracketSameLine: true,
// 箭头函数,只有一个参数的时候,也需要括号
arrowParens: 'always',
// 每个文件格式化的范围是文件的全部内容
rangeStart: 0,
rangeEnd: Infinity,
// 不需要写文件开头的 @prettier
requirePragma: false,
// 不需要自动在文件开头插入 @prettier
insertPragma: false,
// 使用默认的折行标准
proseWrap: 'preserve',
// 根据显示样式决定 html 要不要折行
htmlWhitespaceSensitivity: 'css',
// 换行符使用 lf

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 750 750" style="enable-background:new 0 0 750 750;" xml:space="preserve">
<style type="text/css">
.st0{opacity:0.35;fill:#B3B3B3;}
.st1{opacity:0.1;fill:#B3B3B3;}
.st2{opacity:0.3;fill:#B3B3B3;}
.st3{opacity:0.1;}
.st4{fill:#B3B3B3;}
</style>
<g>
<path class="st0" d="M465.1,261.4H264c-1.3,0-2.4,1.1-2.4,2.4v255.6c0,1.3,1.1,2.4,2.4,2.4h201.1c1.3,0,2.4-1.1,2.4-2.4V263.8
C467.5,262.4,466.4,261.4,465.1,261.4z M417.9,443c0,1.3-1.1,2.4-2.4,2.4h-102c-1.3,0-2.4-1.1-2.4-2.4v-11.3c0-1.3,1.1-2.4,2.4-2.4
h102c1.3,0,2.4,1.1,2.4,2.4V443z M417.9,397.2c0,1.3-1.1,2.4-2.4,2.4h-102c-1.3,0-2.4-1.1-2.4-2.4v-11.3c0-1.3,1.1-2.4,2.4-2.4h102
c1.3,0,2.4,1.1,2.4,2.4V397.2z M417.9,351.5c0,1.3-1.1,2.4-2.4,2.4h-102c-1.3,0-2.4-1.1-2.4-2.4v-11.3c0-1.3,1.1-2.4,2.4-2.4h102
c1.3,0,2.4,1.1,2.4,2.4V351.5z"/>
<g>
<path class="st1" d="M462.1,236.8L462.1,236.8C384.8,236.2,321,295.1,314,370.7c-18.5-19.1-44.4-31.1-73.1-31.3h0
c-56.8-0.4-103.2,45.3-103.6,102.1l-0.8,101.4l175.6,1.3l30.1,0.2l265.1,2l1.2-160.9C609.2,304,543.6,237.4,462.1,236.8z"/>
<path class="st2" d="M216.9,227.4c-3.4,0-6.5,1.1-9,2.9c0.2-1,0.3-2,0.3-3c0.1-8.3-6.6-15.1-15-15.2s-15.1,6.6-15.2,15
c0,0.3,0,0.6,0,0.9c-1.6-0.6-3.4-1-5.2-1c-8.3-0.1-15.1,6.6-15.2,15c-0.1,8.2,6.4,14.9,14.5,15.2l0,0l44.6,0.3
c8.3,0.1,15.1-6.6,15.2-15S225.2,227.5,216.9,227.4z"/>
<path class="st2" d="M596.4,194.2c-3.4,0-6.5,1.1-9,2.9c0.2-1,0.3-2,0.3-3c0.1-8.3-6.6-15.1-15-15.2s-15.1,6.6-15.2,15
c0,0.3,0,0.6,0,0.9c-1.6-0.6-3.4-1-5.2-1c-8.3-0.1-15.1,6.6-15.2,15c-0.1,8.2,6.4,14.9,14.5,15.2l0,0l44.6,0.3
c8.3,0.1,15.1-6.6,15.2-15S604.7,194.3,596.4,194.2z"/>
<g>
<g class="st3">
<path class="st4" d="M496.9,497.5c-2.1,0-3.7,1.6-3.7,3.7c0,1.5,0.8,2.7,2,3.3l-0.5,65.1l3.5,0l0.5-65.3
c1.1-0.6,1.8-1.8,1.8-3.1C500.6,499.1,499,497.6,496.9,497.5z"/>
<path class="st4" d="M572.3,501.7c0-1.9-1.6-3.6-3.7-3.7c-2.1,0-3.7,1.6-3.7,3.7c0,1.4,0.8,2.6,1.9,3.2l-0.5,65.2l3.5,0
l0.5-65.2C571.5,504.3,572.2,503.1,572.3,501.7z"/>
</g>
<rect x="522.7" y="472.2" transform="matrix(7.448311e-03 -1 1 7.448311e-03 8.6828 1045.4733)" class="st1" width="16.5" height="92.3"/>
<polygon class="st1" points="495.4,509.8 495.2,510.1 485.5,526.3 484.8,526.3 484.9,509.8 "/>
<polygon class="st1" points="518.7,510 508.8,526.5 496.3,526.4 500.2,519.8 506,509.9 "/>
<polygon class="st1" points="542,510.2 532.1,526.6 519.6,526.5 529.3,510.1 "/>
<polygon class="st1" points="565.3,510.4 555.5,526.8 542.9,526.7 552.7,510.3 "/>
<polygon class="st1" points="577.2,510.4 577.1,527 566.2,526.9 576,510.4 "/>
<rect x="522.5" y="497.7" transform="matrix(7.448311e-03 -1 1 7.448311e-03 -17.0149 1070.603)" class="st1" width="16.5" height="92.3"/>
<polygon class="st1" points="495.2,535.3 495,535.6 485.3,551.8 484.6,551.8 484.7,535.3 "/>
<polygon class="st1" points="518.5,535.5 508.6,552 496.1,551.9 500,545.3 505.8,535.4 "/>
<polygon class="st1" points="541.8,535.7 531.9,552.1 519.4,552 529.1,535.6 "/>
<polygon class="st1" points="565.1,535.9 555.4,552.3 542.7,552.2 552.5,535.8 "/>
<polygon class="st1" points="577,536 576.9,552.5 566,552.4 575.8,536 "/>
<path class="st1" d="M577.1,527c0,0,0-0.1,0-0.3l0-0.9c0-0.7,0-1.8,0-3.2c0-2.8,0.1-6.9,0.1-12.2l0.1,0.1l-92.3-0.5l0,0l0.1-0.1
c0,5.6-0.1,11.2-0.1,16.5l-0.1-0.1l65.8,0.6l19.5,0.1l5.3,0l0,0l-5.3,0l-19.5-0.1l-65.8-0.3l-0.3,0l0.1-16.8l0.1,0l92.3,0.8
l0.1,0l0,0.1c0,5.3-0.1,9.4-0.1,12.2c0,1.5,0,2.5,0,3.2l0,0.7C577.1,526.8,577.1,527,577.1,527z"/>
<path class="st1" d="M576.9,552.5c0,0,0-0.1,0-0.3l0-0.9c0-0.7,0-1.8,0-3.2c0-2.8,0.1-6.9,0.1-12.2l0.1,0.1l-92.3-0.5l0,0
l0.1-0.1c0,5.6-0.1,11.2-0.1,16.5l-0.1-0.1l65.8,0.6l19.5,0.1l5.3,0l0,0l-5.3,0l-19.5-0.1l-65.8-0.3l-0.3,0l0.1-16.7l0.1,0
l92.3,0.8l0.1,0l0,0.1c0,5.3-0.1,9.4-0.1,12.2c0,1.5,0,2.5,0,3.2l0,0.7C576.9,552.3,576.9,552.5,576.9,552.5z"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.1 KiB

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,236 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 456 262.1" style="enable-background:new 0 0 456 262.1;" xml:space="preserve">
<style type="text/css">
.st0{opacity:0.4;fill:url(#SVGID_1_);enable-background:new ;}
.st1{opacity:0.7;}
.st2{opacity:0.4;fill:url(#SVGID_2_);enable-background:new ;}
.st3{opacity:0.4;fill:url(#SVGID_3_);enable-background:new ;}
.st4{opacity:0.4;fill:url(#SVGID_4_);enable-background:new ;}
.st5{opacity:0.4;fill:url(#SVGID_5_);enable-background:new ;}
.st6{opacity:0.6;}
.st7{fill:#0073CD;}
.st8{fill:#40A8F5;}
.st9{fill:#53B9F5;}
.st10{fill:#85D3FF;}
.st11{fill:#8CD7FF;}
.st12{fill:#EBFCFF;}
.st13{fill:none;stroke:url(#SVGID_6_);stroke-width:2;stroke-miterlimit:10;}
.st14{fill:none;stroke:url(#SVGID_7_);stroke-width:2;stroke-miterlimit:10;}
.st15{fill:none;stroke:url(#SVGID_8_);stroke-width:2;stroke-miterlimit:10;}
.st16{fill:none;stroke:url(#SVGID_9_);stroke-width:2;stroke-miterlimit:10;}
.st17{fill:none;stroke:url(#SVGID_10_);stroke-width:2;stroke-miterlimit:10;}
.st18{fill:none;stroke:url(#SVGID_11_);stroke-width:2;stroke-miterlimit:10;}
</style>
<title>升级中</title>
<g id="图层_2_1_">
<g id="图层_1-2">
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="232.745" y1="39.57" x2="232.745" y2="1.88" gradientTransform="matrix(1 0 0 -1 0 264)">
<stop offset="0" style="stop-color:#81CFFF"/>
<stop offset="1" style="stop-color:#5ECFFF;stop-opacity:0"/>
</linearGradient>
<path class="st0" d="M412.3,262.1c-23-23-61-37.7-179.5-37.7S76.2,239.1,53.2,262.1H412.3z"/>
<g class="st1">
<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="349.365" y1="237.3224" x2="349.365" y2="59.9676" gradientTransform="matrix(1 0 0 -1 0 264)">
<stop offset="0" style="stop-color:#81CFFF"/>
<stop offset="1" style="stop-color:#5ECFFF;stop-opacity:0"/>
</linearGradient>
<path class="st2" d="M380.7,26.7h-62.6c-1.5-0.1-2.8,1.1-2.8,2.6v172.2c0.1,1.5,1.3,2.7,2.8,2.6h62.6c1.5,0.1,2.7-1.1,2.8-2.6
V29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.9V36.6c0-0.5,0.4-0.9,0.9-0.9h3.6c0.5,0,0.9,0.4,0.9,0.9V56.3z M375.1,147
c0,0.5-0.4,0.9-0.9,0.9c0,0,0,0,0,0h-3.6c-0.5,0-0.9-0.4-0.9-0.9c0,0,0,0,0,0v-19.7c0-0.5,0.4-0.9,0.9-0.9h3.6
c0.5,0,0.9,0.4,1,0.9V147z M375.1,116.8c0,0.5-0.4,0.9-1,0.9h-3.6c-0.5,0-0.9-0.4-0.9-0.9V97c0-0.5,0.4-0.9,0.9-0.9h3.6
c0.5,0,0.9,0.4,1,0.9V116.8z M375.1,86.5c0,0.5-0.4,0.9-1,0.9h-3.6c-0.5,0-0.9-0.4-0.9-0.9V66.8c0-0.5,0.4-0.9,0.9-0.9h3.6
c0.5,0,0.9,0.4,1,0.9V86.5z M375.1,56.3c0,0.5-0.4,0.9-1,0.9h-3.6c-0.5,0-0.9-0.4-0.9-0.9V36.6c0-0.5,0.4-0.9,0.9-0.9h3.6
c0.5,0,0.9,0.4,1,0.9V56.3z"/>
<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="201.46" y1="208.3924" x2="201.46" y2="59.9976" gradientTransform="matrix(1 0 0 -1 0 264)">
<stop offset="0" style="stop-color:#81CFFF"/>
<stop offset="1" style="stop-color:#5ECFFF;stop-opacity:0"/>
</linearGradient>
<path class="st3" d="M231.1,55.6h-59.3c-1.5-0.1-2.7,1.1-2.8,2.6v143.2c0.1,1.5,1.3,2.6,2.8,2.6h59.3c1.5,0.1,2.8-1.1,2.8-2.6
V58.2C233.9,56.7,232.6,55.5,231.1,55.6z M182.5,159.4c0,0.6-0.6,1.1-1.2,1.1h-5.4c-0.6,0-1.2-0.5-1.2-1.1v-5.2
c0-0.6,0.6-1.1,1.2-1.1c0,0,0,0,0,0h5.4c0.6,0,1.2,0.5,1.2,1.1c0,0,0,0,0,0V159.4z M182.5,146.5c0,0.6-0.6,1.1-1.2,1.1
c0,0,0,0,0,0h-5.4c-0.6,0-1.2-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5,1.2,1.1L227.8,94.9z M227.8,82.1c0,0.6-0.6,1.1-1.2,1.1h-20.5c-0.6,0-1.2-0.5-1.2-1.1v-5.2c0-0.6,0.6-1.1,1.2-1.1
c0,0,0,0,0,0h20.5c0.6,0,1.2,0.5,1.2,1.1c0,0,0,0,0,0L227.8,82.1z M227.8,69.2c0,0.6-0.6,1.1-1.2,1.1c0,0,0,0,0,0h-20.5
c-0.6,0-1.2-0.5-1.2-1.1c0,0,0,0,0,0V64c0-0.6,0.6-1.1,1.2-1.1h20.5c0.6,0,1.2,0.5,1.2,1.1L227.8,69.2z"/>
<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="122.975" y1="237.3228" x2="122.975" y2="59.9971" gradientTransform="matrix(1 0 0 -1 0 264)">
<stop offset="0" style="stop-color:#81CFFF"/>
<stop offset="1" style="stop-color:#5ECFFF;stop-opacity:0"/>
</linearGradient>
<path class="st4" d="M161.1,26.7H84.8c-1.5-0.1-2.8,1.1-2.8,2.6c0,0,0,0,0,0v172.2c0.1,1.5,1.3,2.6,2.8,2.6h76.3
c1.5,0.1,2.8-1.1,2.8-2.6V29.3C163.9,27.8,162.6,26.6,161.1,26.7z M154.3,161c0,0.6-0.6,1.1-1.2,1.1H92.8c-0.6,0-1.2-0.5-1.2-1.1
c0,0,0,0,0,0v-5.2c0-0.6,0.6-1.1,1.2-1.1c0,0,0,0,0,0h60.3c0.6,0,1.2,0.5,1.2,1.1c0,0,0,0,0,0V161z M154.3,146.3
c0,0.6-0.6,1.1-1.2,1.1c0,0,0,0,0,0H92.8c-0.6,0-1.2-0.5-1.2-1.1v-5.2c0-0.6,0.6-1.1,1.2-1.1c0,0,0,0,0,0h60.3
c0.6,0,1.2,0.5,1.2,1.1V146.3z M154.3,131.6c0,0.6-0.6,1.1-1.2,1.1H92.8c-0.6,0-1.2-0.5-1.2-1.1c0,0,0,0,0,0v-5.2
c0-0.6,0.6-1.1,1.2-1.1h60.3c0.6,0,1.2,0.5,1.2,1.1c0,0,0,0,0,0V131.6z M154.3,117c0,0.6-0.6,1.1-1.2,1.1H92.8
c-0.6,0-1.2-0.5-1.2-1.1c0,0,0,0,0,0v-5.2c0-0.6,0.6-1.1,1.2-1.1c0,0,0,0,0,0h60.3c0.6,0,1.2,0.5,1.2,1.1c0,0,0,0,0,0V117z
M154.3,102.3c0,0.6-0.6,1.1-1.2,1.1c0,0,0,0,0,0H92.8c-0.6,0-1.2-0.5-1.2-1.1V97c0-0.6,0.6-1.1,1.2-1.1c0,0,0,0,0,0h60.3
c0.6,0,1.2,0.5,1.2,1.1V102.3z M154.3,87.6c0,0.6-0.6,1.1-1.2,1.1H92.8c-0.6,0-1.2-0.5-1.2-1.1c0,0,0,0,0,0v-5.3
c0-0.6,0.6-1.1,1.2-1.1h60.3c0.6,0,1.2,0.5,1.2,1.1c0,0,0,0,0,0V87.6z M154.3,72.9c0,0.6-0.6,1.1-1.2,1.1H92.8
c-0.6,0-1.2-0.5-1.2-1.1c0,0,0,0,0,0v-5.3c0-0.6,0.6-1.1,1.2-1.1c0,0,0,0,0,0h60.3c0.6,0,1.2,0.5,1.2,1.1c0,0,0,0,0,0V72.9z
M154.3,58.3c0,0.6-0.6,1.1-1.2,1.1c0,0,0,0,0,0H92.8c-0.6,0-1.2-0.5-1.2-1.1V53c0-0.6,0.6-1.1,1.2-1.1c0,0,0,0,0,0h60.3
c0.6,0,1.2,0.5,1.2,1.1V58.3z M154.3,43.6c0,0.6-0.6,1.1-1.2,1.1H92.8c-0.6,0-1.2-0.5-1.2-1.1c0,0,0,0,0,0v-5.3
c0-0.6,0.6-1.1,1.2-1.1h60.3c0.6,0,1.2,0.5,1.2,1.1c0,0,0,0,0,0V43.6z"/>
<linearGradient id="SVGID_5_" gradientUnits="userSpaceOnUse" x1="273.51" y1="264" x2="273.51" y2="54.46" gradientTransform="matrix(1 0 0 -1 0 264)">
<stop offset="0" style="stop-color:#81CFFF"/>
<stop offset="1" style="stop-color:#5ECFFF;stop-opacity:0"/>
</linearGradient>
<path class="st5" d="M306.2,0h-65.4c-1.4,0-2.5,1.2-2.4,2.6v204.4c-0.1,1.4,1,2.5,2.4,2.6c0,0,0,0,0,0h65.4
c1.4-0.1,2.5-1.2,2.4-2.6V2.6C308.7,1.2,307.6,0.1,306.2,0z M300.4,119.6c0,0.6-0.4,1.1-1,1.1h-51.7c-0.6,0-1-0.5-1-1.1v-5.2
c0-0.6,0.4-1.1,1-1.1h51.7c0.6,0,1,0.5,1,1.1L300.4,119.6z M300.4,90.3c0,0.6-0.4,1.1-1,1.1h-51.7c-0.6,0-1-0.5-1-1.1V85
c0-0.6,0.4-1.1,1-1.1h51.7c0.6,0,1,0.5,1,1.1L300.4,90.3z M300.4,60.9c0,0.6-0.4,1.1-1,1.1h-51.7c-0.6,0-1-0.5-1-1.1v-5.2
c0-0.6,0.4-1.1,1-1.1h51.7c0.6,0,1,0.5,1,1.1L300.4,60.9z M300.4,31.5c0,0.6-0.4,1.1-1,1.1h-51.7c-0.6,0-1-0.5-1-1.1v-5.2
c0-0.6,0.4-1.1,1-1.1h51.7c0.6,0,1,0.5,1,1.1L300.4,31.5z M300.4,16.9c0,0.6-0.4,1.1-1,1.1h-51.7c-0.6,0-1-0.5-1-1.1v-5.2
c0-0.6,0.4-1.1,1-1.1h51.7c0.6,0,1,0.5,1,1.1L300.4,16.9z"/>
</g>
<g class="st6">
<path class="st7" d="M244.2,130.7c3.3,1.9,5.7,13.6,1,20.7c-5.3,6.8-7,9-6.1,14c-4.3-7.3-0.6-7.4-5.8-14.2
c-4.6-6.2-2.5-17.4,0.7-20.5C237.4,131.3,240.8,131.3,244.2,130.7L244.2,130.7z"/>
<path class="st8" d="M280.4,211.9c-0.1,0.6-0.1,1.2-0.1,1.7c0,0.7,0.1,1.3,0.2,2c-2.1-0.8-4.3-1.2-6.5-1.2
c-2.6,0-5.2,0.6-7.5,1.7c-0.8-4.2-4.8-7-9-6.2c-2.8,0.5-5,2.5-5.9,5.2c-3.4-2.1-7.7-2-11.1,0.1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.2,7.1-3.6,17,3.5,22.2c6.8,5,16.4,3.7,21.7-2.8
c-2.1,5.5,0.7,11.6,6.1,13.6c5.5,2.1,11.6-0.7,13.6-6.1c0.5-1.2,0.7-2.5,0.7-3.7c0-1.9,0.4-0.1,0.4,2.7c0,9.7,7.8,17.6,17.5,17.6
c9.7,0,17.6-7.8,17.6-17.5c0-2.4-0.5-4.8-1.4-7l0.5-0.1c0.5,5.8,5.7,10.1,11.5,9.5c5-0.5,9-4.4,9.5-9.4c1.7,1,3.6,1.6,5.5,1.6
c0.6,0,1.2,0,1.7-0.1v0.1c0,4.2,3.4,7.6,7.6,7.5c2.6,0,5-1.4,6.4-3.6c4.7,6.3,13.5,7.5,19.8,2.9c1.5-1.1,2.8-2.5,3.7-4.2
c4.9,7.3,14.8,9.1,22.1,4.2s9.1-14.8,4.2-22.1C324.5,212.5,319.6,209.9,314.4,209.9L314.4,209.9z"/>
</g>
<path class="st11" d="M239.1,70c6.4,0,11.6,5.2,11.6,11.6c0,6.4-5.2,11.6-11.6,11.6c-6.4,0-11.6-5.2-11.6-11.6c0,0,0,0,0,0
C227.5,75.2,232.7,70,239.1,70z"/>
<path class="st8" d="M239.1,137.2c8.3,0,13.5-1.7,16.6-7.9c0,3.2-1.5,6.2-4.1,8.1c-1.9,1.3-4,2.2-6.2,2.6c-4.1,0.8-8.4,0.8-12.5,0
c-2.2-0.4-4.3-1.3-6.2-2.6c-2.6-1.9-4.2-4.9-4.2-8.1C225.6,135.5,230.7,137.2,239.1,137.2z"/>
<path class="st8" d="M288.4,151.7c0,0.5-0.3,0.8-0.8,0.8c-0.3,0-0.5-0.1-0.7-0.3c-7.6-10.3-25.5-25-30.4-24.7
c2.4-6.1,3.4-15.9,3.6-31.2C271.5,100.3,288.3,122.4,288.4,151.7z"/>
<path class="st8" d="M218.1,96.3c0.3,15.2,1.2,25,3.6,31.1l-0.2,0.1c-4.9-0.3-22.8,14.5-30.4,24.7c-0.3,0.4-0.8,0.5-1.1,0.2
c-0.2-0.2-0.4-0.4-0.3-0.7C189.7,122.3,206.6,100.2,218.1,96.3L218.1,96.3z"/>
<path class="st8" d="M250.7,81.6c0-6.4-5.2-11.6-11.6-11.6c-6.4,0-11.6,5.2-11.6,11.6s5.2,11.6,11.6,11.6l0,0
C245.5,93.2,250.7,88,250.7,81.6z M252.9,81.6c0,7.6-6.2,13.8-13.8,13.8c-7.6,0-13.8-6.2-13.8-13.8c0-7.6,6.2-13.8,13.8-13.8
c0,0,0,0,0,0C246.7,67.8,252.9,74,252.9,81.6z"/>
<path class="st8" d="M239.1,48.7c5.7,0,10.7-2,13.8-4.9c0.5,1.3,1,2.6,1.4,4c-3.3,3.3-8.9,5.4-15.3,5.4s-11.9-2.1-15.3-5.4
c0.5-1.3,1-2.7,1.4-4C228.4,46.8,233.4,48.7,239.1,48.7z"/>
<path class="st9" d="M252.9,43.8c-3.1,3-8.1,4.9-13.8,4.9s-10.7-2-13.8-4.9c2-5.1,4.5-10,7.6-14.5c0.5-0.7,0.9-1.3,1.4-1.9
c2-2.7,5.8-3.2,8.5-1.2c0.4,0.3,0.8,0.7,1.2,1.2c0.5,0.6,0.9,1.2,1.4,1.9C248.4,33.8,250.9,38.7,252.9,43.8z"/>
<path class="st10" d="M260.1,96.4c-0.3,15.3-1.2,25-3.6,31.2c-0.2,0.6-0.5,1.2-0.8,1.7c-3.1,6.2-8.3,7.9-16.6,7.9
s-13.5-1.7-16.6-7.9c-0.3-0.6-0.5-1.1-0.8-1.8c-2.4-6.2-3.4-15.9-3.6-31.1c-0.1-3.4-0.1-7.1-0.1-11.1c-0.1-12.7,1.8-25.4,5.8-37.5
c3.3,3.3,8.9,5.4,15.3,5.4s11.9-2.1,15.3-5.4c4,12.1,6,24.8,5.8,37.5C260.2,89.2,260.1,92.9,260.1,96.4z M252.9,81.6
c0-7.6-6.2-13.8-13.8-13.8c-7.6,0-13.8,6.2-13.8,13.8c0,7.6,6.2,13.8,13.8,13.8c0,0,0,0,0,0C246.7,95.4,252.9,89.2,252.9,81.6
L252.9,81.6z"/>
<path class="st12" d="M139.2,246.1l18.4,0.4v0.7l-19.4-0.4v-0.7V246C138.4,246.1,138.6,246.1,139.2,246.1z"/>
<linearGradient id="SVGID_6_" gradientUnits="userSpaceOnUse" x1="112.2357" y1="190.775" x2="112.2357" y2="101.005" gradientTransform="matrix(1 0 0 -1 0 264)">
<stop offset="0" style="stop-color:#81CFFF"/>
<stop offset="1" style="stop-color:#5ECFFF;stop-opacity:0"/>
</linearGradient>
<line class="st13" x1="112.2" y1="73.2" x2="112.2" y2="163"/>
<linearGradient id="SVGID_7_" gradientUnits="userSpaceOnUse" x1="348.955" y1="195.605" x2="348.955" y2="105.835" gradientTransform="matrix(1 0 0 -1 0 264)">
<stop offset="0" style="stop-color:#81CFFF"/>
<stop offset="1" style="stop-color:#5ECFFF;stop-opacity:0"/>
</linearGradient>
<line class="st14" x1="349" y1="68.4" x2="349" y2="158.2"/>
<linearGradient id="SVGID_8_" gradientUnits="userSpaceOnUse" x1="40.9" y1="120.12" x2="40.9" y2="64.49" gradientTransform="matrix(1 0 0 -1 0 264)">
<stop offset="0" style="stop-color:#81CFFF"/>
<stop offset="1" style="stop-color:#5ECFFF;stop-opacity:0"/>
</linearGradient>
<line class="st15" x1="40.9" y1="143.9" x2="40.9" y2="199.5"/>
<linearGradient id="SVGID_9_" gradientUnits="userSpaceOnUse" x1="64.97" y1="168.64" x2="64.97" y2="140.83" gradientTransform="matrix(1 0 0 -1 0 264)">
<stop offset="0" style="stop-color:#81CFFF"/>
<stop offset="1" style="stop-color:#5ECFFF;stop-opacity:0"/>
</linearGradient>
<line class="st16" x1="65" y1="95.4" x2="65" y2="123.2"/>
<linearGradient id="SVGID_10_" gradientUnits="userSpaceOnUse" x1="397.23" y1="159.8" x2="397.23" y2="131.98" gradientTransform="matrix(1 0 0 -1 0 264)">
<stop offset="0" style="stop-color:#81CFFF"/>
<stop offset="1" style="stop-color:#5ECFFF;stop-opacity:0"/>
</linearGradient>
<line class="st17" x1="397.2" y1="104.2" x2="397.2" y2="132"/>
<linearGradient id="SVGID_11_" gradientUnits="userSpaceOnUse" x1="424.75" y1="130.51" x2="424.75" y2="74.87" gradientTransform="matrix(1 0 0 -1 0 264)">
<stop offset="0" style="stop-color:#81CFFF"/>
<stop offset="1" style="stop-color:#5ECFFF;stop-opacity:0"/>
</linearGradient>
<line class="st18" x1="424.8" y1="133.5" x2="424.8" y2="189.1"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -6,9 +6,8 @@
<script setup name="App">
import i18n from '@/locales'
import { globalStore } from '@/store'
import store from '@/store'
const store = globalStore()
store.initTheme()
store.commit('initTheme')
const locale = i18n.global.messages[i18n.global.locale].lang
</script>

View File

@ -8,9 +8,9 @@
* 5.不可二次分发开源参与同类竞品如有想法可联系团队xiaonuobase@qq.com商议合作
* 6.若您的项目无法满足以上几点需要更多功能代码获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
import { moduleRequest } from '@/utils/request'
import { baseRequest } from '@/utils/request'
const request = moduleRequest(`/auth/b/`)
const request = (url, ...arg) => baseRequest(`/auth/b/${url}`, ...arg)
/**
* 登录
*

View File

@ -15,8 +15,6 @@
import 'tinymce/plugins/link' //
import 'tinymce/plugins/preview' //
import 'tinymce/plugins/table' //
import 'tinymce/plugins/lists' //
import 'tinymce/plugins/advlist' //
export default {
components: {
@ -41,12 +39,12 @@
},
plugins: {
type: [String, Array],
default: 'code image link preview table lists advlist'
default: 'code image link preview table'
},
toolbar: {
type: [String, Array],
default:
'undo redo | forecolor backcolor bold italic underline strikethrough link | blocks fontfamily fontsize | \
'undo redo | forecolor backcolor bold italic underline strikethrough link | formatselect fontselect fontsizeselect | \
alignleft aligncenter alignright alignjustify outdent indent lineheight | bullist numlist | \
image table preview | code selectall'
}

View File

@ -6,7 +6,6 @@
import './index.less'
export default {
name: 'STable',
components: {
draggable,
columnSetting
@ -43,8 +42,8 @@
default: 1
},
size: {
type: Number,
default: 10
type: String,
default: '10'
},
showSizeChanger: {
type: Boolean,
@ -144,7 +143,7 @@
(['auto', true].includes(this.showPagination) &&
Object.assign({}, this.localPagination, {
current: localPageNum,
pageSize: this.size, //this.compSize, size//
size: this.size, //this.compSize, size//
showSizeChanger: this.showSizeChanger,
defaultPageSize: this.defaultPageSize,
pageSizeOptions: this.pageSizeOptions,
@ -169,7 +168,7 @@
{},
{
current: 1,
pageSize: this.localPagination.pageSize
size: this.size
}
))
this.loadData()
@ -188,12 +187,11 @@
(pagination && pagination.current) ||
(this.showPagination && this.localPagination.current) ||
this.pageNum,
// 使size
size:
(pagination && pagination.pageSize) ||
(this.showPagination && this.localPagination.pageSize) ||
this.pageSize ||
this.localPagination.pageSize
this.localPagination.size
},
(sorter &&
sorter.field && {
@ -229,7 +227,7 @@
showTotal: (total, range) => {
return `${range[0]}-${range[1]}${total}`
},
pageSize: (pagination && pagination.pageSize) || this.localPagination.pageSize
size: (pagination && pagination.size) || this.localPagination.size
})) ||
false
// recordsnull

View File

@ -1,67 +0,0 @@
<template>
<a-popconfirm
title="批量处理此信息?"
:visible="batchVisible"
@visibleChange="batchVisibleChange"
@confirm="deleteBatch"
>
<a-button :type="props.buttonType" :danger="props.buttonDanger">
<template #icon v-if="props.icon">
<component :is="props.icon" />
</template>
{{ props.buttonName }}
</a-button>
</a-popconfirm>
</template>
<script setup name="commonBatchButton">
import { message } from 'ant-design-vue'
const batchVisible = ref(false)
const emit = defineEmits({ batchCallBack: null })
const props = defineProps({
buttonName: {
type: String,
default: () => '批量操作'
},
buttonDanger: {
type: Boolean,
default: () => false
},
buttonType: {
type: String,
default: () => ''
},
icon: {
type: String,
default: () => ''
},
selectedRowKeys: {
type: Array,
default: () => []
}
})
//
const batchVisibleChange = () => {
if (batchVisible.value) {
batchVisible.value = false
return false
}
if (props.selectedRowKeys.length < 1) {
message.warning('请选择一条或多条数据')
batchVisible.value = false
return false
} else {
batchVisible.value = true
}
}
//
const deleteBatch = () => {
const params = props.selectedRowKeys.map((m) => {
return {
id: m
}
})
//
emit('batchCallBack', params)
}
</script>

View File

@ -1,19 +1,20 @@
<template>
<a-modal v-if="isModal" :visible="visible" @cancel="cancel" v-bind="$attrs">
<Modal v-if="isModal" :visible="visible" @cancel="cancel" v-bind="$attrs">
<template v-for="slotKey in slotKeys" #[slotKey]>
<slot :name="slotKey" />
</template>
</a-modal>
<a-drawer v-else :visible="visible" v-bind="$attrs" :footer-style="{ textAlign: 'right' }">
</Modal>
<Drawer v-else :visible="visible" v-bind="$attrs" :footer-style="{ textAlign: 'right' }">
<template v-for="slotKey in slotKeys" #[slotKey]>
<slot :name="slotKey" />
</template>
</a-drawer>
</Drawer>
</template>
<script>
import { mapState } from 'pinia'
import { globalStore } from '@/store'
import { Drawer, Modal } from 'ant-design-vue'
import { modalProps } from 'ant-design-vue/es/modal/Modal'
import { drawerProps } from 'ant-design-vue/es/drawer'
const FormContainerTypeEnum = {
DRAWER: 'drawer',
@ -21,21 +22,26 @@
}
export default {
name: 'XnFormContainer',
components: {
Drawer,
Modal
},
inheritAttrs: false,
props: {
visible: {
type: Boolean,
default: false,
required: true
}
},
...modalProps,
...drawerProps
},
computed: {
...mapState(globalStore, ['formStyle']),
slotKeys() {
return Object.keys(this.$slots)
},
isModal() {
return FormContainerTypeEnum.MODAL === this.formStyle
return FormContainerTypeEnum.MODAL === this.$store.state.global.formStyle
}
},
methods: {

View File

@ -54,7 +54,7 @@
}*/
/** 滚动条 */
:deep(.hljs,.hljs-container) {
/*:deep(.hljs,.hljs-container) {
max-height: 300px!important;
overflow-x: auto;
}
@ -87,5 +87,5 @@
::-webkit-scrollbar-button {
display: none;
}
}*/
</style>

View File

@ -1,12 +1,5 @@
<template>
<xn-form-container
ref="signModel"
v-model:visible="visible"
:width="700"
title="电子签名"
@close="handleClear"
@ok="handleOk"
>
<xn-form-container ref="signModel" v-model:visible="visible" :width="700" title="电子签名" @close="handleClear" @ok="handleOk">
<a-row :gutter="5">
<a-col :span="15">
<div style="border: 1px solid rgb(236 236 236)">

View File

@ -27,6 +27,19 @@ body {
margin: 24px 0 0;
}
}
/**
* ant-table-wrapper
* 覆盖的表格手机模式样式,如果想修改在手机上表格最低宽度,可以在这里改动
*/
.ant-table-wrapper {
.ant-table-content {
overflow-y: auto;
}
.ant-table-body {
min-width: 800px;
}
}
.topmenu {
/* 必须为 topmenu 才能启用流式布局 */
&.content-width-Fluid {

View File

@ -16,7 +16,7 @@ const DEFAULT_CONFIG = {
API_URL: import.meta.env.VITE_API_BASEURL,
// 请求超时
TIMEOUT: 60000,
TIMEOUT: 10000,
// TokenName // Authorization
TOKEN_NAME: 'token',

View File

@ -1,8 +1,18 @@
/* eslint-disable eqeqeq */
<!--
* @Descripttion: 处理iframe持久化涉及store(VUEX)
* @version: 1.0
* @Author: sakuya
* @Date: 2021年6月30日13:20:41
* @LastEditors:
* @LastEditTime:
-->
<template>
<div v-show="$route.meta.type === 'iframe'" class="iframe-pages">
<div v-show="$route.meta.type == 'iframe'" class="iframe-pages">
<iframe
v-for="item in iframeList"
v-show="$route.meta.url === item.meta.url"
v-show="$route.meta.url == item.meta.url"
:key="item.meta.url"
:src="item.meta.url"
frameborder="0"
@ -11,16 +21,20 @@
</template>
<script>
import { mapState, mapActions } from 'pinia'
import { iframeStore, globalStore } from '@/store'
export default {
data() {
return {}
},
computed: {
...mapState(iframeStore, ['iframeList']),
...mapState(globalStore, ['ismobile', 'layoutTags'])
iframeList() {
return this.$store.state.iframe.iframeList
},
ismobile() {
return this.$store.state.global.ismobile
},
layoutTags() {
return this.$store.state.global.layoutTags
}
},
watch: {
$route(e) {
@ -32,16 +46,16 @@
},
mounted() {},
methods: {
...mapActions(iframeStore, ['setIframeList', 'pushIframeList', 'clearIframeList']),
push(route) {
if (route.meta.type === 'iframe') {
// eslint-disable-next-line eqeqeq
if (route.meta.type == 'iframe') {
if (this.ismobile || !this.layoutTags) {
this.setIframeList(route)
this.$store.commit('setIframeList', route)
} else {
this.pushIframeList(route)
this.$store.commit('pushIframeList', route)
}
} else if (this.ismobile || !this.layoutTags) {
this.clearIframeList()
this.$store.commit('clearIframeList')
}
}
}

View File

@ -1,6 +1,5 @@
import { mapState, mapActions } from 'pinia'
import { mapState, mapMutations } from 'vuex'
import hotkeys from 'hotkeys-js'
import { searchStore } from '@/store'
export default {
mounted() {
@ -20,16 +19,19 @@ export default {
hotkeys.unbind(this.searchHotkey.close)
},
computed: {
...mapState(searchStore, {
...mapState('search', {
searchActive: (state) => state.active,
searchHotkey: (state) => state.hotkey
})
},
methods: {
...mapActions(searchStore, ['toggleActive', 'setActive']),
...mapMutations({
searchToggle: 'search/toggle',
searchSet: 'search/set'
}),
// 接收点击搜索按钮
handleSearchClick() {
this.toggleActive()
this.searchToggle()
if (this.searchActive) {
setTimeout(() => {
if (this.$refs.panelSearch) {
@ -40,7 +42,7 @@ export default {
},
searchPanelOpen() {
if (!this.searchActive) {
this.setActive(true)
this.searchSet(true)
setTimeout(() => {
if (this.$refs.panelSearch) {
this.$refs.panelSearch.focus()
@ -51,7 +53,7 @@ export default {
// 关闭搜索面板
searchPanelClose() {
if (this.searchActive) {
this.setActive(false)
this.searchSet(false)
}
}
}

View File

@ -1,27 +1,15 @@
<template>
<div class="layout-items-center" v-if="moduleUnfoldOpen">
<a-menu
v-model:selectedKeys="selectedKeys"
mode="horizontal"
v-if="menu && menu.length > 1"
class="module-menu"
id="moduleMunu"
>
<a-menu-item
v-for="item in menu"
:key="item.id"
class="!px-3"
style="position: relative"
@click="moduleClick(item.id)"
>
<div v-if="moduleUnfoldOpen">
<a-menu v-model:selectedKeys="selectedKeys" mode="horizontal" v-if="menu && menu.length > 1" class="module-menu" id="moduleMunu">
<a-menu-item v-for="item in menu" :key="item.id" style="padding-right: 5px;position: relative;" @click="moduleClick(item.id)">
<template #icon>
<component :is="item.meta.icon" />
<component :is="item.meta.icon"/>
</template>
<span style="margin-left: -5px">{{ item.meta.title }}</span>
<span style="margin-left:-5px">{{ item.meta.title }}</span>
</a-menu-item>
</a-menu>
</div>
<div v-else class="panel-item hidden-sm-and-down">
<div v-else>
<a-popover v-if="menu.length > 1" placement="bottomLeft">
<template #content>
<a-row :gutter="[0, 5]" class="module-row">
@ -35,7 +23,9 @@
</div>
</a-row>
</template>
<appstore-outlined />
<div class="module-comp">
<appstore-outlined />
</div>
</a-popover>
</div>
</template>
@ -43,23 +33,18 @@
<script setup>
import router from '@/router'
import tool from '@/utils/tool'
import { globalStore } from '@/store'
import store from '@/store'
import { watch } from 'vue'
import { storeToRefs } from 'pinia'
const store = globalStore()
const { moduleUnfoldOpen, topHanderThemeColorOpen } = storeToRefs(store)
const moduleBackColor = ref(topHanderThemeColorOpen)
//
watch(moduleUnfoldOpen, (newValue) => {
watch(() => store.state.global.moduleUnfoldOpen, (newValue) => {
moduleUnfoldOpen.value = newValue
nextTick(() => {
setModuleBackColor()
})
})
//
watch(topHanderThemeColorOpen, (newValue) => {
watch(() => store.state.global.topHanderThemeColorOpen, (newValue) => {
moduleBackColor.value = newValue
setModuleBackColor()
})
@ -75,6 +60,9 @@
})
}
const moduleUnfoldOpen = ref(store.state.global.moduleUnfoldOpen)
const moduleBackColor = ref(store.state.global.topHanderThemeColorOpen)
onMounted(() => {
setModuleBackColor()
})
@ -83,19 +71,17 @@
if (moduleUnfoldOpen.value) {
try {
const moduleMunu = document.getElementById('moduleMunu')
moduleBackColor.value
? moduleMunu.classList.add('module-menu-color')
moduleBackColor.value? moduleMunu.classList.add('module-menu-color')
: moduleMunu.classList.remove('module-menu-color')
} catch (err) {}
} catch (err) { }
setSelectedKeys()
}
}
//
const setSelectedKeys = () => {
//
moduleBackColor.value
? (selectedKeys.value = new Array([]))
: (selectedKeys.value = [tool.data.get('SNOWY_MENU_MODULE_ID')])
moduleBackColor.value? selectedKeys.value = new Array([])
: selectedKeys.value = [tool.data.get('SNOWY_MENU_MODULE_ID')]
}
</script>
@ -121,17 +107,27 @@
color: white;
font-size: 8px;
}
.ant-menu-horizontal > .ant-menu-item::after,
.ant-menu-horizontal > .ant-menu-submenu::after {
.module-comp {
display: flex;
padding: 0 15px;
height: 49px;
text-align: center;
justify-content: center;
align-items: center;
cursor: pointer;
}
.module-comp:hover {
background: var(--header-color-split);
}
.ant-menu-horizontal > .ant-menu-item::after, .ant-menu-horizontal > .ant-menu-submenu::after {
content: none;
}
.module-menu {
.module-menu{
line-height: 50px;
border-bottom: 0px;
width: 105%;
flex: 0 0 auto;
}
.module-menu-color {
.module-menu-color{
color: white;
background-color: var(--primary-color);
}

View File

@ -78,8 +78,7 @@
<script>
import Fuse from 'fuse.js'
import { mapState } from 'pinia'
import { searchStore } from '@/store'
import { mapState } from 'vuex'
export default {
data() {
@ -90,7 +89,7 @@
}
},
computed: {
...mapState(searchStore, ['pool']),
...mapState('search', ['pool']),
//
resultsList() {
return this.results.length === 0 || this.searchText === '' ? this.pool : this.results
@ -208,22 +207,22 @@
</script>
<style lang="less" scoped>
:deep(.ant-input) {
:deep(.ant-input){
height: 35px;
}
:deep(.ant-input:not(:first-child)) {
:deep(.ant-input:not(:first-child)){
padding-left: 10px;
}
:deep(.ant-input-prefix) {
:deep(.ant-input-prefix){
font-size: 20px;
}
:deep(.ant-list-sm .ant-list-item) {
:deep(.ant-list-sm .ant-list-item){
padding: 4px 16px;
}
:deep(.ant-list-item-meta) {
:deep(.ant-list-item-meta){
align-items: center;
}
:deep(.ant-list-item.active) {
:deep(.ant-list-item.active){
background-color: var(--primary-1);
}
.search-box {

View File

@ -4,21 +4,20 @@
<h3>整体风格设置</h3>
<div class="snowy-setting-checkbox">
<a-tooltip v-for="(a, i) in sideStyleList" :key="i" placement="top">
<template #title>
<span>{{ a.tips }}</span>
</template>
<template #title
><span>{{ a.tips }}</span></template
>
<div :class="['snowy-setting-checkbox-item', a.style]" @click="setSideStyle(a.value)">
<check-outlined v-if="theme === a.value" class="snowy-setting-checkbox-item-select-icon" />
<check-outlined v-if="sideStyle === a.value" class="snowy-setting-checkbox-item-select-icon" />
</div>
</a-tooltip>
</div>
<h3>整体界面布局</h3>
<div class="snowy-setting-checkbox">
<a-tooltip v-for="(a, i) in layoutList" :key="i" placement="top">
<template #title>
<span>{{ a.tips }}</span>
</template>
<template #title
><span>{{ a.tips }}</span></template
>
<div :class="['snowy-setting-checkbox-item', a.style]" @click="layoutStyle(a.value)">
<div class="snowy-setting-layout-menu-doublerow-inner" />
<check-outlined v-if="layout === a.value" class="snowy-setting-checkbox-item-select-icon" />
@ -26,9 +25,9 @@
</a-tooltip>
</div>
<a-divider />
<div class="mb-4">
<div :style="{ marginBottom: '24px' }">
<h3>主题色</h3>
<div class="h-[50px]">
<div style="height: 50px">
<a-tooltip v-for="(item, index) in colorList" :key="index" class="snowy-setting-theme-color-colorBlock">
<template #title>
<span>{{ item.key }}</span>
@ -39,40 +38,42 @@
</a-tooltip>
</div>
</div>
<div class="mb-4 layout-slide">
<h4 class="">顶栏应用主题色</h4>
<a-switch :checked="topHanderThemeColorOpen" @change="changeTopHanderThemeColorOpen" />
<div :style="{ marginBottom: '24px' }">
<span
><h4>顶栏应用主题色<a-switch style="float: right" v-model:checked="topHanderThemeColorOpen" /></h4
></span>
</div>
<div class="mb-4 layout-slide">
<h4>顶栏主题色通栏</h4>
<a-switch
style="float: right"
:checked="topHanderThemeColorSpread"
:disabled="!topHanderThemeColorOpen"
@change="changeTopHanderThemeColorSpread"
/>
<div :style="{ marginBottom: '24px' }">
<span
><h4>
顶栏主题色通栏<a-switch
style="float: right"
v-model:checked="topHanderThemeColorSpread"
:disabled="!topHanderThemeColorOpen"
/></h4
></span>
</div>
<a-divider />
<a-form ref="form" class="text-right">
<a-form ref="form" style="text-align: right">
<a-form-item label="模块坞">
<a-switch :checked="moduleUnfoldOpen" @change="toggleState('moduleUnfoldOpen')" />
<a-switch v-model:checked="moduleUnfoldOpen" />
</a-form-item>
<a-form-item label="面包屑">
<a-switch :checked="breadcrumbOpen" @change="toggleState('breadcrumbOpen')" />
<a-switch v-model:checked="breadcrumbOpen" />
</a-form-item>
<a-form-item label="多标签">
<a-switch :checked="layoutTagsOpen" @change="toggleState('layoutTagsOpen')" />
<a-switch v-model:checked="layoutTagsOpen" />
</a-form-item>
<a-form-item label="折叠菜单">
<a-switch :checked="menuIsCollapse" @change="toggleState('menuIsCollapse')" />
<a-switch v-model:checked="menuIsCollapse" />
</a-form-item>
<a-form-item label="菜单排他展开">
<a-switch :checked="sideUniqueOpen" @change="toggleState('sideUniqueOpen')" />
<a-switch v-model:checked="sideUniqueOpen" />
</a-form-item>
<a-form-item label="表单风格">
<a-select
:value="formStyle"
class="!w-[80px]"
v-model:value="formStyle"
style="width: 80px"
size="small"
:options="xnFormStyleOptions"
@change="formStyleChange"
@ -90,22 +91,13 @@
<script>
import { colorList } from '@/config/settingConfig'
import { ThemeModeEnum } from '@/utils/enum'
import { globalStore } from '@/store'
import { mapState, mapStores } from 'pinia'
import tool from '@/utils/tool'
const toolDataNameMap = {
menuIsCollapse: 'MENU_COLLAPSE',
sideUniqueOpen: 'SIDE_UNIQUE_OPEN',
layoutTagsOpen: 'LAYOUT_TAGS_OPEN',
breadcrumbOpen: 'BREADCRUMD_OPEN',
topHanderThemeColorOpen: 'TOP_HANDER_THEME_COLOR_OPEN',
topHanderThemeColorSpread: 'TOP_HANDER_THEME_COLOR_SPREAD',
moduleUnfoldOpen: 'MODULE_UNFOLD_OPEN'
}
export default defineComponent({
data() {
return {
//
sideStyle: tool.data.get('SNOWY_THEME') || this.$store.state.global.theme,
sideStyleList: [
{
tips: '暗色主题风格',
@ -123,6 +115,7 @@
style: 'snowy-setting-checkbox-item-realdark'
}
],
layout: tool.data.get('SNOWY_LAYOUT') || this.$store.state.global.layout,
layoutList: [
{
tips: '经典',
@ -145,61 +138,106 @@
value: 'modal'
}
],
topHanderThemeColorOpen:
tool.data.get('SNOWY_TOP_HANDER_THEME_COLOR_OPEN') || this.$store.state.global.topHanderThemeColorOpen,
topHanderThemeColorSpread:
tool.data.get('SNOWY_TOP_HANDER_THEME_COLOR_SPREAD') ||
this.$store.state.global.topHanderThemeColorSpread,
menuIsCollapse: tool.data.get('SNOWY_MENU_COLLAPSE') || this.$store.state.global.menuIsCollapse,
sideUniqueOpen: tool.data.get('SNOWY_SIDE_UNIQUE_OPEN') || this.$store.state.global.sideUniqueOpen,
layoutTagsOpen: tool.data.get('SNOWY_LAYOUT_TAGS_OPEN') || this.$store.state.global.layoutTagsOpen,
breadcrumbOpen: tool.data.get('SNOWY_BREADCRUMD_OPEN') || this.$store.state.global.breadcrumbOpen,
moduleUnfoldOpen: tool.data.get('SNOWY_MODULE_UNFOLD_OPEN') || this.$store.state.global.moduleUnfoldOpen,
theme: tool.data.get('APP_THEME') || this.$store.state.global.theme,
themeColor: tool.data.get('SNOWY_THEME_COLOR') || this.$store.state.global.themeColor,
formStyle: tool.data.get('SNOWY_FORM_STYLE') || this.$store.state.global.formStyle,
colorList
}
},
computed: {
...mapStores(globalStore),
...mapState(globalStore, [
'theme',
'themeColor',
'layout',
'menuIsCollapse',
'sideUniqueOpen',
'layoutTagsOpen',
'breadcrumbOpen',
'moduleUnfoldOpen',
'topHanderThemeColorOpen',
'topHanderThemeColorSpread',
'formStyle'
])
},
mounted() {},
methods: {
changeTopHanderThemeColorOpen() {
this.toggleState('topHanderThemeColorOpen')
if (!this.topHanderThemeColorOpen) {
this.globalStore.topHanderThemeColorSpread = false
watch: {
menuIsCollapse() {
this.$store.commit('TOGGLE_menuIsCollapse')
if (this.$store.state.global.menuIsCollapse) {
tool.data.set('SNOWY_MENU_COLLAPSE', true)
} else {
tool.data.set('SNOWY_MENU_COLLAPSE', false)
}
},
sideUniqueOpen() {
this.$store.commit('TOGGLE_sideUniqueOpen')
if (this.$store.state.global.sideUniqueOpen) {
tool.data.set('SNOWY_SIDE_UNIQUE_OPEN', true)
} else {
tool.data.set('SNOWY_SIDE_UNIQUE_OPEN', false)
}
},
layoutTagsOpen() {
this.$store.commit('TOGGLE_layoutTagsOpen')
if (this.$store.state.global.layoutTagsOpen) {
tool.data.set('SNOWY_LAYOUT_TAGS_OPEN', true)
} else {
tool.data.set('SNOWY_LAYOUT_TAGS_OPEN', false)
}
},
breadcrumbOpen() {
this.$store.commit('TOGGLE_breadcrumbOpen')
if (this.$store.state.global.breadcrumbOpen) {
tool.data.set('SNOWY_BREADCRUMD_OPEN', true)
} else {
tool.data.set('SNOWY_BREADCRUMD_OPEN', false)
}
},
topHanderThemeColorOpen() {
this.$store.commit('TOGGLE_topHanderThemeColorOpen')
if (this.$store.state.global.topHanderThemeColorOpen) {
tool.data.set('SNOWY_TOP_HANDER_THEME_COLOR_OPEN', true)
} else {
//
tool.data.set('SNOWY_TOP_HANDER_THEME_COLOR_OPEN', false)
// false
this.topHanderThemeColorSpread = false
}
},
topHanderThemeColorSpread() {
this.$store.commit('TOGGLE_topHanderThemeColorSpread')
if (this.$store.state.global.topHanderThemeColorSpread) {
tool.data.set('SNOWY_TOP_HANDER_THEME_COLOR_SPREAD', true)
} else {
tool.data.set('SNOWY_TOP_HANDER_THEME_COLOR_SPREAD', false)
}
},
changeTopHanderThemeColorSpread() {
this.toggleState('topHanderThemeColorSpread')
},
toggleState(stateName) {
this.globalStore.toggleConfig(stateName)
const toolDataName = toolDataNameMap[stateName]
tool.data.set(`SNOWY_${toolDataName}`, this.globalStore[stateName])
moduleUnfoldOpen() {
this.$store.commit('TOGGLE_moduleUnfoldOpen')
if (this.$store.state.global.moduleUnfoldOpen) {
tool.data.set('SNOWY_MODULE_UNFOLD_OPEN', true)
} else {
tool.data.set('SNOWY_MODULE_UNFOLD_OPEN', false)
}
},
},
methods: {
//
setSideStyle(value) {
this.globalStore.setTheme(value)
this.$store.commit('SET_theme', value)
this.sideStyle = value
tool.data.set('SNOWY_THEME', value)
},
//
layoutStyle(value) {
this.globalStore.setLayout(value)
this.$store.commit('SET_layout', value)
tool.data.set('SNOWY_LAYOUT', value)
this.layout = value
},
//
tagColor(value) {
this.themeColor = value
tool.data.set('SNOWY_THEME_COLOR', value)
this.globalStore.setThemeColor(value)
this.$store.commit('SET_themeColor', value)
},
//
formStyleChange(value) {
tool.data.set('SNOWY_FORM_STYLE', value)
this.globalStore.setFormStyle(value)
this.$store.commit('SET_formStyle', value)
}
}
})

View File

@ -19,8 +19,8 @@
<script>
import NavMenu from './NavMenu.vue'
import { globalStore } from '@/store'
import { mapState } from 'pinia'
import tool from '@/utils/tool'
import store from '@/store'
export default {
components: {
@ -69,12 +69,10 @@
data() {
return {
visible: false,
menu: []
menu: [],
sysBaseConfig: tool.data.get('SNOWY_SYS_BASE_CONFIG') || store.state.global.sysBaseConfig
}
},
computed: {
...mapState(globalStore, ['sysBaseConfig'])
},
created() {
const menu = this.$router.getMenu()
this.menu = this.filterUrl(menu)

View File

@ -60,8 +60,6 @@
<script>
import tool from '@/utils/tool'
import XnContextMenu from '@/components/XnContextMenu/index.vue'
import {globalStore, iframeStore, keepAliveStore, viewTagsStore} from '@/store'
import { mapState, mapActions } from 'pinia'
export default {
name: 'Tags',
@ -69,7 +67,7 @@
props: {},
data() {
return {
// tagList: [],
tagList: this.$store.state.viewTags.viewTags,
activeKey: this.$route.fullPath,
maxTabs: 20,
contextMenuTarget: null,
@ -77,19 +75,9 @@
currentContextMenuTabIndex: 0
}
},
computed: {
...mapState(viewTagsStore, ['viewTags']),
...mapState(globalStore, ['layoutTagsOpen']),
tagList() {
return this.viewTags
}
},
watch: {
$route(to) {
this.addViewTags(to)
},
layoutTagsOpen() {
this.closeOtherCacheTabs()
}
},
created() {
@ -110,9 +98,6 @@
}
},
methods: {
...mapActions(viewTagsStore, ['addViewTags', 'pushViewTags', 'removeViewTags']),
...mapActions(iframeStore, ['addIframe', 'removeIframeList', 'refreshIframe']),
...mapActions(keepAliveStore, ['pushKeepLive', 'removeKeepLive', 'setRouteShow']),
handleTabContextMenu(evt) {
evt.preventDefault()
let target = evt.target
@ -165,13 +150,14 @@
// tag
addViewTags(route) {
this.activeKey = route.fullPath
if (route.name && !route.meta.fullpage) {
this.pushViewTags(route)
this.pushKeepLive(route.name)
this.$store.commit('pushViewTags', route)
this.$store.commit('pushKeepLive', route.name)
}
if (this.tagList.length - 1 > this.maxTabs) {
const firstTag = this.tagList[1]
this.removeViewTags(firstTag)
this.$store.commit('removeViewTags', firstTag)
}
},
// tag
@ -180,9 +166,9 @@
},
// tag
closeSelectedTag(tag, autoPushLatestView = true) {
this.removeViewTags(tag)
this.removeIframeList(tag)
this.removeKeepLive(tag.name)
this.$store.commit('removeViewTags', tag)
this.$store.commit('removeIframeList', tag)
this.$store.commit('removeKeepLive', tag.name)
if (autoPushLatestView && this.isActive(tag)) {
const latestView = this.tagList.slice(-1)[0]
if (latestView) {
@ -204,13 +190,13 @@
query: nowTag.query
})
}
this.refreshIframe(nowTag)
this.$store.commit('refreshIframe', nowTag)
setTimeout(() => {
this.removeKeepLive(nowTag.name)
this.setRouteShow(false)
this.$store.commit('removeKeepLive', nowTag.name)
this.$store.commit('setRouteShow', false)
this.$nextTick(() => {
this.pushKeepLive(nowTag.name)
this.setRouteShow(true)
this.$store.commit('pushKeepLive', nowTag.name)
this.$store.commit('setRouteShow', true)
})
}, 0)
},
@ -244,13 +230,6 @@
}
})
},
//
closeOtherCacheTabs () {
const tags = [...this.tagList]
tags.forEach((tag) => {
this.closeSelectedTag(tag, false)
})
},
// TAB
maximize() {
this.contextMenuVisible = false

View File

@ -81,8 +81,6 @@
import devUserMessage from './message.vue'
import panelSearch from './panel-search/index.vue'
import mixinSearch from './mixins/search'
import { mapState } from 'pinia'
import { globalStore } from '@/store'
export default {
components: {
setting,
@ -94,18 +92,29 @@
return {
lang: [],
settingDialog: false,
userInfo: {},
userName: '',
userNameF: '',
setDeawer: import.meta.env.VITE_SET_DRAWER
}
},
computed: {
...mapState(globalStore, ['ismobile', 'userInfo'])
ismobile() {
return this.$store.state.global.ismobile
},
userInfoWatch() {
return this.$store.state.global.userInfo
}
},
watch: {
userInfoWatch(newVal, oldVal) {
this.userInfo = newVal
}
},
created() {
//
this.lang = new Array(this.$TOOL.data.get('APP_LANG') || this.$CONFIG.LANG)
this.userInfo = this.$TOOL.data.get('USER_INFO')
this.userName = this.userInfo?.userName || ''
this.userNameF = this.userName.substring(0, 1)
},
@ -204,6 +213,18 @@
align-items: center;
height: 100%;
}
.user-bar .panel-item {
padding: 0 10px;
cursor: pointer;
height: 100%;
display: flex;
align-items: center;
}
.user-bar .panel-item i {
}
.user-bar .panel-item:hover {
background: var(--header-color-split);
}
.user-bar .user-avatar {
height: 49px;
display: flex;

View File

@ -4,7 +4,7 @@
<a-layout>
<a-layout-sider
v-if="!ismobile"
v-model:collapsed="menuIsCollapse"
v-model:collapsed="$store.state.global.menuIsCollapse"
:trigger="null"
collapsible
:theme="sideTheme"
@ -18,7 +18,7 @@
</div>
</div>
</header>
<div :class="menuIsCollapse ? 'aminui-side isCollapse' : 'aminui-side'">
<div :class="$store.state.global.menuIsCollapse ? 'aminui-side isCollapse' : 'aminui-side'">
<div class="adminui-side-scroll">
<a-menu
v-model:openKeys="openKeys"
@ -28,21 +28,17 @@
@select="onSelect"
@openChange="onOpenChange"
>
<NavMenu :nav-menus="menu" />
<NavMenu :nav-menus="menu"></NavMenu>
</a-menu>
</div>
</div>
</a-layout-sider>
<!-- 手机端情况下的左侧菜单 -->
<Side-m v-if="ismobile" />
<Side-m v-if="ismobile"></Side-m>
<!-- 右侧布局 -->
<a-layout>
<div id="snowyHeader" class="snowy-header">
<div class="snowy-header-left" style="padding-left: 0px">
<div v-if="!ismobile" class="panel-item hidden-sm-and-down" @click="menuIsCollapseClick">
<MenuUnfoldOutlined v-if="menuIsCollapse" />
<MenuFoldOutlined v-else />
</div>
<moduleMenu @switchModule="switchModule" />
<Topbar v-if="!ismobile && breadcrumbOpen" />
</div>
@ -51,15 +47,15 @@
</div>
</div>
<!-- 多标签 -->
<Tags v-if="!ismobile && layoutTagsOpen" />
<Tags v-if="!ismobile && layoutTagsOpen"></Tags>
<a-layout-content class="main-content-wrapper">
<div id="adminui-main" class="adminui-main">
<router-view v-slot="{ Component }">
<keep-alive :include="keepLiveRoute">
<component :is="Component" :key="$route.name" v-if="routeShow" />
<keep-alive :include="$store.state.keepAlive.keepLiveRoute">
<component :is="Component" :key="$route.name" v-if="$store.state.keepAlive.routeShow" />
</keep-alive>
</router-view>
<iframe-view />
<iframe-view></iframe-view>
<div class="main-bottom-wrapper">
<a style="color: #a0a0a0" :href="sysBaseConfig.SNOWY_SYS_COPYRIGHT_URL" target="_blank">{{
sysBaseConfig.SNOWY_SYS_COPYRIGHT
@ -119,7 +115,7 @@
<a-layout-sider
v-if="!ismobile"
v-show="layoutSiderDowbleMenu"
v-model:collapsed="menuIsCollapse"
v-model:collapsed="$store.state.global.menuIsCollapse"
:trigger="null"
width="170"
collapsible
@ -129,25 +125,21 @@
<h2 class="snowy-title">{{ pmenu.meta.title }}</h2>
</div>
<a-menu
v-model:collapsed="menuIsCollapse"
v-model:collapsed="$store.state.global.menuIsCollapse"
v-model:openKeys="openKeys"
v-model:selectedKeys="selectedKeys"
mode="inline"
:theme="secondMenuSideTheme"
@select="onSelect"
>
<NavMenu :nav-menus="nextMenu" />
<NavMenu :nav-menus="nextMenu"></NavMenu>
</a-menu>
</a-layout-sider>
<!-- 手机端情况下的左侧菜单 -->
<Side-m v-if="ismobile" />
<Side-m v-if="ismobile"></Side-m>
<a-layout>
<div id="snowyHeader" class="snowy-header">
<div class="snowy-header-left" style="padding-left: 0px">
<div v-if="!ismobile" class="panel-item hidden-sm-and-down" @click="menuIsCollapseClick">
<MenuUnfoldOutlined v-if="menuIsCollapse" />
<MenuFoldOutlined v-else />
</div>
<moduleMenu @switchModule="switchModule" />
<Topbar v-if="!ismobile && breadcrumbOpen" />
</div>
@ -160,14 +152,14 @@
<a-layout-content class="main-content-wrapper">
<div id="adminui-main" class="adminui-main">
<router-view v-slot="{ Component }">
<keep-alive :include="keepLiveRoute">
<component :is="Component" v-if="routeShow" :key="$route.name" />
<keep-alive :include="$store.state.keepAlive.keepLiveRoute">
<component :is="Component" v-if="$store.state.keepAlive.routeShow" :key="$route.name" />
</keep-alive>
</router-view>
<iframe-view />
<iframe-view></iframe-view>
<div class="main-bottom-wrapper">
<a style="color: #a0a0a0" :href="sysBaseConfig.SNOWY_SYS_COPYRIGHT_URL" target="_blank">{{
sysBaseConfig.SNOWY_SYS_COPYRIGHT
sysBaseConfig.SNOWY_SYS_COPYRIGHT
}}</a>
</div>
</div>
@ -191,9 +183,8 @@
import iframeView from './components/iframeView.vue'
import moduleMenu from './components/moduleMenu.vue'
import { ThemeModeEnum } from '@/utils/enum'
import { globalStore, keepAliveStore } from '@/store'
import { mapState, mapStores, mapActions } from 'pinia'
import tool from '@/utils/tool'
import store from '@/store'
export default defineComponent({
name: 'Index',
@ -217,32 +208,39 @@
onSelectTag: false,
selectedKeys: [],
openKeys: [],
openKeysOther: []
openKeysOther: [],
sysBaseConfig: tool.data.get('SNOWY_SYS_BASE_CONFIG') || store.state.global.sysBaseConfig
}
},
computed: {
...mapStores(globalStore),
...mapState(globalStore, [
'theme',
'ismobile',
'layout',
'layoutTagsOpen',
'menuIsCollapse',
'breadcrumbOpen',
'topHanderThemeColorOpen',
'topHanderThemeColorSpread',
'topHanderThemeColor',
'sideUniqueOpen',
'sysBaseConfig'
]),
...mapState(keepAliveStore, ['keepLiveRoute', 'routeShow']),
sideTheme() {
const theme = this.theme
const theme = this.$store.state.global.theme
return theme === ThemeModeEnum.REAL_DARK ? ThemeModeEnum.DARK : theme
},
secondMenuSideTheme() {
const theme = this.theme
const theme = this.$store.state.global.theme
return theme === ThemeModeEnum.REAL_DARK ? ThemeModeEnum.DARK : ThemeModeEnum.LIGHT
},
ismobile() {
return this.$store.state.global.ismobile
},
layout() {
return this.$store.state.global.layout
},
layoutTagsOpen() {
return this.$store.state.global.layoutTagsOpen
},
menuIsCollapse() {
return this.$store.state.global.menuIsCollapse
},
breadcrumbOpen() {
return this.$store.state.global.breadcrumbOpen
},
topHanderThemeColorOpen() {
return this.$store.state.global.topHanderThemeColorOpen
},
topHanderThemeColorSpread() {
return this.$store.state.global.topHanderThemeColorSpread
}
},
watch: {
@ -275,7 +273,7 @@
window.addEventListener('resize', this.onLayoutResize)
this.moduleMenu = this.$router.getMenu()
//
const menuModuleId = tool.data.get('SNOWY_MENU_MODULE_ID')
const menuModuleId = this.$TOOL.data.get('SNOWY_MENU_MODULE_ID')
let menu = []
if (menuModuleId) {
//
@ -296,7 +294,6 @@
this.switchoverTopHanderThemeColor()
},
methods: {
...mapActions(globalStore, ['setTheme', 'setIsmobile', 'setLayout', 'setMenuIsCollapse']),
//
switchModule(id) {
const menu = this.moduleMenu
@ -304,7 +301,7 @@
const menus = menu.filter((item) => item.id === id)[0].children
if (menus.length > 0) {
//
tool.data.set('SNOWY_MENU_MODULE_ID', id)
this.$TOOL.data.set('SNOWY_MENU_MODULE_ID', id)
//
this.menu = this.filterUrl(menus)
//
@ -338,7 +335,11 @@
},
onLayoutResize() {
const clientWidth = document.body.clientWidth
this.setIsmobile(clientWidth < 992)
if (clientWidth < 992) {
this.$store.commit('SET_ismobile', true)
} else {
this.$store.commit('SET_ismobile', false)
}
},
//
showThis() {
@ -360,7 +361,7 @@
if (!this.onSelectTag) {
const pidKey = this.getParentKeys(this.menu, active)
this.openKeys = pidKey
} else if (this.sideUniqueOpen) {
} else if (this.$store.state.global.sideUniqueOpen) {
const pidKey = this.getParentKeys(this.menu, active)
this.openKeys = pidKey
}
@ -411,7 +412,7 @@
},
// /
onOpenChange(keys) {
if (this.sideUniqueOpen) {
if (this.$store.state.global.sideUniqueOpen) {
//
const openKey = keys[keys.length - 1]
if (keys.length > 1) {
@ -463,9 +464,6 @@
})
return newMap
},
menuIsCollapseClick() {
this.globalStore.toggleConfig('menuIsCollapse')
},
// 退
exitMaximize() {
document.getElementById('app').classList.remove('main-maximize')
@ -479,19 +477,19 @@
: header.classList.remove('snowy-header-primary-color')
//
const headerLogin = document.getElementById('snowyHeaderLogo')
try {
try{
this.topHanderThemeColorSpread
? headerLogin.classList.add('snowy-header-logo-primary-color')
: headerLogin.classList.remove('snowy-header-logo-primary-color')
} catch (e) {}
}catch (e) { }
//
if (this.layout === 'doublerow') {
const snowyDoublerowSideTop = document.getElementById('snowyDoublerowSideTop')
try {
try{
this.topHanderThemeColorSpread
? snowyDoublerowSideTop.classList.add('snowy-doublerow-side-top-primary-color')
: snowyDoublerowSideTop.classList.remove('snowy-doublerow-side-top-primary-color')
} catch (e) {}
}catch (e) { }
}
}
}

View File

@ -1,16 +1,15 @@
import { createApp } from 'vue'
import Antd from 'ant-design-vue'
import { createPinia } from 'pinia'
import './style/index.less'
import snowy from './snowy'
import i18n from './locales'
import router from './router'
import store from './store'
import App from './App.vue'
import './tailwind.css'
const app = createApp(App)
app.use(createPinia())
app.use(store)
app.use(router)
app.use(Antd)
app.use(i18n)

View File

@ -19,7 +19,8 @@ import userRoutes from '@/config/route'
import tool from '@/utils/tool'
import { cloneDeep } from 'lodash-es'
const modules = import.meta.glob('/src/views/**/**.vue')
import { globalStore, searchStore } from '@/store'
import store from '@/store'
const sysBaseConfig = tool.data.get('SNOWY_SYS_BASE_CONFIG') || store.state.global.sysBaseConfig
// 进度条配置
NProgress.configure({ showSpinner: false, speed: 500 })
@ -41,7 +42,7 @@ const router = createRouter({
})
// 设置标题
// document.title = sysBaseConfig.SNOWY_SYS_NAME
document.title = sysBaseConfig.SNOWY_SYS_NAME
// 判断是否已加载过动态/静态路由
const isGetRouter = ref(false)
@ -56,9 +57,6 @@ const whiteList = exportWhiteListFromRouter(whiteListRouters)
router.beforeEach(async (to, from, next) => {
NProgress.start()
const store = globalStore()
const sysBaseConfig = tool.data.get('SNOWY_SYS_BASE_CONFIG') || store.sysBaseConfig
// 动态标题
document.title = to.meta.title
? `${to.meta.title} - ${sysBaseConfig.SNOWY_SYS_NAME}`
@ -85,9 +83,6 @@ router.beforeEach(async (to, from, next) => {
isGetRouter.value = false
next()
return false
} else {
// 这里需要使用 localStorage 保存登录之前要访问的页面
tool.data.set('LAST_VIEWS_PATH', to.fullPath)
}
if (!token) {
next({
@ -114,9 +109,7 @@ router.beforeEach(async (to, from, next) => {
menuRouter.forEach((item) => {
router.addRoute('layout', item)
})
const search_store = searchStore()
search_store.init(menuRouter)
store.commit('search/init', menuRouter)
isGetRouter.value = true
next({ ...to, replace: true })
return false

View File

@ -9,15 +9,14 @@
* 6.若您的项目无法满足以上几点需要更多功能代码获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
import { nextTick } from 'vue'
import { viewTagsStore } from '@/store'
import store from '@/store'
export function beforeEach(to, from) {
const adminMain = document.querySelector('#adminui-main')
if (!adminMain) {
return false
}
const store = viewTagsStore()
store.updateViewTags({
store.commit('updateViewTags', {
fullPath: from.fullPath,
scrollTop: adminMain.scrollTop
})
@ -29,8 +28,7 @@ export function afterEach(to) {
return false
}
nextTick(() => {
const store = viewTagsStore()
const beforeRoute = store.viewTags.filter((v) => v.fullPath == to.fullPath)[0]
const beforeRoute = store.state.viewTags.viewTags.filter((v) => v.fullPath == to.fullPath)[0]
if (beforeRoute) {
adminMain.scrollTop = beforeRoute.scrollTop || 0
}

View File

@ -1,5 +1,27 @@
export * from './global'
export * from './search'
export * from './iframe'
export * from './keepAlive'
export * from './viewTags'
/**
* Copyright [2022] [https://www.xiaonuo.vip]
* Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
* 1.请不要删除和修改根目录下的LICENSE文件
* 2.请不要删除和修改Snowy源码头部的版权声明
* 3.本项目代码可免费商业使用商业使用请保留源码和相关描述文件的项目出处作者声明等
* 4.分发源码时候请注明软件出处 https://www.xiaonuo.vip
* 5.不可二次分发开源参与同类竞品如有想法可联系团队xiaonuobase@qq.com商议合作
* 6.若您的项目无法满足以上几点需要更多功能代码获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
import { createStore } from 'vuex'
import global from './modules/global'
import iframe from './modules/iframe'
import keepAlive from './modules/keepAlive'
import viewTags from './modules/viewTags'
import search from './modules/search'
// 自动import导入所有 vuex 模块
export default createStore({
modules: {
global,
iframe,
keepAlive,
viewTags,
search
}
})

View File

@ -8,8 +8,7 @@
* 5.不可二次分发开源参与同类竞品如有想法可联系团队xiaonuobase@qq.com商议合作
* 6.若您的项目无法满足以上几点需要更多功能代码获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
import { defineStore } from 'pinia'
import { changeColor } from '@/utils/themeUtil'
import { changeColor, getLocalSetting } from '@/utils/themeUtil'
import config from '@/config'
import { message } from 'ant-design-vue'
import tool from '@/utils/tool'
@ -26,13 +25,8 @@ const getCacheConfig = (value) => {
}
return data
}
/**
* deprecated 请使用 useGlobalStore
*/
export const globalStore = defineStore({
id: 'global',
state: () => ({
export default {
state: {
// 移动端布局
ismobile: false,
// 布局
@ -48,7 +42,8 @@ export const globalStore = defineStore({
// 顶栏是否应用主题色
topHanderThemeColorOpen: getCacheConfig('SNOWY_TOP_HANDER_THEME_COLOR_OPEN'),
// 顶栏主题色通栏
topHanderThemeColorSpread: getCacheConfig('SNOWY_TOP_HANDER_THEME_COLOR_SPREAD'),
topHanderThemeColorSpread:
getCacheConfig('SNOWY_TOP_HANDER_THEME_COLOR_SPREAD'),
// 模块坞
moduleUnfoldOpen: getCacheConfig('SNOWY_MODULE_UNFOLD_OPEN'),
// 主题
@ -61,42 +56,57 @@ export const globalStore = defineStore({
userInfo: toolDataGet('USER_INFO') || {},
// 系统配置
sysBaseConfig: toolDataGet('SNOWY_SYS_BASE_CONFIG') || config.SYS_BASE_CONFIG
}),
getters: {},
actions: {
setIsmobile(key) {
this.ismobile = key
},
mutations: {
SET_ismobile(state, key) {
state.ismobile = key
},
setLayout(key) {
this.layout = key
SET_layout(state, key) {
state.layout = key
},
setTheme(key) {
this.theme = key
SET_theme(state, key) {
state.theme = key
const closeMessage = message.loading(`加载中...`)
changeColor(this.themeColor, key).then(closeMessage)
changeColor(state.themeColor, key).then(closeMessage)
},
setThemeColor(key) {
this.themeColor = key
SET_themeColor(state, key) {
state.themeColor = key
const closeMessage = message.loading(`加载中...`)
changeColor(key, this.theme).then(closeMessage)
changeColor(key, state.theme).then(closeMessage)
},
initTheme() {
initTheme(state) {
const closeMessage = message.loading(`加载中...`)
changeColor(this.themeColor, this.theme).then(closeMessage)
changeColor(state.themeColor, state.theme).then(closeMessage)
},
toggleConfig(key) {
this[key] = !this[key]
TOGGLE_menuIsCollapse(state) {
state.menuIsCollapse = !state.menuIsCollapse
},
setFormStyle(key) {
this.formStyle = key
TOGGLE_sideUniqueOpen(state) {
state.sideUniqueOpen = !state.sideUniqueOpen
},
setUserInfo(key) {
this.userInfo = key
TOGGLE_layoutTagsOpen(state) {
state.layoutTagsOpen = !state.layoutTagsOpen
},
setSysBaseConfig(key) {
this.sysBaseConfig = key
TOGGLE_breadcrumbOpen(state) {
state.breadcrumbOpen = !state.breadcrumbOpen
},
TOGGLE_topHanderThemeColorOpen(state) {
state.topHanderThemeColorOpen = !state.topHanderThemeColorOpen
},
TOGGLE_topHanderThemeColorSpread(state) {
state.topHanderThemeColorSpread = !state.topHanderThemeColorSpread
},
TOGGLE_moduleUnfoldOpen(state) {
state.moduleUnfoldOpen = !state.moduleUnfoldOpen
},
SET_formStyle(state, key) {
state.formStyle = key
},
SET_userInfo(state, key) {
state.userInfo = key
},
SET_sysBaseConfig(state, key) {
state.sysBaseConfig = key
}
}
})
export const useGlobalStore = globalStore
}

View File

@ -8,34 +8,31 @@
* 5.不可二次分发开源参与同类竞品如有想法可联系团队xiaonuobase@qq.com商议合作
* 6.若您的项目无法满足以上几点需要更多功能代码获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
import { defineStore } from 'pinia'
export const iframeStore = defineStore({
id: 'iframe',
state: () => ({
/* eslint-disable eqeqeq */
export default {
state: {
iframeList: []
}),
getters: {},
actions: {
setIframeList(route) {
this.iframeList = []
this.iframeList.push(route)
},
mutations: {
setIframeList(state, route) {
state.iframeList = []
state.iframeList.push(route)
},
pushIframeList(route) {
const target = this.iframeList.find((item) => item.path === route.path)
pushIframeList(state, route) {
const target = state.iframeList.find((item) => item.path === route.path)
if (!target) {
this.iframeList.push(route)
state.iframeList.push(route)
}
},
removeIframeList(route) {
this.iframeList.forEach((item, index) => {
removeIframeList(state, route) {
state.iframeList.forEach((item, index) => {
if (item.path === route.path) {
this.iframeList.splice(index, 1)
state.iframeList.splice(index, 1)
}
})
},
refreshIframe(route) {
this.iframeList.forEach((item) => {
refreshIframe(state, route) {
state.iframeList.forEach((item) => {
if (item.path === route.path) {
const url = route.meta.url
item.meta.url = ''
@ -45,8 +42,8 @@ export const iframeStore = defineStore({
}
})
},
clearIframeList() {
this.iframeList = []
clearIframeList(state) {
state.iframeList = []
}
}
})
}

View File

@ -8,39 +8,37 @@
* 5.不可二次分发开源参与同类竞品如有想法可联系团队xiaonuobase@qq.com商议合作
* 6.若您的项目无法满足以上几点需要更多功能代码获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
import { defineStore } from 'pinia'
export const keepAliveStore = defineStore({
id: 'keepAlive',
state: () => ({
export default {
state: {
keepLiveRoute: [],
routeKey: null,
routeShow: true
}),
getters: {},
actions: {
pushKeepLive(component) {
if (!this.keepLiveRoute.includes(component)) {
this.keepLiveRoute.push(component)
},
mutations: {
pushKeepLive(state, component) {
if (!state.keepLiveRoute.includes(component)) {
state.keepLiveRoute.push(component)
}
},
removeKeepLive(component) {
const index = this.keepLiveRoute.indexOf(component)
removeKeepLive(state, component) {
const index = state.keepLiveRoute.indexOf(component)
if (index !== -1) {
this.keepLiveRoute.splice(index, 1)
state.keepLiveRoute.splice(index, 1)
}
},
clearKeepLive() {
this.keepLiveRoute = []
clearKeepLive(state) {
state.keepLiveRoute = []
},
setRouteKey(key) {
this.routeKey = key
setRouteKey(state, key) {
state.routeKey = key
},
setRouteShow(key) {
this.routeShow = key
},
setRouteKeyAction(key) {
this.setRouteKey(key)
setRouteShow(state, key) {
state.routeShow = key
}
},
actions: {
setRouteKey({ commit }, key) {
commit('setRouteKey', key)
}
}
})
}

View File

@ -1,25 +1,29 @@
import '@/utils/objects'
import { defineStore } from 'pinia'
export const searchStore = defineStore({
id: 'search',
state: () => ({
export default {
namespaced: true,
state: {
// 搜索面板激活状态
active: false,
// 快捷键
hotkey: {
open: 's',
close: 'esc'
},
// 所有可以搜索的页面
pool: []
}),
getters: {},
actions: {
toggleActive() {
this.active = !this.active
},
mutations: {
// 切换激活状态
toggle(state) {
state.active = !state.active
},
setActive(active) {
this.active = active
// 设置激活模式
set(state, active) {
state.active = active
},
init(menu) {
// 初始化
init(state, menu) {
const pool = []
const getFullName = function (meta) {
if (meta.breadcrumb) {
@ -36,7 +40,7 @@ export const searchStore = defineStore({
if ('menu' === m.meta.type) {
if (m.children) {
push(m.children)
} else if (m.children === null) {
} else if (m.children === null){
pool.push({
icon: m.meta.icon,
path: m.path,
@ -51,7 +55,7 @@ export const searchStore = defineStore({
})
}
push(menu)
this.pool = pool
state.pool = pool
}
}
})
}

View File

@ -8,46 +8,43 @@
* 5.不可二次分发开源参与同类竞品如有想法可联系团队xiaonuobase@qq.com商议合作
* 6.若您的项目无法满足以上几点需要更多功能代码获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
import { defineStore } from 'pinia'
export const viewTagsStore = defineStore({
id: 'viewTags',
state: () => ({
/* eslint-disable eqeqeq */
export default {
state: {
viewTags: []
}),
getters: {},
actions: {
pushViewTags(route) {
const target = this.viewTags.find((item) => item.fullPath === route.fullPath)
},
mutations: {
pushViewTags(state, route) {
const target = state.viewTags.find((item) => item.fullPath === route.fullPath)
const isName = route.name
if (!target && isName) {
this.viewTags.push(route)
state.viewTags.push(route)
}
},
removeViewTags(route) {
this.viewTags.forEach((item, index) => {
removeViewTags(state, route) {
state.viewTags.forEach((item, index) => {
if (item.fullPath === route.fullPath) {
this.viewTags.splice(index, 1)
state.viewTags.splice(index, 1)
}
})
},
updateViewTags(route) {
this.viewTags.forEach((item) => {
updateViewTags(state, route) {
state.viewTags.forEach((item) => {
if (item.fullPath == route.fullPath) {
Object.assign(item, route)
item = Object.assign(item, route)
}
})
},
updateViewTagsTitle(title = '') {
updateViewTagsTitle(state, title = '') {
const nowFullPath = location.hash.substring(1)
this.viewTags.forEach((item) => {
state.viewTags.forEach((item) => {
if (item.fullPath == nowFullPath) {
item.meta.title = title
}
})
},
clearViewTags() {
this.viewTags = []
clearViewTags(state) {
state.viewTags = []
}
}
})
}

View File

@ -150,11 +150,6 @@ a, button, input, textarea {
border-bottom: 1px solid var(--border-color-split);
box-shadow: 0 1px 4px rgba(0, 21, 41, .08);
background-color: var(--body-background);
.ant-menu-item{
height: 48px;
line-height: 48px;
}
}
// 应用主题色
.snowy-header-primary-color {
@ -169,10 +164,6 @@ a, button, input, textarea {
.ant-breadcrumb-separator {
color: white;
}
.ant-menu-light .ant-menu-item:hover{
color: #ccc;
background-color: var(--primary-7);
}
}
.ant-layout-sider-dark {
@ -236,17 +227,6 @@ a, button, input, textarea {
align-items: center;
}
.panel-item {
padding: 0 10px;
cursor: pointer;
height: 100%;
display: flex;
align-items: center;
}
.panel-item:hover {
background: var(--header-color-split);
}
/* 多标签 */
.snowy-tags {
height: 40px;
@ -408,24 +388,6 @@ a, button, input, textarea {
padding: 12px 0!important;
}
/* 重写antdv的表格滚动条 */
.ant-table-body {
&::-webkit-scrollbar {
height: 10px;
width: 10px;
}
&::-webkit-scrollbar-thumb {
border-radius: 10px;
-webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1);
background: @border-color-split;
}
&::-webkit-scrollbar-track {
-webkit-box-shadow: 0;
border-radius: 10px;
background: @background-color-base;
}
}
// 滚动条需要哪里加哪个class
body,
.ant-drawer-wrapper-body,
@ -445,6 +407,7 @@ body,
.org-table,
.pos-table,
.poi-list,
.ant-table-body,
.snowy-orgpos-vis,
.index-message-list,
.ant-picker-time-panel-column,

View File

@ -42,10 +42,5 @@ export const rules = {
pattern: /^\d{1,}$/,
message: '填写内容必须是纯数字',
trigger: 'blur'
},
price: {
pattern: /(?:^[1-9]([0-9]+)?(?:\.[0-9]{1,2})?$)|(?:^(?:0)$)|(?:^[0-9]\.[0-9](?:[0-9])?$)/,
message: '只支持正数金额',
trigger: 'blur'
}
}

View File

@ -10,7 +10,6 @@
*/
// 统一的请求发送
import axios from 'axios'
import qs from 'qs'
import { Modal, message, notification } from 'ant-design-vue'
import sysConfig from '@/config/index'
import tool from '@/utils/tool'
@ -109,25 +108,8 @@ service.interceptors.response.use(
} else {
// 统一成功提示
const responseUrl = response.config.url
const apiNameArray = [
'add',
'edit',
'delete',
'update',
'grant',
'reset',
'start',
'stop',
'pass',
'disable',
'enable',
'revoke',
'suspend',
'active',
'turn',
'adjust',
'reject'
]
const apiNameArray = ['add', 'edit', 'delete', 'update', 'grant', 'reset', 'start', 'stop',
'pass', 'disable', 'enable', 'revoke', 'suspend', 'active', 'turn', 'adjust', 'reject']
apiNameArray.forEach((apiName) => {
if (responseUrl.includes(apiName)) {
message.success(data.msg)
@ -149,37 +131,37 @@ service.interceptors.response.use(
}
)
// 适配器, 用于适配不同的请求方式
export const baseRequest = (url, value = {}, method = 'post', options = {}) => {
url = sysConfig.API_URL + url
if (method === 'post') {
return service.post(url, value, options)
} else if (method === 'get') {
return service.get(url, { params: value, ...options })
} else if (method === 'formdata') {
// form-data表单提交的方式
return service.post(url, qs.stringify(value), {
headers: {
'Content-Type': 'multipart/form-data'
},
return service.get(url, {
params: value,
...options
})
} else {
// 其他请求方式例如put、delete
} else if (method === 'formdata') {
return service({
method: method,
url: url,
method: 'post',
url,
data: value,
...options
// 转换数据的方法
transformRequest: [
function (data) {
let ret = ''
for (const it in data) {
ret += `${encodeURIComponent(it)}=${encodeURIComponent(data[it])}&`
}
ret = ret.substring(0, ret.length - 1)
return ret
}
],
// 设置请求头
headers: {
'Content-Type': 'multipart/form-data'
}
})
}
}
// 模块内的请求, 会自动加上模块的前缀
export const moduleRequest =
(moduleUrl) =>
(url, ...arg) => {
return baseRequest(moduleUrl + url, ...arg)
}
export default service

View File

@ -17,9 +17,13 @@
import smCrypto from 'sm-crypto'
const sm2 = smCrypto.sm2
const sm3 = smCrypto.sm3
const sm4 = smCrypto.sm4
const cipherMode = 1 // 1 - C1C3C20 - C1C2C3默认为1
const publicKey =
'04298364ec840088475eae92a591e01284d1abefcda348b47eb324bb521bb03b0b2a5bc393f6b71dabb8f15c99a0050818b56b23f31743b93df9cf8948f15ddb54'
const privateKey = '3037723d47292171677ec8bd7dc9af696c7472bc5f251b2cec07e65fdef22e25'
const key = '0123456789abcdeffedcba9876543210'
/**
* 国密加解密工具类
@ -29,8 +33,36 @@ export default {
doSm2Encrypt(msgString) {
return sm2.doEncrypt(msgString, publicKey, cipherMode)
},
// SM2解密
doSm2Decrypt(encryptData) {
return sm2.doDecrypt(encryptData, privateKey, cipherMode)
},
// SM2数组加密
doSm2ArrayEncrypt(msgString) {
return sm2.doEncrypt(msgString, publicKey, cipherMode)
},
// SM2数组解密
doSm2ArrayDecrypt(encryptData) {
return sm2.doDecrypt(encryptData, privateKey, cipherMode, { output: 'array' })
},
// SM3哈希
doSm3Hash(msgString) {
return sm3(msgString)
},
// SM4 加密
doSm4Encrypt(msgString) {
return sm4.encrypt(msgString, key)
},
// SM4 CBC加密
doSm4CbcEncrypt(msgString) {
return sm4.encrypt(msgString, key, { mode: 'cbc', iv: 'fedcba98765432100123456789abcdef' })
},
// SM4 解密
doSm4Decrypt(encryptData) {
return sm4.decrypt(encryptData, key)
},
// SM4 CBC解密
doSm4CbcDecrypt(encryptData) {
return sm4.decrypt(encryptData, key, { mode: 'cbc', iv: 'fedcba98765432100123456789abcdef' })
}
}

View File

@ -12,29 +12,28 @@ import { nextTick } from 'vue'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import router from '@/router'
import { iframeStore, keepAliveStore, viewTagsStore } from '@/store'
import store from '@/store'
export default {
// 刷新标签
refresh() {
NProgress.start()
const keepAlive = keepAliveStore()
const route = router.currentRoute.value
keepAlive.removeKeepLive(route.name)
keepAlive.setRouteShow(false)
store.commit('removeKeepLive', route.name)
store.commit('setRouteShow', false)
nextTick(() => {
keepAlive.pushKeepLive(route.name)
keepAlive.setRouteShow(true)
store.commit('pushKeepLive', route.name)
store.commit('setRouteShow', true)
NProgress.done()
})
},
// 关闭标签
close(tag) {
const route = tag || router.currentRoute.value
const store = viewTagsStore()
store.removeViewTags(route)
iframeStore().removeIframeList(route)
keepAliveStore().removeKeepLive(route.name)
const tagList = store.viewTags
store.commit('removeViewTags', route)
store.commit('removeIframeList', route)
store.commit('removeKeepLive', route.name)
const tagList = store.state.viewTags.viewTags
const latestView = tagList.slice(-1)[0]
if (latestView) {
router.push(latestView)
@ -45,23 +44,21 @@ export default {
// 关闭标签后处理
closeNext(next) {
const route = router.currentRoute.value
const store = viewTagsStore()
store.removeViewTags(route)
iframeStore().removeIframeList(route)
keepAliveStore().removeKeepLive(route.name)
store.commit('removeViewTags', route)
store.commit('removeIframeList', route)
store.commit('removeKeepLive', route.name)
if (next) {
const tagList = store.viewTags
const tagList = store.state.viewTags.viewTags
next(tagList)
}
},
// 关闭其他
closeOther() {
const route = router.currentRoute.value
const store = viewTagsStore()
const tagList = [...store.viewTags]
const tagList = [...store.state.viewTags.viewTags]
tagList.forEach((tag) => {
// eslint-disable-next-line prettier/prettier
if ((tag.meta && tag.meta.affix) || route.fullPath == tag.fullPath) {
if (tag.meta && tag.meta.affix || route.fullPath == tag.fullPath) {
return true
} else {
this.close(tag)
@ -70,6 +67,6 @@ export default {
},
// 设置标题
setTitle(title) {
viewTagsStore().updateViewTagsTitle(title)
store.commit('updateViewTagsTitle', title)
}
}

View File

@ -108,8 +108,7 @@
import config from '@/config'
import configApi from '@/api/dev/configApi'
import tool from '@/utils/tool'
import { globalStore, iframeStore, keepAliveStore, viewTagsStore } from '@/store'
import { mapActions, mapState } from 'pinia'
import store from '@/store'
export default {
name: 'Login',
@ -120,6 +119,7 @@
data() {
return {
activeKey: 'userAccount',
sysBaseConfig: store.state.global.sysBaseConfig || tool.data.get('SNOWY_SYS_BASE_CONFIG'),
captchaOpen: config.SYS_BASE_CONFIG.SNOWY_SYS_DEFAULT_CAPTCHA_OPEN,
validCodeBase64: '',
ruleForm: {
@ -150,9 +150,6 @@
]
}
},
computed: {
...mapState(globalStore, ['sysBaseConfig']),
},
watch: {
'config.theme': function (val) {
document.body.setAttribute('data-theme', val)
@ -163,9 +160,9 @@
}
},
created() {
this.clearViewTags()
this.clearKeepLive()
this.clearIframeList()
store.commit('clearViewTags')
store.commit('clearKeepLive')
store.commit('clearIframeList')
},
mounted() {
let formData = ref(config.SYS_BASE_CONFIG)
@ -176,16 +173,12 @@
})
this.captchaOpen = formData.value.SNOWY_SYS_DEFAULT_CAPTCHA_OPEN
tool.data.set('SNOWY_SYS_BASE_CONFIG', formData.value)
this.setSysBaseConfig(formData.value)
store.commit('SET_sysBaseConfig', formData.value)
this.refreshSwitch()
}
})
},
methods: {
...mapActions(keepAliveStore, ['clearKeepLive']),
...mapActions(viewTagsStore, ['clearViewTags']),
...mapActions(iframeStore, ['clearIframeList']),
...mapActions(globalStore, ['setSysBaseConfig']),
//
refreshSwitch() {
//

View File

@ -4,28 +4,21 @@ import dictApi from '@/api/dev/dictApi'
import router from '@/router'
import tool from '@/utils/tool'
import { message } from 'ant-design-vue'
import { useGlobalStore } from '@/store'
export const afterLogin = async (loginToken) => {
tool.data.set('TOKEN', loginToken)
// 获取登录的用户信息
const loginUser = await loginApi.getLoginUser()
const globalStore = useGlobalStore()
globalStore.setUserInfo(loginUser)
tool.data.set('USER_INFO', loginUser)
// 获取用户的菜单
const menu = await userCenterApi.userLoginMenu()
let indexMenu = menu[0].children[0].path
const indexMenu = menu[0].children[0].path
tool.data.set('MENU', menu)
// 重置系统默认应用
tool.data.set('SNOWY_MENU_MODULE_ID', menu[0].id)
message.success('登录成功')
if (!!tool.data.get('LAST_VIEWS_PATH')) {
// 如果有缓存,将其登录跳转到最后访问的路由
indexMenu = tool.data.get('LAST_VIEWS_PATH')
}
await router.replace({
router.replace({
path: indexMenu
})
dictApi.dictTree().then((data) => {

View File

@ -12,46 +12,42 @@
<a-empty v-else :image="Empty.PRESENTED_IMAGE_SIMPLE" />
</a-col>
<a-col :span="19">
<a-form ref="searchFormRef" name="advanced_search" class="ant-advanced-search-form mb-3" :model="searchFormState">
<a-row :gutter="24">
<a-col :span="8">
<a-form-item name="searchKey" label="字典名称">
<a-input v-model:value="searchFormState.searchKey" placeholder="请输入字典名称" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-button type="primary" @click="$refs.table.refresh(true)">
<template #icon><SearchOutlined /></template>
查询
</a-button>
<a-button class="snowy-buttom-left" @click="reset">
<template #icon><redo-outlined /></template>
重置
</a-button>
</a-col>
</a-row>
</a-form>
<a-divider class="m-3 mx-0" />
<s-table
ref="table"
:columns="columns"
:data="loadData"
:expand-row-by-click="true"
bordered
:tool-config="toolConfig"
:row-key="(record) => record.id"
>
<template #operator class="table-operator">
<a-button type="primary" @click="form.onOpen(undefined, 'BIZ', searchFormState.parentId)">
<template #icon><plus-outlined /></template>
新增
</a-button>
<a-form ref="searchFormRef" name="advanced_search" class="ant-advanced-search-form" :model="searchFormState">
<a-row :gutter="24">
<a-col :span="8">
<a-form-item name="searchKey" label="字典名称">
<a-input v-model:value="searchFormState.searchKey" placeholder="请输入字典名称"></a-input>
</a-form-item>
</a-col>
<a-col :span="8">
<a-button type="primary" @click="$refs.table.refresh(true)">
<template #icon><SearchOutlined /></template>
查询
</a-button>
<a-button class="snowy-buttom-left" @click="reset">
<template #icon><redo-outlined /></template>
重置
</a-button>
</a-col>
<a-col :span="8">
<a-button type="primary" @click="form.onOpen(undefined, 'BIZ', searchFormState.parentId)">
<template #icon><plus-outlined /></template>
新增
</a-button>
</a-col>
</a-row>
</a-form>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'level'">
<a-tag color="blue" v-if="record.level">{{ record.level }}</a-tag>
<a-tag color="green" v-else>子级</a-tag>
</template>
<template v-if="column.dataIndex === 'action'">
<a @click="form.onOpen(record, 'BIZ')">编辑</a>
<a-divider type="vertical" />
@ -74,13 +70,11 @@
const columns = [
{
title: '字典名称',
dataIndex: 'dictLabel',
width: 350
dataIndex: 'dictLabel'
},
{
title: '字典值',
dataIndex: 'dictValue',
width: 350
dataIndex: 'dictValue'
},
{
title: '排序',
@ -103,33 +97,13 @@
const treeData = ref([])
// treeNode title,key,children
const treeFieldNames = { children: 'children', title: 'dictLabel', key: 'id' }
const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
// Promise
const loadData = (parameter) => {
loadTreeData()
parameter.category = 'BIZ'
return dictApi.dictPage(Object.assign(parameter, searchFormState)).then((data) => {
if (data.records) {
if (searchFormState.parentId) {
let dataArray = []
data.records.forEach((item) => {
const obj = data.records.find((f) => f.id === item.parentId)
if (!obj) {
dataArray.push(item)
}
})
if (dataArray.length === 1) {
data.records.forEach((item) => {
if (item.id === dataArray[0].id) {
item.level = '上级'
}
})
}
dataArray = []
}
}
return data
return dictApi.dictPage(Object.assign(parameter, searchFormState)).then((res) => {
return res
})
}
//
@ -152,16 +126,8 @@
const treeSelect = (selectedKeys) => {
if (selectedKeys && selectedKeys.length > 0) {
searchFormState.parentId = selectedKeys.toString()
if (!columns.find((f) => f.title === '层级')) {
columns.splice(2, 0, {
title: '层级',
dataIndex: 'level',
width: 100
})
}
} else {
delete searchFormState.parentId
columns.splice(2, 1)
}
table.value.refresh(true)
}

View File

@ -12,45 +12,44 @@
<a-empty v-else :image="Empty.PRESENTED_IMAGE_SIMPLE" />
</a-col>
<a-col :span="19">
<a-form ref="searchFormRef" name="advanced_search" class="ant-advanced-search-form" :model="searchFormState">
<a-row :gutter="24">
<a-col :span="8">
<a-form-item name="searchKey" label="字典名称">
<a-input v-model:value="searchFormState.searchKey" placeholder="请输入字典名称" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-button type="primary" @click="$refs.table.refresh(true)">
<template #icon><SearchOutlined /></template>
查询
</a-button>
<a-button class="snowy-buttom-left" @click="reset">
<template #icon><redo-outlined /></template>
重置
</a-button>
</a-col>
</a-row>
</a-form>
<a-divider class="m-3 mx-0" />
<s-table
ref="table"
:columns="columns"
:data="loadData"
:expand-row-by-click="true"
bordered
:tool-config="toolConfig"
:row-key="(record) => record.id"
>
<template #operator class="table-operator">
<a-button type="primary" @click="form.onOpen(undefined, 'FRM', searchFormState.parentId)">
<template #icon><plus-outlined /></template>
新增
</a-button>
<a-form ref="searchFormRef" name="advanced_search" class="ant-advanced-search-form" :model="searchFormState">
<a-row :gutter="24">
<a-col :span="8">
<a-form-item name="searchKey" label="字典名称">
<a-input v-model:value="searchFormState.searchKey" placeholder="请输入字典名称"></a-input>
</a-form-item>
</a-col>
<a-col :span="8">
<a-button type="primary" @click="$refs.table.refresh(true)">
<template #icon><SearchOutlined /></template>
查询
</a-button>
<a-button class="snowy-buttom-left" @click="reset">
<template #icon><redo-outlined /></template>
重置
</a-button>
</a-col>
<a-col :span="8">
<a-button type="primary" @click="form.onOpen(undefined, 'FRM', searchFormState.parentId)">
<template #icon><plus-outlined /></template>
新增
</a-button>
</a-col>
</a-row>
</a-form>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'level'">
<a-tag color="blue" v-if="record.level">{{ record.level }}</a-tag>
<a-tag color="green" v-else>子级</a-tag>
<template v-if="column.dataIndex === 'category'">
{{ $TOOL.dictTypeData('DICT_CATEGORY', record.category) }}
</template>
<template v-if="column.dataIndex === 'action'">
<a @click="form.onOpen(record, 'FRM')">编辑</a>
@ -67,17 +66,14 @@
import dictApi from '@/api/dev/dictApi'
import Form from './form.vue'
const { proxy } = getCurrentInstance()
let searchFormState = reactive({})
const columns = [
{
title: '字典名称',
dataIndex: 'dictLabel',
width: 350
dataIndex: 'dictLabel'
},
{
title: '字典值',
dataIndex: 'dictValue',
width: 350
dataIndex: 'dictValue'
},
{
title: '排序',
@ -94,38 +90,19 @@
const table = ref(null)
const form = ref()
const searchFormRef = ref()
let searchFormState = reactive({})
//
let defaultExpandedKeys = ref([])
const treeData = ref([])
// treeNode title,key,children
const treeFieldNames = { children: 'children', title: 'dictLabel', key: 'id' }
const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
// Promise
const loadData = (parameter) => {
loadTreeData()
parameter.category = 'FRM'
return dictApi.dictPage(Object.assign(parameter, searchFormState)).then((data) => {
if (data.records) {
if (searchFormState.parentId) {
let dataArray = []
data.records.forEach((item) => {
const obj = data.records.find((f) => f.id === item.parentId)
if (!obj) {
dataArray.push(item)
}
})
if (dataArray.length === 1) {
data.records.forEach((item) => {
if (item.id === dataArray[0].id) {
item.level = '上级'
}
})
}
dataArray = []
}
}
return data
return dictApi.dictPage(Object.assign(parameter, searchFormState)).then((res) => {
return res
})
}
//
@ -148,16 +125,8 @@
const treeSelect = (selectedKeys) => {
if (selectedKeys && selectedKeys.length > 0) {
searchFormState.parentId = selectedKeys.toString()
if (!columns.find((f) => f.title === '层级')) {
columns.splice(2, 0, {
title: '层级',
dataIndex: 'level',
width: 100
})
}
} else {
delete searchFormState.parentId
columns.splice(2, 1)
}
table.value.refresh(true)
}

View File

@ -25,7 +25,7 @@
//
const displayMore = () => {
return userInfo.roleCodeList && userInfo.roleCodeList.toString().indexOf('superAdmin') !== -1
return userInfo.roleCodeList && userInfo.roleCodeList.indexOf('super') !== -1
}
const seleOpLogList = () => {
indexApi.indexOpLogList().then((data) => {

View File

@ -25,7 +25,7 @@
})
//
const displayMore = () => {
return userInfo.roleCodeList && userInfo.roleCodeList.toString().indexOf('superAdmin') !== -1
return userInfo.roleCodeList && userInfo.roleCodeList.indexOf('super') !== -1
}
//
const seleVisLogList = () => {

View File

@ -7,7 +7,6 @@
:show-pagination="false"
@close="onClose"
>
<a-alert message="非超管角色不可被授权系统模块菜单资源" banner class="mb-2" />
<a-spin :spinning="spinningLoading">
<a-radio-group v-model:value="moduleId" button-style="solid" style="padding-bottom: 10px">
<a-radio-button

View File

@ -7,7 +7,6 @@
:show-pagination="false"
@close="onClose"
>
<a-alert message="非超管角色用户不可被授权系统模块菜单资源" banner class="mb-2" />
<a-spin :spinning="spinningLoading">
<a-radio-group v-model:value="moduleId" button-style="solid" style="padding-bottom: 10px">
<a-radio-button

View File

@ -1,5 +1,11 @@
<template>
<xn-form-container title="导入导出" :width="700" :visible="visible" :destroy-on-close="true" @close="onClose">
<xn-form-container
title="导入导出"
:width="700"
:visible="visible"
:destroy-on-close="true"
@close="onClose"
>
<span
>导入数据格式严格按照系统模板进行数据录入请点击
<a-button type="primary" size="small" @click="downloadImportUserTemplate">下载模板</a-button>

View File

@ -66,7 +66,7 @@
import { onMounted } from 'vue'
import { useRoute } from 'vue-router'
import tool from '@/utils/tool'
import { globalStore } from '@/store'
import store from '@/store'
import userCenterApi from '@/api/sys/userCenterApi'
import accountBasic from './userTab/accountBasic.vue'
import CropUpload from '@/components/CropUpload/index.vue'
@ -75,8 +75,6 @@
import accountBind from './userTab/accountBind.vue'
import userMessage from './userTab/userMessage.vue'
const global_store = globalStore()
const userInfo = ref(tool.data.get('USER_INFO'))
const cropUpload = ref()
const avatarLoading = ref(false)
@ -128,7 +126,7 @@
userInfo.value.avatar = data
//
tool.data.set('USER_INFO', userInfo.value)
global_store.setUserInfo(userInfo.value)
store.commit('SET_userInfo', userInfo.value)
})
}
//
@ -140,7 +138,7 @@
userInfo.value.signature = value
//
tool.data.set('USER_INFO', userInfo.value)
global_store.setUserInfo(userInfo.value)
store.commit('SET_userInfo', userInfo.value)
})
}
</script>

View File

@ -39,10 +39,7 @@
import { required } from '@/utils/formRules'
import userCenterApi from '@/api/sys/userCenterApi'
import tool from '@/utils/tool'
import { globalStore } from '@/store'
const store = globalStore()
import store from '@/store'
const formRef = ref()
//
const userInfo = tool.data.get('USER_INFO')
@ -64,7 +61,7 @@
userCenterApi.userUpdateUserInfo(formData.value).then(() => {
submitLoading.value = false
//
store.setUserInfo(formData.value)
store.commit('SET_userInfo', formData.value)
tool.data.set('USER_INFO', formData.value)
})
})

View File

@ -1,5 +1,11 @@
<template>
<xn-form-container title="修改密码" :width="550" :visible="visible" :destroy-on-close="true" @close="onClose">
<xn-form-container
title="修改密码"
:width="550"
:visible="visible"
:destroy-on-close="true"
@close="onClose"
>
<a-form ref="formRef" :model="formState" :rules="rules" layout="vertical">
<a-form-item label="旧密码:" name="password" has-feedback>
<a-input

View File

@ -1,5 +1,11 @@
<template>
<xn-form-container title="详情" :width="700" :visible="visible" :destroy-on-close="true" @close="onClose">
<xn-form-container
title="详情"
:width="700"
:visible="visible"
:destroy-on-close="true"
@close="onClose"
>
<a-descriptions :column="1" size="middle" bordered class="mb-2">
<a-descriptions-item label="主题">{{ formData.subject }}</a-descriptions-item>
<a-descriptions-item label="发送时间">{{ formData.createTime }}</a-descriptions-item>

View File

@ -28,16 +28,6 @@ const generateFontSize = () => {
const colors = require('tailwindcss/colors')
const filterWarnColors = (colors) => {
const result = {}
for (const key in colors) {
if (['lightBlue', 'warmGray', 'trueGray', 'coolGray', 'blueGray'].indexOf(key) === -1) {
result[key] = colors[key]
}
}
return result
}
module.exports = {
content: ['./src/**/*.vue', './src/**/*.js'],
darkMode: 'class', // or 'media' or 'class'
@ -49,7 +39,12 @@ module.exports = {
colors: {
transparent: 'transparent',
current: 'currentColor',
...filterWarnColors(colors),
black: colors.black,
white: colors.white,
gray: colors.neutral,
indigo: colors.indigo,
red: colors.rose,
yellow: colors.amber,
...generatePrimaryColors()
},
fontWeight: {

View File

@ -78,7 +78,7 @@ export default defineConfig(({ command, mode }) => {
manualChunks: {
echarts: ['echarts'],
'ant-design-vue': ['ant-design-vue'],
vue: ['vue', 'vue-router', 'pinia', 'vue-i18n']
vue: ['vue', 'vue-router', 'vuex', 'vue-i18n']
}
}
},

View File

@ -16,7 +16,6 @@ import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import vip.xiaonuo.common.util.CommonServletUtil;
import java.util.List;
@ -27,7 +26,6 @@ import java.util.List;
* @author xuyuxiang
* @date 2021/12/18 14:43
*/
@Slf4j
public class CommonPageRequest {
private static final String PAGE_SIZE_PARAM_NAME = "size";
@ -55,7 +53,7 @@ public class CommonPageRequest {
size = PAGE_SIZE_MAX_VALUE;
}
} catch (Exception e) {
log.error(">>> 分页条数转换异常:", e);
e.printStackTrace();
size = 20;
}
}
@ -66,7 +64,7 @@ public class CommonPageRequest {
try {
page = Convert.toInt(pageString);
} catch (Exception e) {
log.error(">>> 分页页数转换异常:", e);
e.printStackTrace();
page = 1;
}
}

View File

@ -15,7 +15,6 @@ package vip.xiaonuo.common.util;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.URLUtil;
import lombok.extern.slf4j.Slf4j;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
@ -27,7 +26,6 @@ import java.io.IOException;
* @author xuyuxiang
* @date 2020/8/5 21:45
*/
@Slf4j
public class CommonDownloadUtil {
/**
@ -57,7 +55,7 @@ public class CommonDownloadUtil {
response.setContentType("application/octet-stream;charset=UTF-8");
IoUtil.write(response.getOutputStream(), true, fileBytes);
} catch (IOException e) {
log.error(">>> 文件下载异常:", e);
e.printStackTrace();
}
}
}

View File

@ -56,16 +56,16 @@ public class CommonIpAddressUtil {
try {
cBuff = Searcher.loadContentFromFile(dbPath);
} catch (Exception e) {
log.error(">>> CommonIpAddressUtil初始化异常", e);
throw new CommonException("CommonIpAddressUtil初始化异常");
e.printStackTrace();
throw new CommonException("CommonIpAddressUtil初始化失败,原因:", e.getMessage());
}
// 2使用上述的 cBuff 创建一个完全基于内存的查询对象
try {
searcher = Searcher.newWithBuffer(cBuff);
} catch (Exception e) {
log.error(">>> CommonIpAddressUtil初始化异常", e);
throw new CommonException("CommonIpAddressUtil初始化异常");
e.printStackTrace();
throw new CommonException("CommonIpAddressUtil初始化失败,原因:", e.getMessage());
}
}
@ -83,7 +83,7 @@ public class CommonIpAddressUtil {
String remoteHost = ServletUtil.getClientIP(request);
return LOCAL_REMOTE_HOST.equals(remoteHost) ? Ipv4Util.LOCAL_IP : remoteHost;
} catch (Exception e) {
log.error(">>> 获取客户端ip异常", e);
e.printStackTrace();
return Ipv4Util.LOCAL_IP;
}
}

View File

@ -67,13 +67,14 @@ public class CommonNetWorkInfoUtil {
result.put("UP", upSpeed + (upSpeed.endsWith("B")?"/S":"B/S"));
result.put("DOWN", downSpeed + (downSpeed.endsWith("B")?"/S":"B/S"));
} catch (Exception e) {
log.info(">>> 网络测速失败:", e);
log.info(">>> 网络测速失败,原因:");
e.printStackTrace();
} finally {
if (input != null) {
try {
input.close();
} catch (IOException e) {
log.info(">>> 网络测速失败:", e);
e.printStackTrace();
}
}
Optional.ofNullable(pro).ifPresent(Process::destroy);
@ -118,7 +119,7 @@ public class CommonNetWorkInfoUtil {
arr[1] = tx;
}
} catch (Exception e) {
log.error(">>> 网络测速异常:", e);
e.printStackTrace();
}
return arr;
}

View File

@ -13,7 +13,6 @@
package vip.xiaonuo.common.util;
import cn.hutool.core.util.ObjectUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import vip.xiaonuo.common.exception.CommonException;
@ -28,7 +27,6 @@ import javax.servlet.http.HttpServletResponse;
* @author xuyuxiang
* @date 2020/3/30 15:09
*/
@Slf4j
public class CommonServletUtil {
/**
@ -68,7 +66,7 @@ public class CommonServletUtil {
try {
servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
} catch (Exception e) {
log.error(">>> 非Web上下文无法获取Request", e);
e.printStackTrace();
throw new CommonException("非Web上下文无法获取Request");
}
if (servletRequestAttributes == null) {
@ -83,7 +81,7 @@ public class CommonServletUtil {
try {
servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
} catch (Exception e) {
log.error(">>> 非Web上下文无法获取Response", e);
e.printStackTrace();
throw new CommonException("非Web上下文无法获取Response");
}
if (servletRequestAttributes == null) {

View File

@ -58,10 +58,11 @@ public class AuthExceptionUtil {
commonResult = CommonResult.error(saTokenException.getMessage());
} else {
// 未知异常才打印
log.error(">>> 服务器未知异常:{},请求地址:{}", e.getMessage(), SaHolder.getRequest().getUrl());
e.printStackTrace();
// 未知异常返回服务器异常此处不可能执行进入因为本方法处理的一定是SaToken的异常此处仅为安全性考虑
commonResult = CommonResult.error("服务器异常");
}
log.error(">>> {},请求地址:{}", commonResult.getMsg(), SaHolder.getRequest().getUrl());
return commonResult;
}
}

View File

@ -21,7 +21,6 @@ import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.PhoneUtil;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import org.springframework.stereotype.Service;
@ -42,7 +41,6 @@ import vip.xiaonuo.auth.modular.login.service.AuthService;
import vip.xiaonuo.common.cache.CommonCacheOperator;
import vip.xiaonuo.common.exception.CommonException;
import vip.xiaonuo.common.util.CommonCryptogramUtil;
import vip.xiaonuo.common.util.CommonEmailUtil;
import vip.xiaonuo.dev.api.DevConfigApi;
import vip.xiaonuo.dev.api.DevSmsApi;
@ -61,7 +59,7 @@ public class AuthServiceImpl implements AuthService {
private static final String SNOWY_SYS_DEFAULT_CAPTCHA_OPEN_KEY = "SNOWY_SYS_DEFAULT_CAPTCHA_OPEN";
private static final String AUTH_VALID_CODE_CACHE_KEY = "auth-validCode:";
private static final String AUTH_CACHE_KEY = "auth-validCode:";
@Resource(name = "loginUserApi")
private SaBaseLoginUserApi loginUserApi;
@ -95,7 +93,7 @@ public class AuthServiceImpl implements AuthService {
// 将请求号返回前端
authPicValidCodeResult.setValidCodeReqNo(validCodeReqNo);
// 将请求号作为key验证码的值作为value放到redis用于校验5分钟有效
commonCacheOperator.put(AUTH_VALID_CODE_CACHE_KEY + validCodeReqNo, validCode, 5 * 60);
commonCacheOperator.put(AUTH_CACHE_KEY + validCodeReqNo, validCode, 5 * 60);
return authPicValidCodeResult;
}
@ -108,7 +106,7 @@ public class AuthServiceImpl implements AuthService {
// 验证码请求号
String validCodeReqNo = authGetPhoneValidCodeParam.getValidCodeReqNo();
// 校验参数
validPhoneValidCodeParam(null, validCode, validCodeReqNo, type);
validPhoneValidCodeParam(phone, validCode, validCodeReqNo, type);
// 生成手机验证码的值随机6为数字
String phoneValidCode = RandomUtil.randomNumbers(6);
// 生成手机验证码的请求号
@ -120,10 +118,10 @@ public class AuthServiceImpl implements AuthService {
// TODO 使用腾讯云执行发送验证码将验证码作为短信内容的参数变量放入
// TODO sdkAppId和签名不传则使用系统默认配置的sdkAppId和签名支持传入多个参数逗号拼接示例"张三,15038****76,进行中"
devSmsApi.sendSmsTencent("sdkAppId", phone, "签名", "模板编码", phoneValidCode);
devSmsApi.sendSmsTencent("1400522364", phone, "小诺开源技术", "1502357", phoneValidCode);
// 将请求号作为key验证码的值作为value放到redis用于校验5分钟有效
commonCacheOperator.put(AUTH_VALID_CODE_CACHE_KEY + phone + StrUtil.UNDERLINE + phoneValidCodeReqNo, phoneValidCode, 5 * 60);
commonCacheOperator.put(AUTH_CACHE_KEY + phoneValidCodeReqNo, phoneValidCode, 5 * 60);
// 返回请求号
return phoneValidCodeReqNo;
}
@ -134,28 +132,21 @@ public class AuthServiceImpl implements AuthService {
* @author xuyuxiang
* @date 2022/8/25 15:26
**/
private void validValidCode(String phoneOrEmail, String validCode, String validCodeReqNo) {
private void validValidCode(String validCode, String validCodeReqNo) {
// 依据请求号取出缓存中的验证码进行校验
Object existValidCode;
if(ObjectUtil.isEmpty(phoneOrEmail)) {
existValidCode = commonCacheOperator.get(AUTH_VALID_CODE_CACHE_KEY + validCodeReqNo);
} else {
existValidCode = commonCacheOperator.get(AUTH_VALID_CODE_CACHE_KEY + phoneOrEmail + StrUtil.UNDERLINE + validCodeReqNo);
}
Object existValidCode = commonCacheOperator.get(AUTH_CACHE_KEY + validCodeReqNo);
// 为空则直接验证码错误
if(ObjectUtil.isEmpty(existValidCode)) {
throw new CommonException(AuthExceptionEnum.VALID_CODE_ERROR.getValue());
}
// 移除该验证码
if(ObjectUtil.isEmpty(phoneOrEmail)) {
commonCacheOperator.remove(AUTH_VALID_CODE_CACHE_KEY + validCodeReqNo);
} else {
commonCacheOperator.remove(AUTH_VALID_CODE_CACHE_KEY + phoneOrEmail + StrUtil.UNDERLINE + validCodeReqNo);
}
// 不一致则直接验证码错误
if (!validCode.equals(Convert.toStr(existValidCode).toLowerCase())) {
throw new CommonException("验证码错误");
if(!validCode.equals(Convert.toStr(existValidCode).toLowerCase())) {
// 移除该验证码
commonCacheOperator.remove(AUTH_CACHE_KEY + validCodeReqNo);
throw new CommonException(AuthExceptionEnum.VALID_CODE_ERROR.getValue());
}
// 移除该验证码
commonCacheOperator.remove(AUTH_CACHE_KEY + validCodeReqNo);
}
/**
@ -164,25 +155,20 @@ public class AuthServiceImpl implements AuthService {
* @author xuyuxiang
* @date 2022/8/25 14:29
**/
private void validPhoneValidCodeParam(String phoneOrEmail, String validCode, String validCodeReqNo, String type) {
private void validPhoneValidCodeParam(String phone, String validCode, String validCodeReqNo, String type) {
// 验证码正确则校验手机号格式
if(ObjectUtil.isEmpty(phoneOrEmail)) {
// 执行校验验证码
validValidCode(null, validCode, validCodeReqNo);
} else {
if(!PhoneUtil.isMobile(phoneOrEmail) && !CommonEmailUtil.isEmail(phoneOrEmail)) {
throw new CommonException(AuthExceptionEnum.PHONE_FORMAT_ERROR.getValue());
}
// 执行校验验证码
validValidCode(phoneOrEmail, validCode, validCodeReqNo);
if(!PhoneUtil.isMobile(phone)) {
throw new CommonException(AuthExceptionEnum.PHONE_FORMAT_ERROR.getValue());
}
// 执行校验验证码
validValidCode(validCode, validCodeReqNo);
// 根据手机号获取用户信息判断用户是否存在根据B端或C端判断
if(SaClientTypeEnum.B.getValue().equals(type)) {
if(ObjectUtil.isEmpty(loginUserApi.getUserByPhone(phoneOrEmail))) {
if(ObjectUtil.isEmpty(loginUserApi.getUserByPhone(phone))) {
throw new CommonException(AuthExceptionEnum.PHONE_ERROR.getValue());
}
} else {
if(ObjectUtil.isEmpty(clientLoginUserApi.getClientUserByPhone(phoneOrEmail))) {
if(ObjectUtil.isEmpty(clientLoginUserApi.getClientUserByPhone(phone))) {
throw new CommonException(AuthExceptionEnum.PHONE_ERROR.getValue());
}
}
@ -219,7 +205,7 @@ public class AuthServiceImpl implements AuthService {
throw new CommonException(AuthExceptionEnum.VALID_CODE_REQ_NO_EMPTY.getValue());
}
// 执行校验验证码
validValidCode(null, validCode, validCodeReqNo);
validValidCode(validCode, validCodeReqNo);
}
}
// SM2解密并获得前端传来的密码哈希值

View File

@ -192,7 +192,7 @@ public class BizUserServiceImpl extends ServiceImpl<BizUserMapper, BizUser> impl
}
if(ObjectUtil.isNotEmpty(bizUserAddParam.getEmail())) {
if(!CommonEmailUtil.isEmail(bizUserAddParam.getEmail())) {
throw new CommonException("邮箱:{}格式错误", bizUserAddParam.getEmail());
throw new CommonException("邮箱:{}格式错误", bizUserAddParam.getPhone());
}
if (this.count(new LambdaQueryWrapper<BizUser>()
.eq(BizUser::getEmail, bizUserAddParam.getEmail())) > 0) {
@ -247,7 +247,7 @@ public class BizUserServiceImpl extends ServiceImpl<BizUserMapper, BizUser> impl
}
if(ObjectUtil.isNotEmpty(bizUserEditParam.getEmail())) {
if(!CommonEmailUtil.isEmail(bizUserEditParam.getEmail())) {
throw new CommonException("邮箱:{}格式错误", bizUserEditParam.getEmail());
throw new CommonException("邮箱:{}格式错误", bizUserEditParam.getPhone());
}
if (this.count(new LambdaQueryWrapper<BizUser>()
.eq(BizUser::getEmail, bizUserEditParam.getEmail())
@ -528,7 +528,7 @@ public class BizUserServiceImpl extends ServiceImpl<BizUserMapper, BizUser> impl
.doWrite(bizUserExportResultList);
CommonDownloadUtil.download(tempFile, response);
} catch (Exception e) {
log.error(">>> 人员导出异常:", e);
e.printStackTrace();
CommonResponseUtil.renderError(response, "导出失败");
} finally {
FileUtil.del(tempFile);
@ -582,7 +582,7 @@ public class BizUserServiceImpl extends ServiceImpl<BizUserMapper, BizUser> impl
// 下载
CommonDownloadUtil.download(resultFile, response);
} catch (Exception e) {
log.error(">>> 导出人员个人信息异常:", e);
e.printStackTrace();
CommonResponseUtil.renderError(response, "导出失败");
} finally {
// 删除临时文件

View File

@ -153,7 +153,7 @@ public class ClientUserServiceImpl extends ServiceImpl<ClientUserMapper, ClientU
}
if(ObjectUtil.isNotEmpty(clientUserAddParam.getEmail())) {
if(!CommonEmailUtil.isEmail(clientUserAddParam.getEmail())) {
throw new CommonException("邮箱:{}格式错误", clientUserAddParam.getEmail());
throw new CommonException("邮箱:{}格式错误", clientUserAddParam.getPhone());
}
if (this.count(new LambdaQueryWrapper<ClientUser>()
.eq(ClientUser::getEmail, clientUserAddParam.getEmail())) > 0) {
@ -188,7 +188,7 @@ public class ClientUserServiceImpl extends ServiceImpl<ClientUserMapper, ClientU
}
if(ObjectUtil.isNotEmpty(clientUserEditParam.getEmail())) {
if(!CommonEmailUtil.isEmail(clientUserEditParam.getEmail())) {
throw new CommonException("邮箱:{}格式错误", clientUserEditParam.getEmail());
throw new CommonException("邮箱:{}格式错误", clientUserEditParam.getPhone());
}
if (this.count(new LambdaQueryWrapper<ClientUser>()
.eq(ClientUser::getEmail, clientUserEditParam.getEmail())

View File

@ -63,8 +63,7 @@ public class DevDictServiceImpl extends ServiceImpl<DevDictMapper, DevDict> impl
queryWrapper.lambda().select(DevDict::getId, DevDict::getParentId, DevDict::getCategory, DevDict::getDictLabel,
DevDict::getDictValue, DevDict::getSortCode);
if (ObjectUtil.isNotEmpty(devDictPageParam.getParentId())) {
queryWrapper.lambda().eq(DevDict::getParentId, devDictPageParam.getParentId())
.or().eq(DevDict::getId, devDictPageParam.getParentId());
queryWrapper.lambda().eq(DevDict::getParentId, devDictPageParam.getParentId());
}
if (ObjectUtil.isNotEmpty(devDictPageParam.getCategory())) {
queryWrapper.lambda().eq(DevDict::getCategory, devDictPageParam.getCategory());

View File

@ -400,7 +400,7 @@ public class GenBasicServiceImpl extends ServiceImpl<GenBasicMapper, GenBasic> i
// 移动完毕删除临时目录
FileUtil.del(tempFolder);
} catch (Exception e) {
log.error(">>> 代码生成异常:", e);
e.printStackTrace();
throw new CommonException("代码生成异常");
}
}
@ -517,7 +517,7 @@ public class GenBasicServiceImpl extends ServiceImpl<GenBasicMapper, GenBasic> i
});
genBasicPreviewResult.setGenBasicCodeBackendResultList(genBasicCodeBackendResultList);
} catch (Exception e) {
log.error(">>> 代码生成异常:", e);
e.printStackTrace();
throw new CommonException("代码生成异常");
}
return genBasicPreviewResult;

View File

@ -14,7 +14,6 @@ package vip.xiaonuo.sys.modular.resource.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollStreamUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.lang.tree.TreeNode;
@ -49,10 +48,6 @@ import vip.xiaonuo.sys.modular.resource.service.SysModuleService;
import javax.annotation.Resource;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
/**
@ -102,10 +97,6 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
lambdaQueryWrapper.like(SysMenu::getTitle, sysMenuTreeParam.getSearchKey());
}
List<SysMenu> resourceList = this.list(lambdaQueryWrapper);
// 填充上层的父级菜单
this.fillParentSysMenuInfo(resourceList);
List<TreeNode<String>> treeNodeList = resourceList.stream().map(sysMenu ->
new TreeNode<>(sysMenu.getId(), sysMenu.getParentId(),
sysMenu.getTitle(), sysMenu.getSortCode()).setExtra(JSONUtil.parseObj(sysMenu)))
@ -113,36 +104,6 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
return TreeUtil.build(treeNodeList, "0");
}
private void fillParentSysMenuInfo(List<SysMenu> resourceList) {
if(CollUtil.isNotEmpty(resourceList)){
List<SysMenu> parentRelationSysMenus = resourceList.stream().filter(distinctByKey(SysMenu::getParentId)).collect(Collectors.toList());
List<String> parentIds = null;
if(CollUtil.isNotEmpty(parentRelationSysMenus)){
parentIds = CollUtil.newArrayList();
for(SysMenu parentRelationSysMenu : parentRelationSysMenus){
if(!StrUtil.equals(parentRelationSysMenu.getParentId(),"0")){
parentIds.add(parentRelationSysMenu.getParentId());
}
}
}
if(CollUtil.isNotEmpty(parentIds)){
LambdaQueryWrapper<SysMenu> parentSysMenuLambdaQueryWrapper = new LambdaQueryWrapper<>();
parentSysMenuLambdaQueryWrapper.in(SysMenu::getId,parentIds);
List<SysMenu> parentSysMenus = this.list(parentSysMenuLambdaQueryWrapper);
if(CollUtil.isNotEmpty(parentSysMenus)){
this.fillParentSysMenuInfo(parentSysMenus);
resourceList.addAll(parentSysMenus);
}
}
}
}
private static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) {
Set<Object> seen = ConcurrentHashMap.newKeySet();
return t -> seen.add(keyExtractor.apply(t));
}
@Transactional(rollbackFor = Exception.class)
@Override
public void add(SysMenuAddParam sysMenuAddParam) {

View File

@ -48,10 +48,8 @@ import vip.xiaonuo.sys.modular.relation.entity.SysRelation;
import vip.xiaonuo.sys.modular.relation.enums.SysRelationCategoryEnum;
import vip.xiaonuo.sys.modular.relation.service.SysRelationService;
import vip.xiaonuo.sys.modular.resource.entity.SysMenu;
import vip.xiaonuo.sys.modular.resource.entity.SysModule;
import vip.xiaonuo.sys.modular.resource.enums.SysResourceCategoryEnum;
import vip.xiaonuo.sys.modular.resource.service.SysMenuService;
import vip.xiaonuo.sys.modular.resource.service.SysModuleService;
import vip.xiaonuo.sys.modular.role.entity.SysRole;
import vip.xiaonuo.sys.modular.role.enums.SysRoleCategoryEnum;
import vip.xiaonuo.sys.modular.role.mapper.SysRoleMapper;
@ -65,7 +63,6 @@ import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
/**
@ -83,9 +80,6 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
@Resource
private SysOrgService sysOrgService;
@Resource
private SysModuleService sysModuleService;
@Resource
private SysMenuService sysMenuService;
@ -224,19 +218,8 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
@Override
public void grantResource(SysRoleGrantResourceParam sysRoleGrantResourceParam) {
String id = sysRoleGrantResourceParam.getId();
SysRole sysRole = this.queryEntity(id);
List<String> menuIdList = sysRoleGrantResourceParam.getGrantInfoList().stream()
.map(SysRoleGrantResourceParam.SysRoleGrantResource::getMenuId).collect(Collectors.toList());
if(!SysBuildInEnum.BUILD_IN_ROLE_CODE.getValue().equals(sysRole.getCode())) {
if(ObjectUtil.isNotEmpty(menuIdList)) {
Set<String> sysModuleIdList = sysMenuService.listByIds(menuIdList).stream().map(SysMenu::getModule).collect(Collectors.toSet());
boolean containsSystemModule = sysModuleService.listByIds(sysModuleIdList).stream().map(SysModule::getCode)
.collect(Collectors.toSet()).contains(SysBuildInEnum.BUILD_IN_MODULE_CODE.getValue());
if(containsSystemModule) {
throw new CommonException("非超管角色不可被授权系统模块菜单资源");
}
}
}
List<String> extJsonList = sysRoleGrantResourceParam.getGrantInfoList().stream()
.map(JSONUtil::toJsonStr).collect(Collectors.toList());
sysRelationService.saveRelationBatchWithClear(id, menuIdList, SysRelationCategoryEnum.SYS_ROLE_HAS_RESOURCE.getValue(),

View File

@ -85,12 +85,10 @@ import vip.xiaonuo.sys.modular.relation.enums.SysRelationCategoryEnum;
import vip.xiaonuo.sys.modular.relation.service.SysRelationService;
import vip.xiaonuo.sys.modular.resource.entity.SysButton;
import vip.xiaonuo.sys.modular.resource.entity.SysMenu;
import vip.xiaonuo.sys.modular.resource.entity.SysModule;
import vip.xiaonuo.sys.modular.resource.enums.SysResourceCategoryEnum;
import vip.xiaonuo.sys.modular.resource.enums.SysResourceMenuTypeEnum;
import vip.xiaonuo.sys.modular.resource.service.SysButtonService;
import vip.xiaonuo.sys.modular.resource.service.SysMenuService;
import vip.xiaonuo.sys.modular.resource.service.SysModuleService;
import vip.xiaonuo.sys.modular.role.entity.SysRole;
import vip.xiaonuo.sys.modular.role.enums.SysRoleDataScopeCategoryEnum;
import vip.xiaonuo.sys.modular.role.service.SysRoleService;
@ -123,7 +121,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
private static final String SNOWY_SYS_DEFAULT_WORKBENCH_DATA_KEY = "SNOWY_SYS_DEFAULT_WORKBENCH_DATA";
private static final String USER_VALID_CODE_CACHE_KEY = "user-validCode:";
private static final String USER_CACHE_KEY = "user-validCode:";
public static final String USER_CACHE_ALL_KEY = "sys-user:all";
@ -157,9 +155,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
@Resource
private SysRoleService sysRoleService;
@Resource
private SysModuleService sysModuleService;
@Resource
private SysMenuService sysMenuService;
@ -270,7 +265,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
}
if (ObjectUtil.isNotEmpty(sysUserAddParam.getEmail())) {
if (!CommonEmailUtil.isEmail(sysUserAddParam.getEmail())) {
throw new CommonException("邮箱:{}格式错误", sysUserAddParam.getEmail());
throw new CommonException("邮箱:{}格式错误", sysUserAddParam.getPhone());
}
if (this.count(new LambdaQueryWrapper<SysUser>()
.eq(SysUser::getEmail, sysUserAddParam.getEmail())) > 0) {
@ -314,7 +309,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
}
if (ObjectUtil.isNotEmpty(sysUserEditParam.getEmail())) {
if (!CommonEmailUtil.isEmail(sysUserEditParam.getEmail())) {
throw new CommonException("邮箱:{}格式错误", sysUserEditParam.getEmail());
throw new CommonException("邮箱:{}格式错误", sysUserEditParam.getPhone());
}
if (this.count(new LambdaQueryWrapper<SysUser>()
.eq(SysUser::getEmail, sysUserEditParam.getEmail())
@ -404,7 +399,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
// 将请求号返回前端
sysUserPicValidCodeResult.setValidCodeReqNo(validCodeReqNo);
// 将请求号作为key验证码的值作为value放到redis用于校验5分钟有效
commonCacheOperator.put(USER_VALID_CODE_CACHE_KEY + validCodeReqNo, validCode, 5 * 60);
commonCacheOperator.put(USER_CACHE_KEY + validCodeReqNo, validCode, 5 * 60);
return sysUserPicValidCodeResult;
}
@ -414,28 +409,21 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
* @author xuyuxiang
* @date 2022/8/25 14:29
**/
private void validValidCode(String phoneOrEmail, String validCode, String validCodeReqNo) {
private void validValidCode(String validCode, String validCodeReqNo) {
// 依据请求号取出缓存中的验证码进行校验
Object existValidCode;
if(ObjectUtil.isEmpty(phoneOrEmail)) {
existValidCode = commonCacheOperator.get(USER_VALID_CODE_CACHE_KEY + validCodeReqNo);
} else {
existValidCode = commonCacheOperator.get(USER_VALID_CODE_CACHE_KEY + phoneOrEmail + StrUtil.UNDERLINE + validCodeReqNo);
}
Object existValidCode = commonCacheOperator.get(USER_CACHE_KEY + validCodeReqNo);
// 为空则直接验证码错误
if (ObjectUtil.isEmpty(existValidCode)) {
throw new CommonException("验证码错误");
}
// 移除该验证码
if(ObjectUtil.isEmpty(phoneOrEmail)) {
commonCacheOperator.remove(USER_VALID_CODE_CACHE_KEY + validCodeReqNo);
} else {
commonCacheOperator.remove(USER_VALID_CODE_CACHE_KEY + phoneOrEmail + StrUtil.UNDERLINE + validCodeReqNo);
}
// 不一致则直接验证码错误
if (!validCode.equals(Convert.toStr(existValidCode).toLowerCase())) {
// 移除该验证码
commonCacheOperator.remove(USER_CACHE_KEY + validCodeReqNo);
throw new CommonException("验证码错误");
}
// 移除该验证码
commonCacheOperator.remove(USER_CACHE_KEY + validCodeReqNo);
}
@Override
@ -447,7 +435,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
throw new CommonException("手机号码:{}格式错误", phone);
}
// 执行校验验证码
validValidCode(null, sysUserGetPhoneValidCodeParam.getValidCode(), sysUserGetPhoneValidCodeParam.getValidCodeReqNo());
validValidCode(sysUserGetPhoneValidCodeParam.getValidCode(), sysUserGetPhoneValidCodeParam.getValidCodeReqNo());
// 根据手机号获取用户信息判断用户是否存在
if (ObjectUtil.isEmpty(this.getUserByPhone(phone))) {
throw new CommonException("手机码:{}不存在", phone);
@ -466,7 +454,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
//devSmsApi.sendSmsTencent(null, phone, null, "验证码模板号", phoneValidCode);
// 将请求号作为key验证码的值作为value放到redis用于校验5分钟有效
commonCacheOperator.put(USER_VALID_CODE_CACHE_KEY + phone + StrUtil.UNDERLINE + phoneValidCodeReqNo, phoneValidCode, 5 * 60);
commonCacheOperator.put(USER_CACHE_KEY + phoneValidCodeReqNo, phoneValidCode, 5 * 60);
// 返回请求号
return phoneValidCodeReqNo;
}
@ -475,12 +463,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
public String findPasswordGetEmailValidCode(SysUserGetEmailValidCodeParam sysUserGetEmailValidCodeParam) {
// 邮箱
String email = sysUserGetEmailValidCodeParam.getEmail();
// 验证码正确则校验邮箱格式
// 验证码正确则校验手机号格式
if (!CommonEmailUtil.isEmail(email)) {
throw new CommonException("邮箱:{}格式错误", email);
}
// 执行校验验证码
validValidCode(null, sysUserGetEmailValidCodeParam.getValidCode(), sysUserGetEmailValidCodeParam.getValidCodeReqNo());
validValidCode(sysUserGetEmailValidCodeParam.getValidCode(), sysUserGetEmailValidCodeParam.getValidCodeReqNo());
// 根据邮箱获取用户信息判断用户是否存在
if (ObjectUtil.isEmpty(this.getUserByEmail(email))) {
throw new CommonException("邮箱:{}不存在", email);
@ -495,7 +483,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
devEmailApi.sendTextEmailLocal(email, "找回密码邮件", content, CollectionUtil.newArrayList());
// 将请求号作为key验证码的值作为value放到redis用于校验5分钟有效
commonCacheOperator.put(USER_VALID_CODE_CACHE_KEY + email + StrUtil.UNDERLINE + emailValidCodeReqNo, emailValidCode, 5 * 60);
commonCacheOperator.put(USER_CACHE_KEY + emailValidCodeReqNo, emailValidCode, 5 * 60);
// 返回请求号
return emailValidCodeReqNo;
}
@ -503,7 +491,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
@Override
public void findPasswordByPhone(SysUserFindPwdByPhoneParam sysUserFindPwdByPhoneParam) {
// 执行校验验证码
validValidCode(sysUserFindPwdByPhoneParam.getPhone(), sysUserFindPwdByPhoneParam.getValidCode(), sysUserFindPwdByPhoneParam.getValidCodeReqNo());
validValidCode(sysUserFindPwdByPhoneParam.getValidCode(), sysUserFindPwdByPhoneParam.getValidCodeReqNo());
this.update(new LambdaUpdateWrapper<SysUser>().eq(SysUser::getPhone,
sysUserFindPwdByPhoneParam.getPhone()).set(SysUser::getPassword,
CommonCryptogramUtil.doHashValue(CommonCryptogramUtil.doSm2Decrypt(sysUserFindPwdByPhoneParam.getNewPassword()))));
@ -512,7 +500,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
@Override
public void findPasswordByEmail(SysUserFindPwdByEmailParam sysUserFindPwdByEmailParam) {
// 执行校验验证码
validValidCode(sysUserFindPwdByEmailParam.getEmail(), sysUserFindPwdByEmailParam.getValidCode(), sysUserFindPwdByEmailParam.getValidCodeReqNo());
validValidCode(sysUserFindPwdByEmailParam.getValidCode(), sysUserFindPwdByEmailParam.getValidCodeReqNo());
this.update(new LambdaUpdateWrapper<SysUser>().eq(SysUser::getEmail,
sysUserFindPwdByEmailParam.getEmail()).set(SysUser::getPassword,
CommonCryptogramUtil.doHashValue(CommonCryptogramUtil.doSm2Decrypt(sysUserFindPwdByEmailParam.getNewPassword()))));
@ -542,7 +530,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
sysUser.getId()).set(SysUser::getAvatar, base64));
return base64;
} catch (IOException e) {
log.error(">>> 头像修改失败:", e);
e.printStackTrace();
throw new CommonException("头像修改失败用户id值为{}", sysUser.getId());
}
}
@ -587,8 +575,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
SysRelationCategoryEnum.SYS_USER_HAS_RESOURCE.getValue());
if (ObjectUtil.isNotEmpty(roleIdList)) {
menuIdList.addAll(sysRelationService.getRelationTargetIdListByObjectIdListAndCategory(roleIdList,
SysRelationCategoryEnum.SYS_ROLE_HAS_RESOURCE.getValue()));
menuIdList = sysRelationService.getRelationTargetIdListByObjectIdListAndCategory(roleIdList,
SysRelationCategoryEnum.SYS_ROLE_HAS_RESOURCE.getValue());
}
// 获取所有的菜单和模块以及单页面列表并按分类和排序码排序
@ -623,8 +611,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
List<SysMenu> resultList = CollectionUtil.newArrayList();
// 获取拥有的菜单列表
List<String> finalMenuIdList = menuIdList;
List<SysMenu> menuList = allMenuList.stream().filter(sysMenu ->
menuIdList.contains(sysMenu.getId())).collect(Collectors.toList());
finalMenuIdList.contains(sysMenu.getId())).collect(Collectors.toList());
// 对获取到的角色对应的菜单列表进行处理获取父列表
menuList.forEach(sysMenu -> execRecursionFindParent(allMenuList, sysMenu.getId(), resultList));
@ -785,25 +774,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
@Override
public void grantResource(SysUserGrantResourceParam sysUserGrantResourceParam) {
String id = sysUserGrantResourceParam.getId();
SysUserIdParam sysUserIdParam = new SysUserIdParam();
List<String> roleIdList = this.ownRole(sysUserIdParam);
if(ObjectUtil.isEmpty(roleIdList)) {
throw new CommonException("非超管角色用户不可被授权系统模块菜单资源");
}
boolean hasSuperAdminRole = sysRoleService.listByIds(roleIdList).stream().map(SysRole::getCode).collect(Collectors.toSet())
.contains(SysBuildInEnum.BUILD_IN_ROLE_CODE.getValue());
List<String> menuIdList = sysUserGrantResourceParam.getGrantInfoList().stream()
.map(SysUserGrantResourceParam.SysUserGrantResource::getMenuId).collect(Collectors.toList());
if(!hasSuperAdminRole) {
if(ObjectUtil.isNotEmpty(menuIdList)) {
Set<String> sysModuleIdList = sysMenuService.listByIds(menuIdList).stream().map(SysMenu::getModule).collect(Collectors.toSet());
boolean containsSystemModule = sysModuleService.listByIds(sysModuleIdList).stream().map(SysModule::getCode)
.collect(Collectors.toSet()).contains(SysBuildInEnum.BUILD_IN_MODULE_CODE.getValue());
if(containsSystemModule) {
throw new CommonException("非超管角色用户不可被授权系统模块菜单资源");
}
}
}
List<String> extJsonList = sysUserGrantResourceParam.getGrantInfoList().stream()
.map(JSONUtil::toJsonStr).collect(Collectors.toList());
sysRelationService.saveRelationBatchWithClear(id, menuIdList, SysRelationCategoryEnum.SYS_USER_HAS_RESOURCE.getValue(),
@ -1002,8 +974,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
byte[] bytes = IoUtil.readBytes(inputStream);
CommonDownloadUtil.download("SNOWY2.0系统B端用户导入模板.xlsx", bytes, response);
} catch (Exception e) {
log.error(">>> 下载用户导入模板失败:", e);
CommonResponseUtil.renderError(response, "下载用户导入模板失败");
e.printStackTrace();
CommonResponseUtil.renderError(response, "导出失败");
}
}
@ -1036,8 +1008,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
.set("errorCount", errorCount)
.set("errorDetail", errorDetail);
} catch (Exception e) {
log.error(">>> 用户导入失败:", e);
throw new CommonException("用户导入失败");
e.printStackTrace();
throw new CommonException("文件导入失败");
}
}
@ -1162,7 +1134,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
// 返回成功
return JSONUtil.createObj().set("success", true);
} catch (Exception e) {
log.error(">>> 数据导入异常:", e);
e.printStackTrace();
return JSONUtil.createObj().set("success", false).set("index", i + 1).set("msg", "数据导入异常");
}
}
@ -1293,8 +1265,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
.doWrite(sysUserExportResultList);
CommonDownloadUtil.download(tempFile, response);
} catch (Exception e) {
log.error(">>> 用户导出失败:", e);
CommonResponseUtil.renderError(response, "用户导出失败");
e.printStackTrace();
CommonResponseUtil.renderError(response, "导出失败");
} finally {
FileUtil.del(tempFile);
}
@ -1347,7 +1319,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
// 下载
CommonDownloadUtil.download(resultFile, response);
} catch (Exception e) {
log.error(">>> 导出用户个人信息失败:", e);
e.printStackTrace();
CommonResponseUtil.renderError(response, "导出失败");
} finally {
// 删除临时文件

View File

@ -53,11 +53,10 @@ public class GlobalErrorViewController {
} else {
commonResult = CommonResult.error();
}
if(model instanceof Exception){
Exception exception = (Exception) model;
log.error(">>> 服务器未知异常:", exception);
}
Exception exception = (Exception) model;
exception.printStackTrace();
}
log.error(">>> {}", commonResult.getMsg());
return commonResult;
}
}

View File

@ -69,16 +69,17 @@ public class GlobalExceptionUtil {
commonResult = CommonResult.get(HttpStatus.HTTP_BAD_METHOD, "请求方法仅支持GET或POST", null);
}
} else if (e instanceof HttpMessageNotReadableException) {
log.error(">>> 参数传递格式异常:", e);
// 如果是参数传递格式不支持异常 415
if (e.getMessage().contains("JSON parse error")) {
e.printStackTrace();
//JSON格式转换错误特殊提示
commonResult = CommonResult.get(HttpStatus.HTTP_UNSUPPORTED_TYPE, "参数格式错误", null);
} else {
commonResult = CommonResult.get(HttpStatus.HTTP_UNSUPPORTED_TYPE, "请使用JSON方式传参", null);
}
} else if (e instanceof HttpMediaTypeNotSupportedException) {
log.error(">>> 参数传递格式异常:", e);
e.printStackTrace();
// 如果是JSON参数格式错误异常 415
commonResult = CommonResult.get(HttpStatus.HTTP_UNSUPPORTED_TYPE, "参数格式错误", null);
} else if (e instanceof MethodArgumentNotValidException) {
@ -103,7 +104,7 @@ public class GlobalExceptionUtil {
commonResult = CommonResult.get(HttpStatus.HTTP_UNSUPPORTED_TYPE, missingServletRequestParameterException.getMessage(), null);
}
else if (e instanceof MultipartException) {
log.error(">>> 文件上传参数异常:", e);
//文件上传错误特殊提示
commonResult = CommonResult.error("请使用multipart/form-data方式上传文件");
} else if (e instanceof MissingServletRequestPartException) {
@ -124,11 +125,11 @@ public class GlobalExceptionUtil {
CommonException commonException = (CommonException) secondCause;
commonResult = CommonResult.get(commonException.getCode(), commonException.getMsg(), null);
} else {
log.error(">>> 数据操作异常:", e);
e.printStackTrace();
commonResult = CommonResult.error("数据操作异常");
}
} else {
log.error(">>> 数据操作异常:", e);
e.printStackTrace();
commonResult = CommonResult.error("数据操作异常");
}
} else if (e instanceof CommonException) {
@ -138,10 +139,12 @@ public class GlobalExceptionUtil {
commonResult = CommonResult.get(commonException.getCode(), commonException.getMsg(), null);
} else {
// 未知异常打印详情
log.error(">>> 服务器未知异常:{}, 请求地址:{}", e, CommonServletUtil.getRequest().getRequestURL());
e.printStackTrace();
// 未知异常返回服务器异常
commonResult = CommonResult.error("服务器异常");
}
log.error(">>> {},请求地址:{}", commonResult.getMsg(), CommonServletUtil.getRequest().getRequestURL());
return commonResult;
}

File diff suppressed because one or more lines are too long

View File

@ -1,3 +0,0 @@
# 数据库说明
1.snowy_mysql.sqlmysql版本的主sql文件如果你是mysql运行此sql并启动项目即可
2.snowy_oracle.sqloracle版本的主sql文件如果你是oracle运行此sql并启动项目即可