Commit 19dc88b4e0d559aceed9b17ebd0ddd04eac7ecd7

Authored by Jim
Committed by GitHub
1 parent cfbd52bb

docs: 添加注释, 修复 (#1927)

* docs: 添加注释

* docs: 添加注释

* fix: 后台动态权限changePermissionCode加上await

* docs: 添加注释

* docs: 添加注释

* docs: 添加注释

* docs: 添加注释

* docs: 添加注释
.gitignore
... ... @@ -27,4 +27,7 @@ pnpm-debug.log*
27 27 *.njsproj
28 28 *.sln
29 29 *.sw?
30   -/package-lock.json
  30 +
  31 +package-lock.json
  32 +pnpm-lock.yaml
  33 +
... ...
pnpm-lock.yaml
1   -lockfileVersion: 5.4
  1 +lockfileVersion: 5.3
2 2  
3 3 overrides:
4 4 bin-wrapper: npm:bin-wrapper-china
... ... @@ -138,7 +138,7 @@ dependencies:
138 138 mockjs: 1.1.0
139 139 nprogress: 0.2.0
140 140 path-to-regexp: 6.2.0
141   - pinia: 2.0.12_ifhmkzsxec62ezvqv7qmanm4bq
  141 + pinia: 2.0.12_typescript@4.6.3+vue@3.2.33
142 142 print-js: 1.6.0
143 143 qrcode: 1.5.0
144 144 qs: 6.10.3
... ... @@ -172,8 +172,8 @@ devDependencies:
172 172 '@types/qs': 6.9.7
173 173 '@types/showdown': 1.9.4
174 174 '@types/sortablejs': 1.10.7
175   - '@typescript-eslint/eslint-plugin': 5.20.0_xgwjwvswzzo77lpghh6plzerx4
176   - '@typescript-eslint/parser': 5.20.0_jzhokl4shvj5szf5bgr66kln2a
  175 + '@typescript-eslint/eslint-plugin': 5.20.0_b9ac9b5656ce5dffade639fcf5e491bf
  176 + '@typescript-eslint/parser': 5.20.0_eslint@8.13.0+typescript@4.6.3
177 177 '@vitejs/plugin-legacy': 1.8.1_vite@2.9.5
178 178 '@vitejs/plugin-vue': 2.3.1_vite@2.9.5+vue@3.2.33
179 179 '@vitejs/plugin-vue-jsx': 1.3.10
... ... @@ -186,7 +186,7 @@ devDependencies:
186 186 dotenv: 16.0.0
187 187 eslint: 8.13.0
188 188 eslint-config-prettier: 8.5.0_eslint@8.13.0
189   - eslint-plugin-prettier: 4.0.0_dak2zfnx7mtmcpd5jcuo55rnb4
  189 + eslint-plugin-prettier: 4.0.0_1815ac95b7fb26c13c7d48a8eef62d0f
190 190 eslint-plugin-vue: 8.6.0_eslint@8.13.0
191 191 esno: 0.14.1
192 192 fs-extra: 10.1.0
... ... @@ -206,17 +206,17 @@ devDependencies:
206 206 stylelint: 14.7.1
207 207 stylelint-config-prettier: 9.0.3_stylelint@14.7.1
208 208 stylelint-config-recommended: 7.0.0_stylelint@14.7.1
209   - stylelint-config-recommended-vue: 1.4.0_dkblcabdfo7hanxmbj6kpjf26q
  209 + stylelint-config-recommended-vue: 1.4.0_1a82b100232bbe7036ec0a7ca7a4baf4
210 210 stylelint-config-standard: 25.0.0_stylelint@14.7.1
211 211 stylelint-order: 5.0.0_stylelint@14.7.1
212   - ts-node: 10.7.0_3z6inmgn4ud4moqealnfxgbl2m
  212 + ts-node: 10.7.0_de7c86b0cde507c63a0402da5b982bd3
213 213 typescript: 4.6.3
214 214 vite: 2.9.5_less@4.1.2
215 215 vite-plugin-compression: 0.5.1_vite@2.9.5
216 216 vite-plugin-html: 3.2.0_vite@2.9.5
217 217 vite-plugin-imagemin: 0.6.1_vite@2.9.5
218 218 vite-plugin-mkcert: 1.6.0
219   - vite-plugin-mock: 2.9.6_qiwm6q27tfokd2mntem6ma7w4y
  219 + vite-plugin-mock: 2.9.6_822ccf435f995ca1e98d9919e603f6e6
220 220 vite-plugin-purge-icons: 0.8.1_vite@2.9.5
221 221 vite-plugin-pwa: 0.11.13_vite@2.9.5
222 222 vite-plugin-style-import: 2.0.0_vite@2.9.5
... ... @@ -1519,7 +1519,7 @@ packages:
1519 1519 '@types/node': 17.0.25
1520 1520 chalk: 4.1.2
1521 1521 cosmiconfig: 7.0.1
1522   - cosmiconfig-typescript-loader: 1.0.9_3z6inmgn4ud4moqealnfxgbl2m
  1522 + cosmiconfig-typescript-loader: 1.0.9_de7c86b0cde507c63a0402da5b982bd3
1523 1523 lodash: 4.17.21
1524 1524 resolve-from: 5.0.0
1525 1525 typescript: 4.6.3
... ... @@ -1905,7 +1905,7 @@ packages:
1905 1905 '@iconify/iconify': 2.2.1
1906 1906 dev: true
1907 1907  
1908   - /@rollup/plugin-babel/5.3.1_6m6vi5xreq5wlqqwvo3xvcrttm:
  1908 + /@rollup/plugin-babel/5.3.1_@babel+core@7.17.9+rollup@2.70.2:
1909 1909 resolution: {integrity: sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q==}
1910 1910 engines: {node: '>= 10.0.0'}
1911 1911 peerDependencies:
... ... @@ -2209,7 +2209,7 @@ packages:
2209 2209 resolution: {integrity: sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg==}
2210 2210 dev: true
2211 2211  
2212   - /@typescript-eslint/eslint-plugin/5.20.0_xgwjwvswzzo77lpghh6plzerx4:
  2212 + /@typescript-eslint/eslint-plugin/5.20.0_b9ac9b5656ce5dffade639fcf5e491bf:
2213 2213 resolution: {integrity: sha512-fapGzoxilCn3sBtC6NtXZX6+P/Hef7VDbyfGqTTpzYydwhlkevB+0vE0EnmHPVTVSy68GUncyJ/2PcrFBeCo5Q==}
2214 2214 engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
2215 2215 peerDependencies:
... ... @@ -2220,10 +2220,10 @@ packages:
2220 2220 typescript:
2221 2221 optional: true
2222 2222 dependencies:
2223   - '@typescript-eslint/parser': 5.20.0_jzhokl4shvj5szf5bgr66kln2a
  2223 + '@typescript-eslint/parser': 5.20.0_eslint@8.13.0+typescript@4.6.3
2224 2224 '@typescript-eslint/scope-manager': 5.20.0
2225   - '@typescript-eslint/type-utils': 5.20.0_jzhokl4shvj5szf5bgr66kln2a
2226   - '@typescript-eslint/utils': 5.20.0_jzhokl4shvj5szf5bgr66kln2a
  2225 + '@typescript-eslint/type-utils': 5.20.0_eslint@8.13.0+typescript@4.6.3
  2226 + '@typescript-eslint/utils': 5.20.0_eslint@8.13.0+typescript@4.6.3
2227 2227 debug: 4.3.4
2228 2228 eslint: 8.13.0
2229 2229 functional-red-black-tree: 1.0.1
... ... @@ -2236,7 +2236,7 @@ packages:
2236 2236 - supports-color
2237 2237 dev: true
2238 2238  
2239   - /@typescript-eslint/parser/5.20.0_jzhokl4shvj5szf5bgr66kln2a:
  2239 + /@typescript-eslint/parser/5.20.0_eslint@8.13.0+typescript@4.6.3:
2240 2240 resolution: {integrity: sha512-UWKibrCZQCYvobmu3/N8TWbEeo/EPQbS41Ux1F9XqPzGuV7pfg6n50ZrFo6hryynD8qOTTfLHtHjjdQtxJ0h/w==}
2241 2241 engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
2242 2242 peerDependencies:
... ... @@ -2264,7 +2264,7 @@ packages:
2264 2264 '@typescript-eslint/visitor-keys': 5.20.0
2265 2265 dev: true
2266 2266  
2267   - /@typescript-eslint/type-utils/5.20.0_jzhokl4shvj5szf5bgr66kln2a:
  2267 + /@typescript-eslint/type-utils/5.20.0_eslint@8.13.0+typescript@4.6.3:
2268 2268 resolution: {integrity: sha512-WxNrCwYB3N/m8ceyoGCgbLmuZwupvzN0rE8NBuwnl7APgjv24ZJIjkNzoFBXPRCGzLNkoU/WfanW0exvp/+3Iw==}
2269 2269 engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
2270 2270 peerDependencies:
... ... @@ -2274,7 +2274,7 @@ packages:
2274 2274 typescript:
2275 2275 optional: true
2276 2276 dependencies:
2277   - '@typescript-eslint/utils': 5.20.0_jzhokl4shvj5szf5bgr66kln2a
  2277 + '@typescript-eslint/utils': 5.20.0_eslint@8.13.0+typescript@4.6.3
2278 2278 debug: 4.3.4
2279 2279 eslint: 8.13.0
2280 2280 tsutils: 3.21.0_typescript@4.6.3
... ... @@ -2309,7 +2309,7 @@ packages:
2309 2309 - supports-color
2310 2310 dev: true
2311 2311  
2312   - /@typescript-eslint/utils/5.20.0_jzhokl4shvj5szf5bgr66kln2a:
  2312 + /@typescript-eslint/utils/5.20.0_eslint@8.13.0+typescript@4.6.3:
2313 2313 resolution: {integrity: sha512-lHONGJL1LIO12Ujyx8L8xKbwWSkoUKFSO+0wDAqGXiudWB2EO7WEUT+YZLtVbmOmSllAjLb9tpoIPwpRe5Tn6w==}
2314 2314 engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
2315 2315 peerDependencies:
... ... @@ -2773,7 +2773,7 @@ packages:
2773 2773 dev: true
2774 2774  
2775 2775 /archive-type/4.0.0:
2776   - resolution: {integrity: sha1-+S5yIzBW38aWlHJ0nCZ72wRrHXA=}
  2776 + resolution: {integrity: sha512-zV4Ky0v1F8dBrdYElwTvQhweQ0P7Kwc1aluqJsYtOBP01jXcWCyW2IEfI1YiqsG+Iy7ZR+o5LF1N+PGECBxHWA==}
2777 2777 engines: {node: '>=4'}
2778 2778 dependencies:
2779 2779 file-type: 4.4.0
... ... @@ -3116,11 +3116,11 @@ packages:
3116 3116 dev: true
3117 3117  
3118 3118 /buffer-crc32/0.2.13:
3119   - resolution: {integrity: sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=}
  3119 + resolution: {integrity: sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==}
3120 3120 dev: true
3121 3121  
3122 3122 /buffer-fill/1.0.0:
3123   - resolution: {integrity: sha1-+PeLdniYiO858gXNY39o5wISKyw=}
  3123 + resolution: {integrity: sha512-T7zexNBwiiaCOGDg9xNX9PBmjrubblRkENuptryuI64URkXDFum9il/JGL8Lm8wYfAXpredVXXZz7eMHilimiQ==}
3124 3124 dev: true
3125 3125  
3126 3126 /buffer-from/1.1.2:
... ... @@ -3161,7 +3161,7 @@ packages:
3161 3161 dev: true
3162 3162  
3163 3163 /cacheable-request/2.1.4:
3164   - resolution: {integrity: sha1-DYCIAbY0KtM8kd+dC0TcCbkeXD0=}
  3164 + resolution: {integrity: sha512-vag0O2LKZ/najSoUwDbVlnlCFvhBE/7mGTY2B5FgCBDcRD+oVV1HYTOwM6JZfMg/hIcM6IwnTZ1uQQL5/X3xIQ==}
3165 3165 dependencies:
3166 3166 clone-response: 1.0.2
3167 3167 get-stream: 3.0.0
... ... @@ -3416,7 +3416,7 @@ packages:
3416 3416 dev: true
3417 3417  
3418 3418 /clone-response/1.0.2:
3419   - resolution: {integrity: sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=}
  3419 + resolution: {integrity: sha512-yjLXh88P599UOyPTFX0POsd7WxnbsVsGohcwzHOLspIhhpalPw1BcqED8NblyZLKcGrL8dTgMlcaZxV2jAD41Q==}
3420 3420 dependencies:
3421 3421 mimic-response: 1.0.1
3422 3422 dev: true
... ... @@ -3793,7 +3793,7 @@ packages:
3793 3793 vary: 1.1.2
3794 3794 dev: true
3795 3795  
3796   - /cosmiconfig-typescript-loader/1.0.9_3z6inmgn4ud4moqealnfxgbl2m:
  3796 + /cosmiconfig-typescript-loader/1.0.9_de7c86b0cde507c63a0402da5b982bd3:
3797 3797 resolution: {integrity: sha512-tRuMRhxN4m1Y8hP9SNYfz7jRwt8lZdWxdjg/ohg5esKmsndJIn4yT96oJVcf5x0eA11taXl+sIp+ielu529k6g==}
3798 3798 engines: {node: '>=12', npm: '>=6'}
3799 3799 peerDependencies:
... ... @@ -3802,7 +3802,7 @@ packages:
3802 3802 dependencies:
3803 3803 '@types/node': 17.0.25
3804 3804 cosmiconfig: 7.0.1
3805   - ts-node: 10.7.0_3z6inmgn4ud4moqealnfxgbl2m
  3805 + ts-node: 10.7.0_de7c86b0cde507c63a0402da5b982bd3
3806 3806 typescript: 4.6.3
3807 3807 transitivePeerDependencies:
3808 3808 - '@swc/core'
... ... @@ -3851,7 +3851,7 @@ packages:
3851 3851 dev: true
3852 3852  
3853 3853 /cross-spawn/5.1.0:
3854   - resolution: {integrity: sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=}
  3854 + resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==}
3855 3855 dependencies:
3856 3856 lru-cache: 4.1.5
3857 3857 shebang-command: 1.2.0
... ... @@ -4031,12 +4031,12 @@ packages:
4031 4031 engines: {node: '>=0.10.0'}
4032 4032  
4033 4033 /decode-uri-component/0.2.0:
4034   - resolution: {integrity: sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=}
  4034 + resolution: {integrity: sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og==}
4035 4035 engines: {node: '>=0.10'}
4036 4036 dev: true
4037 4037  
4038 4038 /decompress-response/3.3.0:
4039   - resolution: {integrity: sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=}
  4039 + resolution: {integrity: sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA==}
4040 4040 engines: {node: '>=4'}
4041 4041 dependencies:
4042 4042 mimic-response: 1.0.1
... ... @@ -4072,7 +4072,7 @@ packages:
4072 4072 dev: true
4073 4073  
4074 4074 /decompress-unzip/4.0.1:
4075   - resolution: {integrity: sha1-3qrM39FK6vhVePczroIQ+bSEj2k=}
  4075 + resolution: {integrity: sha512-1fqeluvxgnn86MOh66u8FjbtJpAFv5wgCT9Iw8rcBqQcCo5tO8eiJw7NNTrvt9n4CRBVq7CstiS922oPgyGLrw==}
4076 4076 engines: {node: '>=4'}
4077 4077 dependencies:
4078 4078 file-type: 3.9.0
... ... @@ -4309,7 +4309,7 @@ packages:
4309 4309 dev: true
4310 4310  
4311 4311 /duplexer3/0.1.4:
4312   - resolution: {integrity: sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=}
  4312 + resolution: {integrity: sha512-CEj8FwwNA4cVH2uFCoHUrmojhYh1vmCdOaneKJXwkeY1i9jnlslVo9dx+hQ5Hl9GnH/Bwy/IjxAyOePyPKYnzA==}
4313 4313 dev: true
4314 4314  
4315 4315 /eastasianwidth/0.2.0:
... ... @@ -4699,7 +4699,7 @@ packages:
4699 4699 eslint: 8.13.0
4700 4700 dev: true
4701 4701  
4702   - /eslint-plugin-prettier/4.0.0_dak2zfnx7mtmcpd5jcuo55rnb4:
  4702 + /eslint-plugin-prettier/4.0.0_1815ac95b7fb26c13c7d48a8eef62d0f:
4703 4703 resolution: {integrity: sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==}
4704 4704 engines: {node: '>=6.0.0'}
4705 4705 peerDependencies:
... ... @@ -4884,7 +4884,7 @@ packages:
4884 4884 dev: true
4885 4885  
4886 4886 /execa/0.7.0:
4887   - resolution: {integrity: sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=}
  4887 + resolution: {integrity: sha512-RztN09XglpYI7aBBrJCPW95jEH7YF1UEPOoX9yDhUTPdp7mK+CQvnLTuD10BNXZ3byLTu2uehZ8EcKT/4CGiFw==}
4888 4888 engines: {node: '>=4'}
4889 4889 dependencies:
4890 4890 cross-spawn: 5.1.0
... ... @@ -5070,7 +5070,7 @@ packages:
5070 5070 dev: true
5071 5071  
5072 5072 /fd-slicer/1.1.0:
5073   - resolution: {integrity: sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=}
  5073 + resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==}
5074 5074 dependencies:
5075 5075 pend: 1.2.0
5076 5076 dev: true
... ... @@ -5115,17 +5115,17 @@ packages:
5115 5115 dev: true
5116 5116  
5117 5117 /file-type/3.9.0:
5118   - resolution: {integrity: sha1-JXoHg4TR24CHvESdEH1SpSZyuek=}
  5118 + resolution: {integrity: sha512-RLoqTXE8/vPmMuTI88DAzhMYC99I8BWv7zYP4A1puo5HIjEJ5EX48ighy4ZyKMG9EDXxBgW6e++cn7d1xuFghA==}
5119 5119 engines: {node: '>=0.10.0'}
5120 5120 dev: true
5121 5121  
5122 5122 /file-type/4.4.0:
5123   - resolution: {integrity: sha1-G2AOX8ofvcboDApwxxyNul95BsU=}
  5123 + resolution: {integrity: sha512-f2UbFQEk7LXgWpi5ntcO86OeA/cC80fuDDDaX/fZ2ZGel+AF7leRQqBBW1eJNiiQkrZlAoM6P+VYP5P6bOlDEQ==}
5124 5124 engines: {node: '>=4'}
5125 5125 dev: true
5126 5126  
5127 5127 /file-type/5.2.0:
5128   - resolution: {integrity: sha1-LdvqfHP/42No365J3DOMBYwritY=}
  5128 + resolution: {integrity: sha512-Iq1nJ6D2+yIO4c8HHg4fyVb8mAJieo1Oloy1mLLaB2PvezNedhBVm+QU7g0qM42aiMbRXTxKKwGD17rjKNJYVQ==}
5129 5129 engines: {node: '>=4'}
5130 5130 dev: true
5131 5131  
... ... @@ -5146,7 +5146,7 @@ packages:
5146 5146 dev: true
5147 5147  
5148 5148 /filename-reserved-regex/2.0.0:
5149   - resolution: {integrity: sha1-q/c9+rc10EVECr/qLZHzieu/oik=}
  5149 + resolution: {integrity: sha512-lc1bnsSr4L4Bdif8Xb/qrtokGbq5zlsms/CYH8PP+WtCkGNF65DPiQY8vG3SakEdRn8Dlnm+gW/qWKKjS5sZzQ==}
5150 5150 engines: {node: '>=4'}
5151 5151 dev: true
5152 5152  
... ... @@ -5302,7 +5302,7 @@ packages:
5302 5302 dev: true
5303 5303  
5304 5304 /from2/2.3.0:
5305   - resolution: {integrity: sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=}
  5305 + resolution: {integrity: sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g==}
5306 5306 dependencies:
5307 5307 inherits: 2.0.4
5308 5308 readable-stream: 2.3.7
... ... @@ -5412,7 +5412,7 @@ packages:
5412 5412 dev: true
5413 5413  
5414 5414 /get-stream/2.3.1:
5415   - resolution: {integrity: sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=}
  5415 + resolution: {integrity: sha512-AUGhbbemXxrZJRD5cDvKtQxLuYaIbNtDTK8YqupCI393Q2KSTreEsLUN3ZxAWFGiKTzL6nKuzfcIvieflUX9qA==}
5416 5416 engines: {node: '>=0.10.0'}
5417 5417 dependencies:
5418 5418 object-assign: 4.1.1
... ... @@ -5420,7 +5420,7 @@ packages:
5420 5420 dev: true
5421 5421  
5422 5422 /get-stream/3.0.0:
5423   - resolution: {integrity: sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=}
  5423 + resolution: {integrity: sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ==}
5424 5424 engines: {node: '>=4'}
5425 5425 dev: true
5426 5426  
... ... @@ -5897,7 +5897,7 @@ packages:
5897 5897 dev: true
5898 5898  
5899 5899 /image-size/0.5.5:
5900   - resolution: {integrity: sha1-Cd/Uq50g4p6xw+gLiZA3jfnjy5w=}
  5900 + resolution: {integrity: sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==}
5901 5901 engines: {node: '>=0.10.0'}
5902 5902 hasBin: true
5903 5903 dev: true
... ... @@ -6079,7 +6079,7 @@ packages:
6079 6079 dev: true
6080 6080  
6081 6081 /into-stream/3.1.0:
6082   - resolution: {integrity: sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY=}
  6082 + resolution: {integrity: sha512-TcdjPibTksa1NQximqep2r17ISRiNE9fwlfbg3F8ANdvP5/yrFTew86VcO//jk4QTaMlbjypPBq76HN2zaKfZQ==}
6083 6083 engines: {node: '>=4'}
6084 6084 dependencies:
6085 6085 from2: 2.3.0
... ... @@ -6267,7 +6267,7 @@ packages:
6267 6267 dev: true
6268 6268  
6269 6269 /is-natural-number/4.0.1:
6270   - resolution: {integrity: sha1-q5124dtM7VHjXeDHLr7PCfc0zeg=}
  6270 + resolution: {integrity: sha512-Y4LTamMe0DDQIIAlaer9eKebAlDSV6huy+TWhJVPlzZh2o4tRP5SQWFlLn5N0To4mDD22/qdOq+veo1cSISLgQ==}
6271 6271 dev: true
6272 6272  
6273 6273 /is-negative-zero/2.0.2:
... ... @@ -6433,7 +6433,7 @@ packages:
6433 6433 dev: true
6434 6434  
6435 6435 /isarray/1.0.0:
6436   - resolution: {integrity: sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=}
  6436 + resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==}
6437 6437 dev: true
6438 6438  
6439 6439 /isexe/2.0.0:
... ... @@ -6532,7 +6532,7 @@ packages:
6532 6532 dev: true
6533 6533  
6534 6534 /json-buffer/3.0.0:
6535   - resolution: {integrity: sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=}
  6535 + resolution: {integrity: sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ==}
6536 6536 dev: true
6537 6537  
6538 6538 /json-parse-better-errors/1.0.2:
... ... @@ -6865,7 +6865,7 @@ packages:
6865 6865 dev: true
6866 6866  
6867 6867 /lowercase-keys/1.0.0:
6868   - resolution: {integrity: sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=}
  6868 + resolution: {integrity: sha512-RPlX0+PHuvxVDZ7xX+EBVAp4RsVxP/TdDSN2mJYdiq1Lc4Hz7EUSjUI7RZrKKlmrIzVhf6Jo2stj7++gVarS0A==}
6869 6869 engines: {node: '>=0.10.0'}
6870 6870 dev: true
6871 6871  
... ... @@ -7509,7 +7509,7 @@ packages:
7509 7509 dev: true
7510 7510  
7511 7511 /p-event/1.3.0:
7512   - resolution: {integrity: sha1-jmtPT2XHK8W2/ii3XtqHT5akoIU=}
  7512 + resolution: {integrity: sha512-hV1zbA7gwqPVFcapfeATaNjQ3J0NuzorHPyG8GPL9g/Y/TplWVBVoCKCXL6Ej2zscrCEv195QNWJXuBH6XZuzA==}
7513 7513 engines: {node: '>=4'}
7514 7514 dependencies:
7515 7515 p-timeout: 1.2.1
... ... @@ -7528,7 +7528,7 @@ packages:
7528 7528 dev: true
7529 7529  
7530 7530 /p-is-promise/1.1.0:
7531   - resolution: {integrity: sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=}
  7531 + resolution: {integrity: sha512-zL7VE4JVS2IFSkR2GQKDSPEVxkoH43/p7oEnwpdCndKYJO0HVeRB7fA8TJwuLOTBREtK0ea8eHaxdwcpob5dmg==}
7532 7532 engines: {node: '>=4'}
7533 7533 dev: true
7534 7534  
... ... @@ -7597,7 +7597,7 @@ packages:
7597 7597 dev: true
7598 7598  
7599 7599 /p-timeout/1.2.1:
7600   - resolution: {integrity: sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=}
  7600 + resolution: {integrity: sha512-gb0ryzr+K2qFqFv6qi3khoeqMZF/+ajxQipEF6NteZVnvz9tzdsfAVj3lYtn1gAXvH5lfLwfxEII799gt/mRIA==}
7601 7601 engines: {node: '>=4'}
7602 7602 dependencies:
7603 7603 p-finally: 1.0.0
... ... @@ -7756,7 +7756,7 @@ packages:
7756 7756 dev: true
7757 7757  
7758 7758 /pend/1.2.0:
7759   - resolution: {integrity: sha1-elfrVQpng/kRUzH89GY9XI4AelA=}
  7759 + resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==}
7760 7760 dev: true
7761 7761  
7762 7762 /picocolors/1.0.0:
... ... @@ -7780,12 +7780,12 @@ packages:
7780 7780 dev: true
7781 7781  
7782 7782 /pify/2.3.0:
7783   - resolution: {integrity: sha1-7RQaasBDqEnqWISY59yosVMw6Qw=}
  7783 + resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==}
7784 7784 engines: {node: '>=0.10.0'}
7785 7785 dev: true
7786 7786  
7787 7787 /pify/3.0.0:
7788   - resolution: {integrity: sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=}
  7788 + resolution: {integrity: sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==}
7789 7789 engines: {node: '>=4'}
7790 7790 dev: true
7791 7791  
... ... @@ -7794,7 +7794,7 @@ packages:
7794 7794 engines: {node: '>=6'}
7795 7795 dev: true
7796 7796  
7797   - /pinia/2.0.12_ifhmkzsxec62ezvqv7qmanm4bq:
  7797 + /pinia/2.0.12_typescript@4.6.3+vue@3.2.33:
7798 7798 resolution: {integrity: sha512-tUeuYGFrLU5irmGyRAIxp35q1OTcZ8sKpGT4XkPeVcG35W4R6cfXDbCGexzmVqH5lTQJJTXXbNGutIu9yS5yew==}
7799 7799 peerDependencies:
7800 7800 '@vue/composition-api': ^1.4.0
... ... @@ -7813,14 +7813,14 @@ packages:
7813 7813 dev: false
7814 7814  
7815 7815 /pinkie-promise/2.0.1:
7816   - resolution: {integrity: sha1-ITXW36ejWMBprJsXh3YogihFD/o=}
  7816 + resolution: {integrity: sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==}
7817 7817 engines: {node: '>=0.10.0'}
7818 7818 dependencies:
7819 7819 pinkie: 2.0.4
7820 7820 dev: true
7821 7821  
7822 7822 /pinkie/2.0.4:
7823   - resolution: {integrity: sha1-clVrgM+g1IqXToDnckjoDtT3+HA=}
  7823 + resolution: {integrity: sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==}
7824 7824 engines: {node: '>=0.10.0'}
7825 7825 dev: true
7826 7826  
... ... @@ -7971,12 +7971,12 @@ packages:
7971 7971 dev: true
7972 7972  
7973 7973 /prepend-http/1.0.4:
7974   - resolution: {integrity: sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=}
  7974 + resolution: {integrity: sha512-PhmXi5XmoyKw1Un4E+opM2KcsJInDvKyuOumcjjw3waw86ZNjHwVUOOWLc4bCzLdcKNaWBH9e99sbWzDQsVaYg==}
7975 7975 engines: {node: '>=0.10.0'}
7976 7976 dev: true
7977 7977  
7978 7978 /prepend-http/2.0.0:
7979   - resolution: {integrity: sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=}
  7979 + resolution: {integrity: sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA==}
7980 7980 engines: {node: '>=4'}
7981 7981 dev: true
7982 7982  
... ... @@ -8007,7 +8007,7 @@ packages:
8007 8007 dev: true
8008 8008  
8009 8009 /proto-list/1.2.4:
8010   - resolution: {integrity: sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=}
  8010 + resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==}
8011 8011 dev: true
8012 8012  
8013 8013 /prr/1.0.1:
... ... @@ -8016,7 +8016,7 @@ packages:
8016 8016 optional: true
8017 8017  
8018 8018 /pseudomap/1.0.2:
8019   - resolution: {integrity: sha1-8FKijacOYYkX7wqKw0wa5aaChrM=}
  8019 + resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==}
8020 8020 dev: true
8021 8021  
8022 8022 /pug-error/2.0.0:
... ... @@ -8351,7 +8351,7 @@ packages:
8351 8351 dev: true
8352 8352  
8353 8353 /responselike/1.0.2:
8354   - resolution: {integrity: sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=}
  8354 + resolution: {integrity: sha512-/Fpe5guzJk1gPqdJLJR5u7eG/gNY4nImjbRDaVWVMRhne55TCmj2i9Q+54PBRfatRC8v/rIiv9BN0pMd9OV5EQ==}
8355 8355 dependencies:
8356 8356 lowercase-keys: 1.0.1
8357 8357 dev: true
... ... @@ -8511,7 +8511,7 @@ packages:
8511 8511 dev: true
8512 8512  
8513 8513 /semver-truncate/1.1.2:
8514   - resolution: {integrity: sha1-V/Qd5pcHpicJp+AQS6IRcQnqR+g=}
  8514 + resolution: {integrity: sha512-V1fGg9i4CL3qesB6U0L6XAm4xOJiHmt4QAacazumuasc03BvtFGIMCduv01JWQ69Nv+JST9TqhSCiJoxoY031w==}
8515 8515 engines: {node: '>=0.10.0'}
8516 8516 dependencies:
8517 8517 semver: 5.7.1
... ... @@ -8695,21 +8695,21 @@ packages:
8695 8695 dev: true
8696 8696  
8697 8697 /sort-keys-length/1.0.1:
8698   - resolution: {integrity: sha1-nLb09OnkgVWmqgZx7dM2/xR5oYg=}
  8698 + resolution: {integrity: sha512-GRbEOUqCxemTAk/b32F2xa8wDTs+Z1QHOkbhJDQTvv/6G3ZkbJ+frYWsTcc7cBB3Fu4wy4XlLCuNtJuMn7Gsvw==}
8699 8699 engines: {node: '>=0.10.0'}
8700 8700 dependencies:
8701 8701 sort-keys: 1.1.2
8702 8702 dev: true
8703 8703  
8704 8704 /sort-keys/1.1.2:
8705   - resolution: {integrity: sha1-RBttTTRnmPG05J6JIK37oOVD+a0=}
  8705 + resolution: {integrity: sha512-vzn8aSqKgytVik0iwdBEi+zevbTYZogewTUM6dtpmGwEcdzbub/TX4bCzRhebDCRC3QzXgJsLRKB2V/Oof7HXg==}
8706 8706 engines: {node: '>=0.10.0'}
8707 8707 dependencies:
8708 8708 is-plain-obj: 1.1.0
8709 8709 dev: true
8710 8710  
8711 8711 /sort-keys/2.0.0:
8712   - resolution: {integrity: sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=}
  8712 + resolution: {integrity: sha512-/dPCrG1s3ePpWm6yBbxZq5Be1dXGLyLn9Z791chDC3NFrpkVbWGzkBwPN1knaciexFXgRJ7hzdnwZ4stHSDmjg==}
8713 8713 engines: {node: '>=4'}
8714 8714 dependencies:
8715 8715 is-plain-obj: 1.1.0
... ... @@ -9053,7 +9053,7 @@ packages:
9053 9053 resolution: {integrity: sha1-eVjHk+R+MuB9K1yv5cC/jhLneQI=}
9054 9054 dev: true
9055 9055  
9056   - /stylelint-config-html/1.0.0_dkblcabdfo7hanxmbj6kpjf26q:
  9056 + /stylelint-config-html/1.0.0_1a82b100232bbe7036ec0a7ca7a4baf4:
9057 9057 resolution: {integrity: sha512-rKQUUWDpaYC7ybsS6tLxddjn6DxhjSIXybElSmcTyVQj3ExhmU3q+l41ktrlwHRyY0M5SkTkZiwngvYPYmsgSQ==}
9058 9058 engines: {node: ^12 || >=14}
9059 9059 peerDependencies:
... ... @@ -9074,7 +9074,7 @@ packages:
9074 9074 stylelint: 14.7.1
9075 9075 dev: true
9076 9076  
9077   - /stylelint-config-recommended-vue/1.4.0_dkblcabdfo7hanxmbj6kpjf26q:
  9077 + /stylelint-config-recommended-vue/1.4.0_1a82b100232bbe7036ec0a7ca7a4baf4:
9078 9078 resolution: {integrity: sha512-DVJqyX2KvMCn9U0+keL12r7xlsH26K4Vg8NrIZuq5MoF7g82DpMp326Om4E0Q+Il1o+bTHuUyejf2XAI0iD04Q==}
9079 9079 engines: {node: ^12 || >=14}
9080 9080 peerDependencies:
... ... @@ -9084,7 +9084,7 @@ packages:
9084 9084 postcss-html: 1.4.1
9085 9085 semver: 7.3.7
9086 9086 stylelint: 14.7.1
9087   - stylelint-config-html: 1.0.0_dkblcabdfo7hanxmbj6kpjf26q
  9087 + stylelint-config-html: 1.0.0_1a82b100232bbe7036ec0a7ca7a4baf4
9088 9088 stylelint-config-recommended: 7.0.0_stylelint@14.7.1
9089 9089 dev: true
9090 9090  
... ... @@ -9347,7 +9347,7 @@ packages:
9347 9347 dev: true
9348 9348  
9349 9349 /timed-out/4.0.1:
9350   - resolution: {integrity: sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=}
  9350 + resolution: {integrity: sha512-G7r3AhovYtr5YKOWQkta8RKAPb+J9IsO4uVmzjl8AZwfhs8UcUwTiD6gcJYSgOtzyjvQKrKYn41syHbUWMkafA==}
9351 9351 engines: {node: '>=0.10.0'}
9352 9352 dev: true
9353 9353  
... ... @@ -9436,13 +9436,13 @@ packages:
9436 9436 dev: true
9437 9437  
9438 9438 /trim-repeated/1.0.0:
9439   - resolution: {integrity: sha1-42RqLqTokTEr9+rObPsFOAvAHCE=}
  9439 + resolution: {integrity: sha512-pkonvlKk8/ZuR0D5tLW8ljt5I8kmxp2XKymhepUeOdCEfKpZaktSArkLHZt76OB1ZvO9bssUsDty4SWhLvZpLg==}
9440 9440 engines: {node: '>=0.10.0'}
9441 9441 dependencies:
9442 9442 escape-string-regexp: 1.0.5
9443 9443 dev: true
9444 9444  
9445   - /ts-node/10.7.0_3z6inmgn4ud4moqealnfxgbl2m:
  9445 + /ts-node/10.7.0_de7c86b0cde507c63a0402da5b982bd3:
9446 9446 resolution: {integrity: sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==}
9447 9447 hasBin: true
9448 9448 peerDependencies:
... ... @@ -9496,7 +9496,7 @@ packages:
9496 9496 dev: true
9497 9497  
9498 9498 /tunnel-agent/0.6.0:
9499   - resolution: {integrity: sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=}
  9499 + resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==}
9500 9500 dependencies:
9501 9501 safe-buffer: 5.2.1
9502 9502 dev: true
... ... @@ -9681,14 +9681,14 @@ packages:
9681 9681 dev: true
9682 9682  
9683 9683 /url-parse-lax/3.0.0:
9684   - resolution: {integrity: sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=}
  9684 + resolution: {integrity: sha512-NjFKA0DidqPa5ciFcSrXnAltTtzz84ogy+NebPvfEgAck0+TNg4UJ4IN+fB7zRZfbgUf0syOo9MDxFkDSMuFaQ==}
9685 9685 engines: {node: '>=4'}
9686 9686 dependencies:
9687 9687 prepend-http: 2.0.0
9688 9688 dev: true
9689 9689  
9690 9690 /url-to-options/1.0.1:
9691   - resolution: {integrity: sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=}
  9691 + resolution: {integrity: sha512-0kQLIzG4fdk/G5NONku64rSH/x32NOA39LVQqlK8Le6lvTF6GGRJpqaQFGgU+CLwySIqBSMdwYM0sYcW9f6P4A==}
9692 9692 engines: {node: '>= 4'}
9693 9693 dev: true
9694 9694  
... ... @@ -9816,7 +9816,7 @@ packages:
9816 9816 - supports-color
9817 9817 dev: true
9818 9818  
9819   - /vite-plugin-mock/2.9.6_qiwm6q27tfokd2mntem6ma7w4y:
  9819 + /vite-plugin-mock/2.9.6_822ccf435f995ca1e98d9919e603f6e6:
9820 9820 resolution: {integrity: sha512-/Rm59oPppe/ncbkSrUuAxIQihlI2YcBmnbR4ST1RA2VzM1C0tEQc1KlbQvnUGhXECAGTaQN2JyasiwXP6EtKgg==}
9821 9821 engines: {node: '>=12.0.0'}
9822 9822 peerDependencies:
... ... @@ -10202,7 +10202,7 @@ packages:
10202 10202 '@babel/core': 7.17.9
10203 10203 '@babel/preset-env': 7.16.11_@babel+core@7.17.9
10204 10204 '@babel/runtime': 7.17.9
10205   - '@rollup/plugin-babel': 5.3.1_6m6vi5xreq5wlqqwvo3xvcrttm
  10205 + '@rollup/plugin-babel': 5.3.1_@babel+core@7.17.9+rollup@2.70.2
10206 10206 '@rollup/plugin-node-resolve': 11.2.1_rollup@2.70.2
10207 10207 '@rollup/plugin-replace': 2.4.2_rollup@2.70.2
10208 10208 '@surma/rollup-plugin-off-main-thread': 2.2.3
... ... @@ -10385,7 +10385,7 @@ packages:
10385 10385 dev: true
10386 10386  
10387 10387 /yallist/2.1.2:
10388   - resolution: {integrity: sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=}
  10388 + resolution: {integrity: sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==}
10389 10389 dev: true
10390 10390  
10391 10391 /yallist/4.0.0:
... ... @@ -10459,7 +10459,7 @@ packages:
10459 10459 dev: true
10460 10460  
10461 10461 /yauzl/2.10.0:
10462   - resolution: {integrity: sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=}
  10462 + resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==}
10463 10463 dependencies:
10464 10464 buffer-crc32: 0.2.13
10465 10465 fd-slicer: 1.1.0
... ...
src/enums/appEnum.ts
... ... @@ -30,14 +30,18 @@ export enum SessionTimeoutProcessingEnum {
30 30 */
31 31 export enum PermissionModeEnum {
32 32 // role
  33 + // 角色权限
33 34 ROLE = 'ROLE',
34 35 // black
  36 + // 后端
35 37 BACK = 'BACK',
36 38 // route mapping
  39 + // 路由映射
37 40 ROUTE_MAPPING = 'ROUTE_MAPPING',
38 41 }
39 42  
40   -// Route switching animation
  43 +// Route switching animation
  44 +// 路由切换动画
41 45 export enum RouterTransitionEnum {
42 46 ZOOM_FADE = 'zoom-fade',
43 47 ZOOM_OUT = 'zoom-out',
... ...
src/hooks/web/usePermission.ts
... ... @@ -39,6 +39,7 @@ export function usePermission() {
39 39  
40 40 /**
41 41 * Reset and regain authority resource information
  42 + * 重置和重新获得权限资源信息
42 43 * @param id
43 44 */
44 45 async function resume() {
... ...
src/router/helper/menuHelper.ts
... ... @@ -11,14 +11,18 @@ export function getAllParentPath<T = Recordable>(treeData: T[], path: string) {
11 11 return (menuList || []).map((item) => item.path);
12 12 }
13 13  
  14 +// 路径处理
14 15 function joinParentPath(menus: Menu[], parentPath = '') {
15 16 for (let index = 0; index < menus.length; index++) {
16 17 const menu = menus[index];
17 18 // https://next.router.vuejs.org/guide/essentials/nested-routes.html
18 19 // Note that nested paths that start with / will be treated as a root path.
  20 + // 请注意,以 / 开头的嵌套路径将被视为根路径。
19 21 // This allows you to leverage the component nesting without having to use a nested URL.
  22 + // 这允许你利用组件嵌套,而无需使用嵌套 URL。
20 23 if (!(menu.path.startsWith('/') || isUrl(menu.path))) {
21 24 // path doesn't start with /, nor is it a url, join parent path
  25 + // 路径不以 / 开头,也不是 url,加入父路径
22 26 menu.path = `${parentPath}/${menu.path}`;
23 27 }
24 28 if (menu?.children?.length) {
... ... @@ -37,14 +41,18 @@ export function transformMenuModule(menuModule: MenuModule): Menu {
37 41 return menuList[0];
38 42 }
39 43  
  44 +// 将路由转换成菜单
40 45 export function transformRouteToMenu(routeModList: AppRouteModule[], routerMapping = false) {
  46 + // 借助 lodash 深拷贝
41 47 const cloneRouteModList = cloneDeep(routeModList);
42 48 const routeList: AppRouteRecordRaw[] = [];
43 49  
  50 + // 对路由项进行修改
44 51 cloneRouteModList.forEach((item) => {
45 52 if (routerMapping && item.meta.hideChildrenInMenu && typeof item.redirect === 'string') {
46 53 item.path = item.redirect;
47 54 }
  55 +
48 56 if (item.meta?.single) {
49 57 const realItem = item?.children?.[0];
50 58 realItem && routeList.push(realItem);
... ... @@ -52,6 +60,7 @@ export function transformRouteToMenu(routeModList: AppRouteModule[], routerMappi
52 60 routeList.push(item);
53 61 }
54 62 });
  63 + // 提取树指定结构
55 64 const list = treeMap(routeList, {
56 65 conversion: (node: AppRouteRecordRaw) => {
57 66 const { meta: { title, hideMenu = false } = {} } = node;
... ... @@ -66,6 +75,7 @@ export function transformRouteToMenu(routeModList: AppRouteModule[], routerMappi
66 75 };
67 76 },
68 77 });
  78 + // 路径处理
69 79 joinParentPath(list);
70 80 return cloneDeep(list);
71 81 }
... ... @@ -74,6 +84,7 @@ export function transformRouteToMenu(routeModList: AppRouteModule[], routerMappi
74 84 * config menu with given params
75 85 */
76 86 const menuParamRegex = /(?::)([\s\S]+?)((?=\/)|$)/g;
  87 +
77 88 export function configureDynamicParamsMenu(menu: Menu, params: RouteParams) {
78 89 const { path, paramPath } = toRaw(menu);
79 90 let realPath = paramPath ? paramPath : path;
... ...
src/router/helper/routeHelper.ts
... ... @@ -68,6 +68,7 @@ function dynamicImport(
68 68 }
69 69  
70 70 // Turn background objects into routing objects
  71 +// 将背景对象变成路由对象
71 72 export function transformObjToRoute<T = AppRouteModule>(routeList: AppRouteModule[]): T[] {
72 73 routeList.forEach((route) => {
73 74 const component = route.component as string;
... ... @@ -94,35 +95,46 @@ export function transformObjToRoute&lt;T = AppRouteModule&gt;(routeList: AppRouteModul
94 95  
95 96 /**
96 97 * Convert multi-level routing to level 2 routing
  98 + * 将多级路由转换为 2 级路由
97 99 */
98 100 export function flatMultiLevelRoutes(routeModules: AppRouteModule[]) {
99 101 const modules: AppRouteModule[] = cloneDeep(routeModules);
  102 +
100 103 for (let index = 0; index < modules.length; index++) {
101 104 const routeModule = modules[index];
  105 + // 判断级别是否 多级 路由
102 106 if (!isMultipleRoute(routeModule)) {
  107 + // 声明终止当前循环, 即跳过此次循环,进行下一轮
103 108 continue;
104 109 }
  110 + // 路由等级提升
105 111 promoteRouteLevel(routeModule);
106 112 }
107 113 return modules;
108 114 }
109 115  
110 116 // Routing level upgrade
  117 +// 路由等级提升
111 118 function promoteRouteLevel(routeModule: AppRouteModule) {
112 119 // Use vue-router to splice menus
  120 + // 使用vue-router拼接菜单
  121 + // createRouter 创建一个可以被 Vue 应用程序使用的路由实例
113 122 let router: Router | null = createRouter({
114 123 routes: [routeModule as unknown as RouteRecordNormalized],
115 124 history: createWebHashHistory(),
116 125 });
117   -
  126 + // getRoutes: 获取所有 路由记录的完整列表。
118 127 const routes = router.getRoutes();
  128 + // 将所有子路由添加到二级路由
119 129 addToChildren(routes, routeModule.children || [], routeModule);
120 130 router = null;
121 131  
  132 + // omit lodash的函数 对传入的item对象的children进行删除
122 133 routeModule.children = routeModule.children?.map((item) => omit(item, 'children'));
123 134 }
124 135  
125 136 // Add all sub-routes to the secondary route
  137 +// 将所有子路由添加到二级路由
126 138 function addToChildren(
127 139 routes: RouteRecordNormalized[],
128 140 children: AppRouteRecordRaw[],
... ... @@ -145,7 +157,9 @@ function addToChildren(
145 157 }
146 158  
147 159 // Determine whether the level exceeds 2 levels
  160 +// 判断级别是否超过2级
148 161 function isMultipleRoute(routeModule: AppRouteModule) {
  162 + // Reflect.has 与 in 操作符 相同, 用于检查一个对象(包括它原型链上)是否拥有某个属性
149 163 if (!routeModule || !Reflect.has(routeModule, 'children') || !routeModule.children?.length) {
150 164 return false;
151 165 }
... ...
src/router/index.ts
... ... @@ -36,6 +36,7 @@ export function resetRouter() {
36 36 }
37 37  
38 38 // config router
  39 +// 配置路由器
39 40 export function setupRouter(app: App<Element>) {
40 41 app.use(router);
41 42 }
... ...
src/router/routes/index.ts
... ... @@ -6,10 +6,11 @@ import { mainOutRoutes } from &#39;./mainOut&#39;;
6 6 import { PageEnum } from '/@/enums/pageEnum';
7 7 import { t } from '/@/hooks/web/useI18n';
8 8  
  9 +// import.meta.globEager() 直接引入所有的模块 Vite 独有的功能
9 10 const modules = import.meta.globEager('./modules/**/*.ts');
10   -
11 11 const routeModuleList: AppRouteModule[] = [];
12 12  
  13 +// 加入到路由集合中
13 14 Object.keys(modules).forEach((key) => {
14 15 const mod = modules[key].default || {};
15 16 const modList = Array.isArray(mod) ? [...mod] : [mod];
... ... @@ -18,6 +19,7 @@ Object.keys(modules).forEach((key) =&gt; {
18 19  
19 20 export const asyncRoutes = [PAGE_NOT_FOUND_ROUTE, ...routeModuleList];
20 21  
  22 +// 根路由
21 23 export const RootRoute: AppRouteRecordRaw = {
22 24 path: '/',
23 25 name: 'Root',
... ...
src/store/modules/permission.ts
... ... @@ -26,26 +26,37 @@ import { PageEnum } from &#39;/@/enums/pageEnum&#39;;
26 26  
27 27 interface PermissionState {
28 28 // Permission code list
  29 + // 权限代码列表
29 30 permCodeList: string[] | number[];
30 31 // Whether the route has been dynamically added
  32 + // 路由是否动态添加
31 33 isDynamicAddedRoute: boolean;
32 34 // To trigger a menu update
  35 + // 触发菜单更新
33 36 lastBuildMenuTime: number;
34 37 // Backstage menu list
  38 + // 后台菜单列表
35 39 backMenuList: Menu[];
  40 + // 菜单列表
36 41 frontMenuList: Menu[];
37 42 }
  43 +
38 44 export const usePermissionStore = defineStore({
39 45 id: 'app-permission',
40 46 state: (): PermissionState => ({
  47 + // 权限代码列表
41 48 permCodeList: [],
42 49 // Whether the route has been dynamically added
  50 + // 路由是否动态添加
43 51 isDynamicAddedRoute: false,
44 52 // To trigger a menu update
  53 + // 触发菜单更新
45 54 lastBuildMenuTime: 0,
46 55 // Backstage menu list
  56 + // 后台菜单列表
47 57 backMenuList: [],
48 58 // menu List
  59 + // 菜单列表
49 60 frontMenuList: [],
50 61 }),
51 62 getters: {
... ... @@ -96,6 +107,8 @@ export const usePermissionStore = defineStore({
96 107 const codeList = await getPermCode();
97 108 this.setPermCodeList(codeList);
98 109 },
  110 +
  111 + // 构建路由
99 112 async buildRoutesAction(): Promise<AppRouteRecordRaw[]> {
100 113 const { t } = useI18n();
101 114 const userStore = useUserStore();
... ... @@ -105,16 +118,21 @@ export const usePermissionStore = defineStore({
105 118 const roleList = toRaw(userStore.getRoleList) || [];
106 119 const { permissionMode = projectSetting.permissionMode } = appStore.getProjectConfig;
107 120  
  121 + // 路由过滤器 在 函数filter 作为回调传入遍历使用
108 122 const routeFilter = (route: AppRouteRecordRaw) => {
109 123 const { meta } = route;
  124 + // 抽出角色
110 125 const { roles } = meta || {};
111 126 if (!roles) return true;
  127 + // 进行角色权限判断
112 128 return roleList.some((role) => roles.includes(role));
113 129 };
114 130  
115 131 const routeRemoveIgnoreFilter = (route: AppRouteRecordRaw) => {
116 132 const { meta } = route;
  133 + // ignoreRoute 为true 则路由仅用于菜单生成,不会在实际的路由表中出现
117 134 const { ignoreRoute } = meta || {};
  135 + // arr.filter 返回 true 表示该元素通过测试
118 136 return !ignoreRoute;
119 137 };
120 138  
... ... @@ -124,6 +142,7 @@ export const usePermissionStore = defineStore({
124 142 const patchHomeAffix = (routes: AppRouteRecordRaw[]) => {
125 143 if (!routes || routes.length === 0) return;
126 144 let homePath: string = userStore.getUserInfo.homePath || PageEnum.BASE_HOME;
  145 +
127 146 function patcher(routes: AppRouteRecordRaw[], parentPath = '') {
128 147 if (parentPath) parentPath = parentPath + '/';
129 148 routes.forEach((route: AppRouteRecordRaw) => {
... ... @@ -140,6 +159,7 @@ export const usePermissionStore = defineStore({
140 159 children && children.length > 0 && patcher(children, currentPath);
141 160 });
142 161 }
  162 +
143 163 try {
144 164 patcher(routes);
145 165 } catch (e) {
... ... @@ -149,29 +169,44 @@ export const usePermissionStore = defineStore({
149 169 };
150 170  
151 171 switch (permissionMode) {
  172 + // 角色权限
152 173 case PermissionModeEnum.ROLE:
  174 + // 对非一级路由进行过滤
153 175 routes = filter(asyncRoutes, routeFilter);
  176 + // 对一级路由根据角色权限过滤
154 177 routes = routes.filter(routeFilter);
155 178 // Convert multi-level routing to level 2 routing
  179 + // 将多级路由转换为 2 级路由
156 180 routes = flatMultiLevelRoutes(routes);
157 181 break;
158 182  
  183 + // 路由映射, 默认进入该case
159 184 case PermissionModeEnum.ROUTE_MAPPING:
  185 + // 对非一级路由进行过滤
160 186 routes = filter(asyncRoutes, routeFilter);
  187 + // 对一级路由再次根据角色权限过滤
161 188 routes = routes.filter(routeFilter);
  189 + // 将路由转换成菜单
162 190 const menuList = transformRouteToMenu(routes, true);
  191 + // 移除掉 ignoreRoute: true 的路由 非一级路由
163 192 routes = filter(routes, routeRemoveIgnoreFilter);
  193 + // 移除掉 ignoreRoute: true 的路由 一级路由;
164 194 routes = routes.filter(routeRemoveIgnoreFilter);
  195 + // 对菜单进行排序
165 196 menuList.sort((a, b) => {
166 197 return (a.meta?.orderNo || 0) - (b.meta?.orderNo || 0);
167 198 });
168 199  
  200 + // 设置菜单列表
169 201 this.setFrontMenuList(menuList);
  202 +
170 203 // Convert multi-level routing to level 2 routing
  204 + // 将多级路由转换为 2 级路由
171 205 routes = flatMultiLevelRoutes(routes);
172 206 break;
173 207  
174 208 // If you are sure that you do not need to do background dynamic permissions, please comment the entire judgment below
  209 + // 如果确定不需要做后台动态权限,请在下方评论整个判断
175 210 case PermissionModeEnum.BACK:
176 211 const { createMessage } = useMessage();
177 212  
... ... @@ -181,23 +216,28 @@ export const usePermissionStore = defineStore({
181 216 });
182 217  
183 218 // !Simulate to obtain permission codes from the background,
  219 + // 模拟从后台获取权限码,
184 220 // this function may only need to be executed once, and the actual project can be put at the right time by itself
  221 + // 这个功能可能只需要执行一次,实际项目可以自己放在合适的时间
185 222 let routeList: AppRouteRecordRaw[] = [];
186 223 try {
187   - this.changePermissionCode();
  224 + await this.changePermissionCode();
188 225 routeList = (await getMenuList()) as AppRouteRecordRaw[];
189 226 } catch (error) {
190 227 console.error(error);
191 228 }
192 229  
193 230 // Dynamically introduce components
  231 + // 动态引入组件
194 232 routeList = transformObjToRoute(routeList);
195 233  
196 234 // Background routing to menu structure
  235 + // 后台路由到菜单结构
197 236 const backMenuList = transformRouteToMenu(routeList);
198 237 this.setBackMenuList(backMenuList);
199 238  
200 239 // remove meta.ignoreRoute item
  240 + // 删除 meta.ignoreRoute 项
201 241 routeList = filter(routeList, routeRemoveIgnoreFilter);
202 242 routeList = routeList.filter(routeRemoveIgnoreFilter);
203 243  
... ... @@ -214,6 +254,7 @@ export const usePermissionStore = defineStore({
214 254 });
215 255  
216 256 // Need to be used outside the setup
  257 +// 需要在设置之外使用
217 258 export function usePermissionStoreWithOut() {
218 259 return usePermissionStore(store);
219 260 }
... ...
src/utils/helper/treeHelper.ts
... ... @@ -3,15 +3,19 @@ interface TreeHelperConfig {
3 3 children: string;
4 4 pid: string;
5 5 }
  6 +
  7 +// 默认配置
6 8 const DEFAULT_CONFIG: TreeHelperConfig = {
7 9 id: 'id',
8 10 children: 'children',
9 11 pid: 'pid',
10 12 };
11 13  
  14 +// 获取配置。 Object.assign 从一个或多个源对象复制到目标对象
12 15 const getConfig = (config: Partial<TreeHelperConfig>) => Object.assign({}, DEFAULT_CONFIG, config);
13 16  
14 17 // tree from list
  18 +// 列表中的树
15 19 export function listToTree<T = any>(list: any[], config: Partial<TreeHelperConfig> = {}): T[] {
16 20 const conf = getConfig(config) as TreeHelperConfig;
17 21 const nodeMap = new Map();
... ... @@ -123,18 +127,24 @@ export function findPathAll(tree: any, func: Fn, config: Partial&lt;TreeHelperConfi
123 127 export function filter<T = any>(
124 128 tree: T[],
125 129 func: (n: T) => boolean,
  130 + // Partial 将 T 中的所有属性设为可选
126 131 config: Partial<TreeHelperConfig> = {},
127 132 ): T[] {
  133 + // 获取配置
128 134 config = getConfig(config);
129 135 const children = config.children as string;
  136 +
130 137 function listFilter(list: T[]) {
131 138 return list
132 139 .map((node: any) => ({ ...node }))
133 140 .filter((node) => {
  141 + // 递归调用 对含有children项 进行再次调用自身函数 listFilter
134 142 node[children] = node[children] && listFilter(node[children]);
  143 + // 执行传入的回调 func 进行过滤
135 144 return func(node) || (node[children] && node[children].length);
136 145 });
137 146 }
  147 +
138 148 return listFilter(tree);
139 149 }
140 150  
... ... @@ -157,6 +167,7 @@ export function forEach&lt;T = any&gt;(
157 167  
158 168 /**
159 169 * @description: Extract tree specified structure
  170 + * @description: 提取树指定结构
160 171 */
161 172 export function treeMap<T = any>(treeData: T[], opt: { children?: string; conversion: Fn }): T[] {
162 173 return treeData.map((item) => treeMapEach(item, opt));
... ... @@ -164,6 +175,7 @@ export function treeMap&lt;T = any&gt;(treeData: T[], opt: { children?: string; conver
164 175  
165 176 /**
166 177 * @description: Extract tree specified structure
  178 + * @description: 提取树指定结构
167 179 */
168 180 export function treeMapEach(
169 181 data: any,
... ...
src/utils/http/axios/Axios.ts
... ... @@ -61,7 +61,7 @@ export class VAxios {
61 61 }
62 62  
63 63 /**
64   - * @description: Interceptor configuration
  64 + * @description: Interceptor configuration 拦截器配置
65 65 */
66 66 private setupInterceptors() {
67 67 const transform = this.getTransform();
... ...
src/utils/http/axios/index.ts
... ... @@ -204,6 +204,7 @@ const transform: AxiosTransform = {
204 204  
205 205 function createAxios(opt?: Partial<CreateAxiosOptions>) {
206 206 return new VAxios(
  207 + // 深度合并
207 208 deepMerge(
208 209 {
209 210 // See https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication#authentication_schemes
... ...
src/utils/index.ts
... ... @@ -32,6 +32,7 @@ export function setObjToUrlParams(baseUrl: string, obj: any): string {
32 32 return /\?$/.test(baseUrl) ? baseUrl + parameters : baseUrl.replace(/\/?$/, '?') + parameters;
33 33 }
34 34  
  35 +// 深度合并
35 36 export function deepMerge<T = any>(src: any = {}, target: any = {}): T {
36 37 let key: string;
37 38 for (key in target) {
... ...