接入rabc
This commit is contained in:
parent
067a3938c5
commit
25289fac57
@ -1,50 +0,0 @@
|
||||
# SimpleAdmin API 接口导入说明
|
||||
|
||||
## 当前状态
|
||||
已准备好 SimpleAdmin API 的配置,但需要确认正确的 swagger.json 路径。
|
||||
|
||||
## 如何找到正确的 swagger.json 路径
|
||||
|
||||
1. **访问 Swagger UI 页面**
|
||||
- 打开浏览器访问:`http://43.139.210.35:5566/index.html`
|
||||
|
||||
2. **查找 swagger.json 路径的方法:**
|
||||
|
||||
**方法一:查看页面源代码**
|
||||
- 在 Swagger UI 页面按 `F12` 打开开发者工具
|
||||
- 查看 `Network` 标签页
|
||||
- 刷新页面,查找以 `swagger.json` 结尾的请求
|
||||
- 记录完整的 URL 路径
|
||||
|
||||
**方法二:查看 Swagger UI 配置**
|
||||
- 在页面源代码中搜索 `url:` 或 `swagger.json`
|
||||
- 找到类似这样的配置:
|
||||
```javascript
|
||||
url: "/swagger/v1/swagger.json"
|
||||
```
|
||||
|
||||
**方法三:尝试常见路径**
|
||||
- 直接访问以下路径,看哪个能返回 JSON:
|
||||
- `http://43.139.210.35:5566/swagger/v1/swagger.json`
|
||||
- `http://43.139.210.35:5566/swagger.json`
|
||||
- `http://43.139.210.35:5566/api/swagger.json`
|
||||
|
||||
3. **更新配置**
|
||||
- 找到正确的路径后,编辑 `openapi2ts.config.ts` 文件
|
||||
- 取消注释 SimpleAdmin 配置部分
|
||||
- 将 `schemaPath` 更新为正确的路径
|
||||
|
||||
4. **生成接口文件**
|
||||
```bash
|
||||
npm run openapi2ts
|
||||
```
|
||||
|
||||
## 生成的接口文件位置
|
||||
接口文件将生成在:`src/api/SimpleAdmin/` 目录下
|
||||
|
||||
## 后续步骤
|
||||
接口导入成功后,可以:
|
||||
1. 参考 SimpleAdmin 项目的代码结构实现登录功能
|
||||
2. 实现权限管理页面
|
||||
3. 实现组织架构管理页面
|
||||
|
||||
6
entry_config.json
Normal file
6
entry_config.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"rule_path": "C:/Users/samk/Desktop/清关软件调试数据/规则表(4).xlsx",
|
||||
"order_min": 1,
|
||||
"order_max": 998,
|
||||
"channel": "美国专线小包带电,美国专线小包特货A"
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name 10.1.20.6;
|
||||
|
||||
server_name 10.1.20.6;
|
||||
|
||||
# 启用gzip压缩
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
@ -9,122 +9,102 @@ server {
|
||||
gzip_types text/plain text/css text/xml text/javascript application/javascript application/xml+rss application/json application/xml image/svg+xml;
|
||||
gzip_comp_level 6;
|
||||
gzip_disable "msie6";
|
||||
|
||||
# 启用brotli压缩(如果nginx支持)
|
||||
# brotli on;
|
||||
# brotli_comp_level 6;
|
||||
# brotli_types text/plain text/css text/xml text/javascript application/javascript application/xml+rss application/json application/xml image/svg+xml;
|
||||
|
||||
# HTML文件 - 不缓存,确保用户总是获取最新版本
|
||||
location ~* \.(html|htm)$ {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
try_files $uri $uri/ /index.html =404;
|
||||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||
add_header Pragma "no-cache";
|
||||
add_header Expires "0";
|
||||
|
||||
# 静态文件根目录
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
# ============ API 代理配置(放在最前面,使用 ^~ 提高优先级)============
|
||||
|
||||
# RBAC 权限管理服务代理
|
||||
location ^~ /rbac {
|
||||
proxy_pass http://43.139.210.35:5281;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
proxy_connect_timeout 30s;
|
||||
proxy_send_timeout 30s;
|
||||
proxy_read_timeout 30s;
|
||||
proxy_buffering off;
|
||||
}
|
||||
|
||||
# 前端静态文件根路径 - 用于SPA路由
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
try_files $uri $uri/ /index.html =404;
|
||||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||
add_header Pragma "no-cache";
|
||||
add_header Expires "0";
|
||||
|
||||
# trackApi 服务代理
|
||||
location ^~ /api/trackApi {
|
||||
rewrite ^/api/trackApi(.*)$ $1 break;
|
||||
proxy_pass http://43.139.210.35:8889;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_connect_timeout 30s;
|
||||
proxy_send_timeout 30s;
|
||||
proxy_read_timeout 30s;
|
||||
}
|
||||
|
||||
# 带hash的JS/CSS文件 - 长期缓存(1年),因为hash变化时文件名会变化
|
||||
location ~* \.(js|css)$ {
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
# 其他 API 请求代理
|
||||
location ^~ /api {
|
||||
rewrite ^/api(.*)$ $1 break;
|
||||
proxy_pass http://43.139.210.35:8888;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_connect_timeout 30s;
|
||||
proxy_send_timeout 30s;
|
||||
proxy_read_timeout 30s;
|
||||
}
|
||||
|
||||
# ============ 静态资源缓存配置 ============
|
||||
|
||||
# 带hash的JS/CSS文件 - 长期缓存
|
||||
location ~* \.(?:js|css)$ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
access_log off;
|
||||
}
|
||||
|
||||
# 图片资源 - 长期缓存(1年)
|
||||
location ~* \.(jpg|jpeg|png|gif|ico|svg|webp|avif)$ {
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
# 图片资源 - 长期缓存
|
||||
location ~* \.(?:jpg|jpeg|png|gif|ico|svg|webp|avif)$ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
access_log off;
|
||||
}
|
||||
|
||||
# 字体文件 - 长期缓存(1年)
|
||||
location ~* \.(woff|woff2|ttf|eot|otf)$ {
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
# 字体文件 - 长期缓存
|
||||
location ~* \.(?:woff2?|ttf|eot|otf)$ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
access_log off;
|
||||
}
|
||||
|
||||
# 其他静态资源 - 缓存1个月
|
||||
location ~* \.(pdf|zip|tar|gz)$ {
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
# 其他静态资源
|
||||
location ~* \.(?:pdf|zip|tar|gz)$ {
|
||||
expires 1M;
|
||||
add_header Cache-Control "public";
|
||||
access_log off;
|
||||
}
|
||||
|
||||
# 代理配置 - 按优先级顺序,更具体的路径放在前面
|
||||
|
||||
# trackApi 服务代理 - http://43.139.210.35:8889
|
||||
location /api/trackApi {
|
||||
rewrite ^/api/trackApi(.*)$ $1 break;
|
||||
proxy_pass http://43.139.210.35:8889;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_connect_timeout 30s;
|
||||
proxy_send_timeout 30s;
|
||||
proxy_read_timeout 30s;
|
||||
}
|
||||
# ============ SPA 前端路由(放在最后)============
|
||||
|
||||
# SimpleAdmin 服务 - userCenter - http://43.139.210.35:5566
|
||||
location /api/userCenter {
|
||||
rewrite ^/api(.*)$ $1 break;
|
||||
proxy_pass http://43.139.210.35:5566;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_connect_timeout 30s;
|
||||
proxy_send_timeout 30s;
|
||||
proxy_read_timeout 30s;
|
||||
}
|
||||
|
||||
# SimpleAdmin 服务 - sys - http://43.139.210.35:5566
|
||||
location /api/sys {
|
||||
rewrite ^/api(.*)$ $1 break;
|
||||
proxy_pass http://43.139.210.35:5566;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_connect_timeout 30s;
|
||||
proxy_send_timeout 30s;
|
||||
proxy_read_timeout 30s;
|
||||
}
|
||||
|
||||
# 其他 API 请求代理到 8888 端口 - http://43.139.210.35:8888
|
||||
location /api {
|
||||
rewrite ^/api(.*)$ $1 break;
|
||||
proxy_pass http://43.139.210.35:8888;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_connect_timeout 30s;
|
||||
proxy_send_timeout 30s;
|
||||
proxy_read_timeout 30s;
|
||||
location / {
|
||||
index index.html;
|
||||
try_files $uri $uri/ /index.html;
|
||||
|
||||
# HTML 不缓存
|
||||
location ~* \.html?$ {
|
||||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||
add_header Pragma "no-cache";
|
||||
add_header Expires "0";
|
||||
}
|
||||
}
|
||||
|
||||
# 错误页面
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root html;
|
||||
root html;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -162,12 +162,4 @@ export default [
|
||||
projectName: 'interface-serviceProvider',
|
||||
apiPrefix: "'api'",
|
||||
},
|
||||
// 系统管理接口 (SimpleAdmin API)
|
||||
{
|
||||
schemaPath: 'http://43.139.210.35:5566/swagger/Default/swagger.json',
|
||||
serversPath: './src/api',
|
||||
requestLibPath: '@/utils/request',
|
||||
projectName: 'SimpleAdmin',
|
||||
apiPrefix: "'api'",
|
||||
},
|
||||
];
|
||||
|
||||
@ -44,6 +44,7 @@
|
||||
"diff": "^8.0.2",
|
||||
"echarts": "^5.4.0",
|
||||
"font-awesome": "^4.7.0",
|
||||
"form-data": "^4.0.5",
|
||||
"handsontable": "^16.2.0",
|
||||
"lodash": "^4.17.21",
|
||||
"lodash-es": "^4.17.21",
|
||||
|
||||
48
pnpm-lock.yaml
generated
48
pnpm-lock.yaml
generated
@ -45,6 +45,9 @@ importers:
|
||||
font-awesome:
|
||||
specifier: ^4.7.0
|
||||
version: 4.7.0
|
||||
form-data:
|
||||
specifier: ^4.0.5
|
||||
version: 4.0.5
|
||||
handsontable:
|
||||
specifier: ^16.2.0
|
||||
version: 16.2.0
|
||||
@ -1853,6 +1856,9 @@ packages:
|
||||
resolution: {integrity: sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
asynckit@0.4.0:
|
||||
resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
|
||||
|
||||
atob@2.1.2:
|
||||
resolution: {integrity: sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==}
|
||||
engines: {node: '>= 4.5.0'}
|
||||
@ -2158,6 +2164,10 @@ packages:
|
||||
colorjs.io@0.5.2:
|
||||
resolution: {integrity: sha512-twmVoizEW7ylZSN32OgKdXRmo1qg+wT5/6C3xu5b9QsWzSFAhHLn2xd8ro0diCsKfCj1RdaTP/nrcW+vAoQPIw==}
|
||||
|
||||
combined-stream@1.0.8:
|
||||
resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
|
||||
engines: {node: '>= 0.8'}
|
||||
|
||||
commander@11.0.0:
|
||||
resolution: {integrity: sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==}
|
||||
engines: {node: '>=16'}
|
||||
@ -2512,6 +2522,10 @@ packages:
|
||||
defu@6.1.4:
|
||||
resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==}
|
||||
|
||||
delayed-stream@1.0.0:
|
||||
resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
|
||||
engines: {node: '>=0.4.0'}
|
||||
|
||||
destr@2.0.5:
|
||||
resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==}
|
||||
|
||||
@ -3242,6 +3256,10 @@ packages:
|
||||
resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==}
|
||||
engines: {node: '>=14'}
|
||||
|
||||
form-data@4.0.5:
|
||||
resolution: {integrity: sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==}
|
||||
engines: {node: '>= 6'}
|
||||
|
||||
fragment-cache@0.2.1:
|
||||
resolution: {integrity: sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
@ -4374,10 +4392,18 @@ packages:
|
||||
resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==}
|
||||
engines: {node: '>=8.6'}
|
||||
|
||||
mime-db@1.52.0:
|
||||
resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}
|
||||
engines: {node: '>= 0.6'}
|
||||
|
||||
mime-db@1.54.0:
|
||||
resolution: {integrity: sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==}
|
||||
engines: {node: '>= 0.6'}
|
||||
|
||||
mime-types@2.1.35:
|
||||
resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}
|
||||
engines: {node: '>= 0.6'}
|
||||
|
||||
mime@1.6.0:
|
||||
resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==}
|
||||
engines: {node: '>=4'}
|
||||
@ -8422,6 +8448,8 @@ snapshots:
|
||||
|
||||
async-function@1.0.0: {}
|
||||
|
||||
asynckit@0.4.0: {}
|
||||
|
||||
atob@2.1.2: {}
|
||||
|
||||
autoprefixer@9.8.8:
|
||||
@ -8792,6 +8820,10 @@ snapshots:
|
||||
|
||||
colorjs.io@0.5.2: {}
|
||||
|
||||
combined-stream@1.0.8:
|
||||
dependencies:
|
||||
delayed-stream: 1.0.0
|
||||
|
||||
commander@11.0.0: {}
|
||||
|
||||
commander@14.0.0: {}
|
||||
@ -9132,6 +9164,8 @@ snapshots:
|
||||
|
||||
defu@6.1.4: {}
|
||||
|
||||
delayed-stream@1.0.0: {}
|
||||
|
||||
destr@2.0.5: {}
|
||||
|
||||
detect-browser@5.3.0: {}
|
||||
@ -10047,6 +10081,14 @@ snapshots:
|
||||
cross-spawn: 7.0.6
|
||||
signal-exit: 4.1.0
|
||||
|
||||
form-data@4.0.5:
|
||||
dependencies:
|
||||
asynckit: 0.4.0
|
||||
combined-stream: 1.0.8
|
||||
es-set-tostringtag: 2.1.0
|
||||
hasown: 2.0.2
|
||||
mime-types: 2.1.35
|
||||
|
||||
fragment-cache@0.2.1:
|
||||
dependencies:
|
||||
map-cache: 0.2.2
|
||||
@ -11246,8 +11288,14 @@ snapshots:
|
||||
braces: 3.0.3
|
||||
picomatch: 2.3.1
|
||||
|
||||
mime-db@1.52.0: {}
|
||||
|
||||
mime-db@1.54.0: {}
|
||||
|
||||
mime-types@2.1.35:
|
||||
dependencies:
|
||||
mime-db: 1.52.0
|
||||
|
||||
mime@1.6.0:
|
||||
optional: true
|
||||
|
||||
|
||||
@ -1,59 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 清空日志 POST /sys/audit/logVisit/delete */
|
||||
export async function sysAuditLogVisitDeletePost(
|
||||
body: API.VisitLogDeleteInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/audit/logVisit/delete`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 访问日志周统计折线图 GET /sys/audit/logVisit/lineChartData */
|
||||
export async function sysAuditLogVisitLineChartDataGet(options?: {
|
||||
[key: string]: any;
|
||||
}) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/audit/logVisit/lineChartData`,
|
||||
{
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 访问日志分页查询 GET /sys/audit/logVisit/page */
|
||||
export async function sysAuditLogVisitPageGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysAuditLogVisitPageGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/audit/logVisit/page`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 访问日志总览饼图 GET /sys/audit/logVisit/pieChartData */
|
||||
export async function sysAuditLogVisitPieChartDataGet(options?: {
|
||||
[key: string]: any;
|
||||
}) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/audit/logVisit/pieChartData`,
|
||||
{
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
@ -1,86 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 获取用户信息 GET /sys/auth/b/getLoginUser */
|
||||
export async function sysAuthBGetLoginUserGet(options?: {
|
||||
[key: string]: any;
|
||||
}) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/auth/b/getLoginUser`, {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** B端获取手机验证码 GET /sys/auth/b/getPhoneValidCode */
|
||||
export async function sysAuthBGetPhoneValidCodeGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysAuthBGetPhoneValidCodeGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/auth/b/getPhoneValidCode`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** B端获取图片验证码 GET /sys/auth/b/getPicCaptcha */
|
||||
export async function sysAuthBGetPicCaptchaGet(options?: {
|
||||
[key: string]: any;
|
||||
}) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/auth/b/getPicCaptcha`, {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** B端登录 POST /sys/auth/b/login */
|
||||
export async function sysAuthBLoginPost(
|
||||
body: API.LoginInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/auth/b/login`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** B端手机号登录 POST /sys/auth/b/loginByPhone */
|
||||
export async function sysAuthBLoginByPhonePost(
|
||||
body: API.LoginByPhoneInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/auth/b/loginByPhone`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 登出 POST /sys/auth/b/logout */
|
||||
export async function sysAuthBLogoutPost(
|
||||
body: API.LoginOutInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/auth/b/logout`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@ -1,116 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 添加批量 POST /sys/batch/add */
|
||||
export async function sysBatchAddPost(
|
||||
body: API.BatchEditAddInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/batch/add`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取批量配置信息 GET /sys/batch/columns */
|
||||
export async function sysBatchColumnsGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysBatchColumnsGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/batch/columns`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 配置修改批量 POST /sys/batch/config */
|
||||
export async function sysBatchConfigPost(
|
||||
body: API.BatchEditConfigInput[],
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/batch/config`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取批量配置信息 GET /sys/batch/configs */
|
||||
export async function sysBatchConfigsGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysBatchConfigsGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/batch/configs`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除批量 POST /sys/batch/delete */
|
||||
export async function sysBatchDeletePost(
|
||||
body: API.BaseIdListInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/batch/delete`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 批量分页查询 GET /sys/batch/page */
|
||||
export async function sysBatchPageGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysBatchPageGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/batch/page`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 批量更新同步 POST /sys/batch/sync */
|
||||
export async function sysBatchSyncPost(
|
||||
body: API.BaseIdInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/batch/sync`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取表信息 GET /sys/batch/tables */
|
||||
export async function sysBatchTablesGet(options?: { [key: string]: any }) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/batch/tables`, {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@ -1,142 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 添加代码生成器 POST /sys/curd/gen/basic/add */
|
||||
export async function sysCurdGenBasicAddPost(
|
||||
body: API.GenBasicAddInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/curd/gen/basic/add`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取项目所有程序集 GET /sys/curd/gen/basic/assemblies */
|
||||
export async function sysCurdGenBasicAssembliesGet(options?: {
|
||||
[key: string]: any;
|
||||
}) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/curd/gen/basic/assemblies`,
|
||||
{
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 删除代码生成配置 POST /sys/curd/gen/basic/delete */
|
||||
export async function sysCurdGenBasicDeletePost(
|
||||
body: API.BaseIdListInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/curd/gen/basic/delete`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 编辑代码生成器 POST /sys/curd/gen/basic/edit */
|
||||
export async function sysCurdGenBasicEditPost(
|
||||
body: API.GenBasicEditInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/curd/gen/basic/edit`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 执行代码生成(本地)" POST /sys/curd/gen/basic/execGenPro */
|
||||
export async function sysCurdGenBasicExecGenProPost(
|
||||
body: API.ExecGenInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/curd/gen/basic/execGenPro`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 执行代码生成(压缩包) GET /sys/curd/gen/basic/execGenZip */
|
||||
export async function sysCurdGenBasicExecGenZipGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysCurdGenBasicExecGenZipGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultIActionResult>(
|
||||
`api/sys/curd/gen/basic/execGenZip`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 代码生成基础分页 GET /sys/curd/gen/basic/page */
|
||||
export async function sysCurdGenBasicPageGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysCurdGenBasicPageGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/curd/gen/basic/page`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 代码生成预览 GET /sys/curd/gen/basic/previewGen */
|
||||
export async function sysCurdGenBasicPreviewGenGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysCurdGenBasicPreviewGenGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/curd/gen/basic/previewGen`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取所有表信息 GET /sys/curd/gen/basic/tables */
|
||||
export async function sysCurdGenBasicTablesGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysCurdGenBasicTablesGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/curd/gen/basic/tables`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 编辑代码生成详细 POST /sys/curd/gen/config/editBatch */
|
||||
export async function sysCurdGenConfigEditBatchPost(
|
||||
body: API.GenConfig[],
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/curd/gen/config/editBatch`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询代码生成详细配置列表 GET /sys/curd/gen/config/list */
|
||||
export async function sysCurdGenConfigListGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysCurdGenConfigListGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/curd/gen/config/list`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@ -1,35 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 获取系统基础配置 GET /sys/ico */
|
||||
export async function sysIcoGet(options?: { [key: string]: any }) {
|
||||
return request<any>(`api/sys/ico`, {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取系统基础配置 GET /sys/loginPolicy */
|
||||
export async function sysLoginPolicyGet(options?: { [key: string]: any }) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/loginPolicy`, {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取系统基础配置 GET /sys/sysInfo */
|
||||
export async function sysSysInfoGet(options?: { [key: string]: any }) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/sysInfo`, {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取租户列表 GET /sys/tenantList */
|
||||
export async function sysTenantListGet(options?: { [key: string]: any }) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/tenantList`, {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@ -1,123 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 删除文件 POST /sys/dev/file/delete */
|
||||
export async function sysDevFileDeletePost(
|
||||
body: API.BaseIdListInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/dev/file/delete`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 下载文件 GET /sys/dev/file/download */
|
||||
export async function sysDevFileDownloadGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysDevFileDownloadGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultIActionResult>(
|
||||
`api/sys/dev/file/download`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 文件查询分页 GET /sys/dev/file/page */
|
||||
export async function sysDevFilePageGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysDevFilePageGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/dev/file/page`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 上传本地文件 POST /sys/dev/file/uploadLocal */
|
||||
export async function sysDevFileUploadLocalPost(
|
||||
body: {},
|
||||
file?: File,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
const formData = new FormData();
|
||||
|
||||
if (file) {
|
||||
formData.append('file', file);
|
||||
}
|
||||
|
||||
Object.keys(body).forEach((ele) => {
|
||||
const item = (body as any)[ele];
|
||||
|
||||
if (item !== undefined && item !== null) {
|
||||
if (typeof item === 'object' && !(item instanceof File)) {
|
||||
if (item instanceof Array) {
|
||||
item.forEach((f) => formData.append(ele, f || ''));
|
||||
} else {
|
||||
formData.append(ele, JSON.stringify(item));
|
||||
}
|
||||
} else {
|
||||
formData.append(ele, item);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return request<API.SimpleAdminResultInt64>(`api/sys/dev/file/uploadLocal`, {
|
||||
method: 'POST',
|
||||
data: formData,
|
||||
requestType: 'form',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 上传MINIO文件 POST /sys/dev/file/uploadMinio */
|
||||
export async function sysDevFileUploadMinioPost(
|
||||
body: {},
|
||||
file?: File,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
const formData = new FormData();
|
||||
|
||||
if (file) {
|
||||
formData.append('file', file);
|
||||
}
|
||||
|
||||
Object.keys(body).forEach((ele) => {
|
||||
const item = (body as any)[ele];
|
||||
|
||||
if (item !== undefined && item !== null) {
|
||||
if (typeof item === 'object' && !(item instanceof File)) {
|
||||
if (item instanceof Array) {
|
||||
item.forEach((f) => formData.append(ele, f || ''));
|
||||
} else {
|
||||
formData.append(ele, JSON.stringify(item));
|
||||
}
|
||||
} else {
|
||||
formData.append(ele, item);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return request<API.SimpleAdminResultInt64>(`api/sys/dev/file/uploadMinio`, {
|
||||
method: 'POST',
|
||||
data: formData,
|
||||
requestType: 'form',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@ -1,40 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 1
|
||||
上传图片 POST /sys/upload/uploadImg */
|
||||
export async function sysUploadUploadImgPost(
|
||||
body: {},
|
||||
file?: File,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
const formData = new FormData();
|
||||
|
||||
if (file) {
|
||||
formData.append('file', file);
|
||||
}
|
||||
|
||||
Object.keys(body).forEach((ele) => {
|
||||
const item = (body as any)[ele];
|
||||
|
||||
if (item !== undefined && item !== null) {
|
||||
if (typeof item === 'object' && !(item instanceof File)) {
|
||||
if (item instanceof Array) {
|
||||
item.forEach((f) => formData.append(ele, f || ''));
|
||||
} else {
|
||||
formData.append(ele, JSON.stringify(item));
|
||||
}
|
||||
} else {
|
||||
formData.append(ele, item);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return request<API.SimpleAdminResultInt64>(`api/sys/upload/uploadImg`, {
|
||||
method: 'POST',
|
||||
data: formData,
|
||||
requestType: 'form',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@ -1,54 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
// API 更新时间:
|
||||
// API 唯一标识:
|
||||
import * as roleManagement from './roleManagement';
|
||||
import * as bEndPermissionVerify from './bEndPermissionVerify';
|
||||
import * as sessionManagement from './sessionManagement';
|
||||
import * as batchUpdate from './batchUpdate';
|
||||
import * as common from './common';
|
||||
import * as fileManagement from './fileManagement';
|
||||
import * as internalMessage from './internalMessage';
|
||||
import * as codeGenBasic from './codeGenBasic';
|
||||
import * as codeGenConfig from './codeGenConfig';
|
||||
import * as systemHome from './systemHome';
|
||||
import * as permissionButton from './permissionButton';
|
||||
import * as menuManagement from './menuManagement';
|
||||
import * as moduleManagement from './moduleManagement';
|
||||
import * as spaManagement from './spaManagement';
|
||||
import * as operationLog from './operationLog';
|
||||
import * as accessLog from './accessLog';
|
||||
import * as mqttService from './mqttService';
|
||||
import * as systemConfig from './systemConfig';
|
||||
import * as systemDict from './systemDict';
|
||||
import * as organizationManagement from './organizationManagement';
|
||||
import * as positionManagement from './positionManagement';
|
||||
import * as userManagement from './userManagement';
|
||||
import * as fileUploadController from './fileUploadController';
|
||||
import * as userCenter from './userCenter';
|
||||
export default {
|
||||
roleManagement,
|
||||
bEndPermissionVerify,
|
||||
sessionManagement,
|
||||
batchUpdate,
|
||||
common,
|
||||
fileManagement,
|
||||
internalMessage,
|
||||
codeGenBasic,
|
||||
codeGenConfig,
|
||||
systemHome,
|
||||
permissionButton,
|
||||
menuManagement,
|
||||
moduleManagement,
|
||||
spaManagement,
|
||||
operationLog,
|
||||
accessLog,
|
||||
mqttService,
|
||||
systemConfig,
|
||||
systemDict,
|
||||
organizationManagement,
|
||||
positionManagement,
|
||||
userManagement,
|
||||
fileUploadController,
|
||||
userCenter,
|
||||
};
|
||||
@ -1,78 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 添加站内信 POST /sys/dev/message/add */
|
||||
export async function sysDevMessageAddPost(
|
||||
body: API.MessageSendInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/dev/message/add`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除站内信 POST /sys/dev/message/delete */
|
||||
export async function sysDevMessageDeletePost(
|
||||
body: API.BaseIdListInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/dev/message/delete`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 消息详情 GET /sys/dev/message/detail */
|
||||
export async function sysDevMessageDetailGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysDevMessageDetailGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/dev/message/detail`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 编辑站内信 POST /sys/dev/message/edit */
|
||||
export async function sysDevMessageEditPost(
|
||||
body: API.MessageSendUpdateInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/dev/message/edit`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 分页查询 GET /sys/dev/message/page */
|
||||
export async function sysDevMessagePageGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysDevMessagePageGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/dev/message/page`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@ -1,131 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 添加菜单 POST /sys/limit/menu/add */
|
||||
export async function sysLimitMenuAddPost(
|
||||
body: API.MenuAddInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
// 确保 name 字段被包含在请求中(即使类型定义中是可选的)
|
||||
const requestBody: any = {
|
||||
...body,
|
||||
// 如果 body 中没有 name 字段,使用 code 或 title 作为 name
|
||||
name: (body as any).name || (body as any).code || body.title || '',
|
||||
};
|
||||
|
||||
return request<any>(`api/sys/limit/menu/add`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: requestBody,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 更改模块 POST /sys/limit/menu/changeModule */
|
||||
export async function sysLimitMenuChangeModulePost(
|
||||
body: API.MenuChangeModuleInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/limit/menu/changeModule`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除菜单 POST /sys/limit/menu/delete */
|
||||
export async function sysLimitMenuDeletePost(
|
||||
body: API.BaseIdListInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/limit/menu/delete`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取菜单详情 GET /sys/limit/menu/detail */
|
||||
export async function sysLimitMenuDetailGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysLimitMenuDetailGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/limit/menu/detail`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 编辑菜单 POST /sys/limit/menu/edit */
|
||||
export async function sysLimitMenuEditPost(
|
||||
body: API.MenuEditInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/limit/menu/edit`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取菜单树选择器 GET /sys/limit/menu/menuTreeSelector */
|
||||
export async function sysLimitMenuMenuTreeSelectorGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysLimitMenuMenuTreeSelectorGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/limit/menu/menuTreeSelector`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 模块选择 GET /sys/limit/menu/moduleSelector */
|
||||
export async function sysLimitMenuModuleSelectorGet(options?: {
|
||||
[key: string]: any;
|
||||
}) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/limit/menu/moduleSelector`,
|
||||
{
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取菜单树 GET /sys/limit/menu/tree */
|
||||
export async function sysLimitMenuTreeGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysLimitMenuTreeGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/limit/menu/tree`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@ -1,86 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 添加模块 POST /sys/limit/module/add */
|
||||
export async function sysLimitModuleAddPost(
|
||||
body: API.ModuleAddInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/limit/module/add`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除模块 POST /sys/limit/module/delete */
|
||||
export async function sysLimitModuleDeletePost(
|
||||
body: API.BaseIdListInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/limit/module/delete`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取模块详情 GET /sys/limit/module/detail */
|
||||
export async function sysLimitModuleDetailGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysLimitModuleDetailGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/limit/module/detail`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改模块 POST /sys/limit/module/edit */
|
||||
export async function sysLimitModuleEditPost(
|
||||
body: API.ModuleEditInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/limit/module/edit`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 模块列表 GET /sys/limit/module/list */
|
||||
export async function sysLimitModuleListGet(options?: { [key: string]: any }) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/limit/module/list`, {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 模块分页查询 GET /sys/limit/module/page */
|
||||
export async function sysLimitModulePageGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysLimitModulePageGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/limit/module/page`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@ -1,26 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** mqtt认证 POST /mqtt/auth */
|
||||
export async function mqttAuthPost(
|
||||
body: API.MqttAuthInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/mqtt/auth`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取mqtt登录参数 GET /mqtt/getParameter */
|
||||
export async function mqttGetParameterGet(options?: { [key: string]: any }) {
|
||||
return request<API.SimpleAdminResultObject>(`api/mqtt/getParameter`, {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@ -1,77 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 操作日志周统计柱状图图 GET /sys/audit/logOperate/columnChartData */
|
||||
export async function sysAuditLogOperateColumnChartDataGet(options?: {
|
||||
[key: string]: any;
|
||||
}) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/audit/logOperate/columnChartData`,
|
||||
{
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 清空日志 POST /sys/audit/logOperate/delete */
|
||||
export async function sysAuditLogOperateDeletePost(
|
||||
body: API.OperateLogDeleteInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/audit/logOperate/delete`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 日志详情 GET /sys/audit/logOperate/detail */
|
||||
export async function sysAuditLogOperateDetailGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysAuditLogOperateDetailGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/audit/logOperate/detail`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 操作日志分页查询 GET /sys/audit/logOperate/page */
|
||||
export async function sysAuditLogOperatePageGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysAuditLogOperatePageGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/audit/logOperate/page`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 操作日志数量总览饼图 GET /sys/audit/logOperate/pieChartData */
|
||||
export async function sysAuditLogOperatePieChartDataGet(options?: {
|
||||
[key: string]: any;
|
||||
}) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/audit/logOperate/pieChartData`,
|
||||
{
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
@ -1,137 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 添加组织 POST /sys/organization/org/add */
|
||||
export async function sysOrganizationOrgAddPost(
|
||||
body: API.SysOrgAddInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/organization/org/add`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 复制组织 POST /sys/organization/org/copy */
|
||||
export async function sysOrganizationOrgCopyPost(
|
||||
body: API.SysOrgCopyInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/organization/org/copy`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除组织 POST /sys/organization/org/delete */
|
||||
export async function sysOrganizationOrgDeletePost(
|
||||
body: API.BaseIdListInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/organization/org/delete`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取组织详情 GET /sys/organization/org/detail */
|
||||
export async function sysOrganizationOrgDetailGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysOrganizationOrgDetailGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/organization/org/detail`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 修改组织 POST /sys/organization/org/edit */
|
||||
export async function sysOrganizationOrgEditPost(
|
||||
body: API.SysOrgEditInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/organization/org/edit`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取组织树选择器 GET /sys/organization/org/orgTreeSelector */
|
||||
export async function sysOrganizationOrgOrgTreeSelectorGet(options?: {
|
||||
[key: string]: any;
|
||||
}) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/organization/org/orgTreeSelector`,
|
||||
{
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 组织分页查询 GET /sys/organization/org/page */
|
||||
export async function sysOrganizationOrgPageGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysOrganizationOrgPageGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/organization/org/page`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取用户选择器 GET /sys/organization/org/selector */
|
||||
export async function sysOrganizationOrgSelectorGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysOrganizationOrgSelectorGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/organization/org/selector`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取组织树 GET /sys/organization/org/tree */
|
||||
export async function sysOrganizationOrgTreeGet(options?: {
|
||||
[key: string]: any;
|
||||
}) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/organization/org/tree`, {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@ -1,93 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 添加按钮 POST /sys/limit/button/add */
|
||||
export async function sysLimitButtonAddPost(
|
||||
body: API.ButtonAddInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/limit/button/add`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 批量新增 POST /sys/limit/button/batch */
|
||||
export async function sysLimitButtonBatchPost(
|
||||
body: API.ButtonAddInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/limit/button/batch`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮 POST /sys/limit/button/delete */
|
||||
export async function sysLimitButtonDeletePost(
|
||||
body: API.BaseIdListInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/limit/button/delete`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取按钮详情 GET /sys/limit/button/detail */
|
||||
export async function sysLimitButtonDetailGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysLimitButtonDetailGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/limit/button/detail`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改按钮 POST /sys/limit/button/edit */
|
||||
export async function sysLimitButtonEditPost(
|
||||
body: API.ButtonEditInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/limit/button/edit`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 按钮分页查询 GET /sys/limit/button/page */
|
||||
export async function sysLimitButtonPageGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysLimitButtonPageGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/limit/button/page`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@ -1,120 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 添加职位 POST /sys/organization/position/add */
|
||||
export async function sysOrganizationPositionAddPost(
|
||||
body: API.PositionAddInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/organization/position/add`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除职位 POST /sys/organization/position/delete */
|
||||
export async function sysOrganizationPositionDeletePost(
|
||||
body: API.BaseIdListInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/organization/position/delete`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取职位详情 GET /sys/organization/position/detail */
|
||||
export async function sysOrganizationPositionDetailGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysOrganizationPositionDetailGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/organization/position/detail`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 修改职位 POST /sys/organization/position/edit */
|
||||
export async function sysOrganizationPositionEditPost(
|
||||
body: API.PositionEditInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/organization/position/edit`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 职位分页查询 GET /sys/organization/position/page */
|
||||
export async function sysOrganizationPositionPageGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysOrganizationPositionPageGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/organization/position/page`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 职位选择器 GET /sys/organization/position/selector */
|
||||
export async function sysOrganizationPositionSelectorGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysOrganizationPositionSelectorGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/organization/position/selector`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取职位树 GET /sys/organization/position/tree */
|
||||
export async function sysOrganizationPositionTreeGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysOrganizationPositionTreeGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/organization/position/tree`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
@ -1,434 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 添加角色 POST /biz/organization/role/add */
|
||||
export async function bizOrganizationRoleAddPost(
|
||||
body: API.RoleAddInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/biz/organization/role/add`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除角色 POST /biz/organization/role/delete */
|
||||
export async function bizOrganizationRoleDeletePost(
|
||||
body: API.BaseIdListInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/biz/organization/role/delete`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取角色详情 GET /biz/organization/role/detail */
|
||||
export async function bizOrganizationRoleDetailGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.bizOrganizationRoleDetailGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/biz/organization/role/detail`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 修改角色 POST /biz/organization/role/edit */
|
||||
export async function bizOrganizationRoleEditPost(
|
||||
body: API.RoleEditInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/biz/organization/role/edit`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 给角色授权资源 POST /biz/organization/role/grantResource */
|
||||
export async function bizOrganizationRoleGrantResourcePost(
|
||||
body: API.GrantResourceInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/biz/organization/role/grantResource`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 给角色授权用户 POST /biz/organization/role/grantUser */
|
||||
export async function bizOrganizationRoleGrantUserPost(
|
||||
body: API.GrantUserInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/biz/organization/role/grantUser`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取角色拥有资源 GET /biz/organization/role/ownResource */
|
||||
export async function bizOrganizationRoleOwnResourceGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.bizOrganizationRoleOwnResourceGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/biz/organization/role/ownResource`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取角色下的用户 GET /biz/organization/role/ownUser */
|
||||
export async function bizOrganizationRoleOwnUserGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.bizOrganizationRoleOwnUserGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/biz/organization/role/ownUser`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 角色分页查询 GET /biz/organization/role/page */
|
||||
export async function bizOrganizationRolePageGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.bizOrganizationRolePageGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/biz/organization/role/page`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取角色授权资源树 GET /biz/organization/role/resourceTreeSelector */
|
||||
export async function bizOrganizationRoleResourceTreeSelectorGet(options?: {
|
||||
[key: string]: any;
|
||||
}) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/biz/organization/role/resourceTreeSelector`,
|
||||
{
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取角色选择器 GET /biz/organization/role/roleSelector */
|
||||
export async function bizOrganizationRoleRoleSelectorGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.bizOrganizationRoleRoleSelectorGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/biz/organization/role/roleSelector`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取角色树 GET /biz/organization/role/tree */
|
||||
export async function bizOrganizationRoleTreeGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.bizOrganizationRoleTreeGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/biz/organization/role/tree`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 添加角色 POST /sys/limit/role/add */
|
||||
export async function sysLimitRoleAddPost(
|
||||
body: API.RoleAddInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/limit/role/add`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除角色 POST /sys/limit/role/delete */
|
||||
export async function sysLimitRoleDeletePost(
|
||||
body: API.BaseIdListInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/limit/role/delete`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取角色详情 GET /sys/limit/role/detail */
|
||||
export async function sysLimitRoleDetailGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysLimitRoleDetailGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/limit/role/detail`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改角色 POST /sys/limit/role/edit */
|
||||
export async function sysLimitRoleEditPost(
|
||||
body: API.RoleEditInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/limit/role/edit`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 给角色授权权限 POST /sys/limit/role/grantPermission */
|
||||
export async function sysLimitRoleGrantPermissionPost(
|
||||
body: API.GrantPermissionInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/limit/role/grantPermission`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 给角色授权资源 POST /sys/limit/role/grantResource */
|
||||
export async function sysLimitRoleGrantResourcePost(
|
||||
body: API.GrantResourceInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/limit/role/grantResource`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 给角色授权用户 POST /sys/limit/role/grantUser */
|
||||
export async function sysLimitRoleGrantUserPost(
|
||||
body: API.GrantUserInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/limit/role/grantUser`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取角色拥有权限 GET /sys/limit/role/ownPermission */
|
||||
export async function sysLimitRoleOwnPermissionGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysLimitRoleOwnPermissionGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/limit/role/ownPermission`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取角色拥有资源 GET /sys/limit/role/ownResource */
|
||||
export async function sysLimitRoleOwnResourceGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysLimitRoleOwnResourceGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/limit/role/ownResource`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取角色下的用户 GET /sys/limit/role/ownUser */
|
||||
export async function sysLimitRoleOwnUserGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysLimitRoleOwnUserGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/limit/role/ownUser`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 角色分页查询 GET /sys/limit/role/page */
|
||||
export async function sysLimitRolePageGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysLimitRolePageGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/limit/role/page`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取权限授权树 GET /sys/limit/role/permissionTreeSelector */
|
||||
export async function sysLimitRolePermissionTreeSelectorGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysLimitRolePermissionTreeSelectorGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/limit/role/permissionTreeSelector`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取角色授权资源树 GET /sys/limit/role/resourceTreeSelector */
|
||||
export async function sysLimitRoleResourceTreeSelectorGet(options?: {
|
||||
[key: string]: any;
|
||||
}) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/limit/role/resourceTreeSelector`,
|
||||
{
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取角色选择器 GET /sys/limit/role/roleSelector */
|
||||
export async function sysLimitRoleRoleSelectorGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysLimitRoleRoleSelectorGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/limit/role/roleSelector`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取角色树 GET /sys/limit/role/tree */
|
||||
export async function sysLimitRoleTreeGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysLimitRoleTreeGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/limit/role/tree`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@ -1,103 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 会话统计 GET /sys/auth/session/analysis */
|
||||
export async function sysAuthSessionAnalysisGet(options?: {
|
||||
[key: string]: any;
|
||||
}) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/auth/session/analysis`, {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 强退B端会话 POST /sys/auth/session/b/exitSession */
|
||||
export async function sysAuthSessionBExitSessionPost(
|
||||
body: API.BaseIdInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/auth/session/b/exitSession`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 强退B端Token POST /sys/auth/session/b/ExitToken */
|
||||
export async function sysAuthSessionBExitTokenPost(
|
||||
body: API.ExitTokenInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/auth/session/b/ExitToken`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** B端会话分页 GET /sys/auth/session/b/page */
|
||||
export async function sysAuthSessionBPageGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysAuthSessionBPageGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/auth/session/b/page`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 强退C端会话 POST /sys/auth/session/c/exitSession */
|
||||
export async function sysAuthSessionCExitSessionPost(
|
||||
body: API.BaseIdInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/auth/session/c/exitSession`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 强退C端Token POST /sys/auth/session/c/ExitToken */
|
||||
export async function sysAuthSessionCExitTokenPost(
|
||||
body: API.ExitTokenInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/auth/session/c/ExitToken`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** C端会话分页 GET /sys/auth/session/c/page */
|
||||
export async function sysAuthSessionCPageGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysAuthSessionCPageGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/auth/session/c/page`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@ -1,78 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 添加单页 POST /sys/limit/spa/add */
|
||||
export async function sysLimitSpaAddPost(
|
||||
body: API.SpaAddInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/limit/spa/add`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除单页 POST /sys/limit/spa/delete */
|
||||
export async function sysLimitSpaDeletePost(
|
||||
body: API.BaseIdListInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/limit/spa/delete`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取单页详情 GET /sys/limit/spa/detail */
|
||||
export async function sysLimitSpaDetailGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysLimitSpaDetailGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/limit/spa/detail`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改单页 POST /sys/limit/spa/edit */
|
||||
export async function sysLimitSpaEditPost(
|
||||
body: API.SpaEditInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/limit/spa/edit`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 单页分页查询 GET /sys/limit/spa/page */
|
||||
export async function sysLimitSpaPageGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysLimitSpaPageGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/limit/spa/page`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@ -1,99 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 添加配置 POST /sys/ops/config/add */
|
||||
export async function sysOpsConfigAddPost(
|
||||
body: API.ConfigAddInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/ops/config/add`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除配置 POST /sys/ops/config/delete */
|
||||
export async function sysOpsConfigDeletePost(
|
||||
body: API.ConfigDeleteInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/ops/config/delete`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改配置 POST /sys/ops/config/edit */
|
||||
export async function sysOpsConfigEditPost(
|
||||
body: API.ConfigEditInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/ops/config/edit`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 配置批量更新 POST /sys/ops/config/editBatch */
|
||||
export async function sysOpsConfigEditBatchPost(
|
||||
body: API.SysConfig[],
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/ops/config/editBatch`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取系统配置列表 GET /sys/ops/config/list */
|
||||
export async function sysOpsConfigListGet(options?: { [key: string]: any }) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/ops/config/list`, {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 配置分页 GET /sys/ops/config/page */
|
||||
export async function sysOpsConfigPageGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysOpsConfigPageGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/ops/config/page`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取系统基础配置 GET /sys/ops/config/sysBaseList */
|
||||
export async function sysOpsConfigSysBaseListGet(options?: {
|
||||
[key: string]: any;
|
||||
}) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/ops/config/sysBaseList`,
|
||||
{
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
@ -1,78 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 添加字典 POST /sys/ops/dict/add */
|
||||
export async function sysOpsDictAddPost(
|
||||
body: API.DictAddInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/ops/dict/add`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除字典 POST /sys/ops/dict/delete */
|
||||
export async function sysOpsDictDeletePost(
|
||||
body: API.DictDeleteInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/ops/dict/delete`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改字典 POST /sys/ops/dict/edit */
|
||||
export async function sysOpsDictEditPost(
|
||||
body: API.DictEditInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/ops/dict/edit`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 字典分页查询 GET /sys/ops/dict/page */
|
||||
export async function sysOpsDictPageGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysOpsDictPageGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/ops/dict/page`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取字典树 GET /sys/ops/dict/tree */
|
||||
export async function sysOpsDictTreeGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysOpsDictTreeGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/sys/ops/dict/tree`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@ -1,74 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 获取当前用户站内信列表 GET /home/index/message/list */
|
||||
export async function homeIndexMessageListGet(options?: {
|
||||
[key: string]: any;
|
||||
}) {
|
||||
return request<API.SimpleAdminResultObject>(`api/home/index/message/list`, {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取当前用户操作日志列表 GET /home/index/opLog/list */
|
||||
export async function homeIndexOpLogListGet(options?: { [key: string]: any }) {
|
||||
return request<API.SimpleAdminResultObject>(`api/home/index/opLog/list`, {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 添加日程 POST /home/index/schedule/add */
|
||||
export async function homeIndexScheduleAddPost(
|
||||
body: API.ScheduleAddInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/home/index/schedule/add`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除日程 POST /home/index/schedule/deleteSchedule */
|
||||
export async function homeIndexScheduleDeleteSchedulePost(
|
||||
body: API.BaseIdListInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/home/index/schedule/deleteSchedule`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取当前用户日程列表 GET /home/index/schedule/list */
|
||||
export async function homeIndexScheduleListGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.homeIndexScheduleListGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/home/index/schedule/list`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取当前用户访问日志列表 GET /home/index/visLog/list */
|
||||
export async function homeIndexVisLogListGet(options?: { [key: string]: any }) {
|
||||
return request<API.SimpleAdminResultObject>(`api/home/index/visLog/list`, {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
2900
src/api/SimpleAdmin/typings.d.ts
vendored
2900
src/api/SimpleAdmin/typings.d.ts
vendored
File diff suppressed because it is too large
Load Diff
@ -1,255 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 删除我的消息 POST /userCenter/deleteMessage */
|
||||
export async function userCenterDeleteMessagePost(
|
||||
body: API.BaseIdInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/userCenter/deleteMessage`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取个人菜单 GET /userCenter/loginMenu */
|
||||
export async function userCenterLoginMenuGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.userCenterLoginMenuGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/userCenter/loginMenu`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取组织架构 GET /userCenter/loginOrgTree */
|
||||
export async function userCenterLoginOrgTreeGet(options?: {
|
||||
[key: string]: any;
|
||||
}) {
|
||||
return request<API.SimpleAdminResultObject>(`api/userCenter/loginOrgTree`, {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取个人工作台 GET /userCenter/loginWorkbench */
|
||||
export async function userCenterLoginWorkbenchGet(options?: {
|
||||
[key: string]: any;
|
||||
}) {
|
||||
return request<API.SimpleAdminResultObject>(`api/userCenter/loginWorkbench`, {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 读取登录用户站内信详情 GET /userCenter/myMessageDetail */
|
||||
export async function userCenterMyMessageDetailGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.userCenterMyMessageDetailGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/userCenter/myMessageDetail`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取登录用户的站内信分页 GET /userCenter/myMessagePage */
|
||||
export async function userCenterMyMessagePageGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.userCenterMyMessagePageGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(`api/userCenter/myMessagePage`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 最新未读消息 GET /userCenter/newUnRead */
|
||||
export async function userCenterNewUnReadGet(options?: { [key: string]: any }) {
|
||||
return request<API.SimpleAdminResultObject>(`api/userCenter/newUnRead`, {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改默认模块 POST /userCenter/setDefaultModule */
|
||||
export async function userCenterSetDefaultModulePost(
|
||||
body: API.SetDefaultModuleInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/userCenter/setDefaultModule`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 设置未读 POST /userCenter/setDelete */
|
||||
export async function userCenterSetDeletePost(
|
||||
body: API.MessageReadInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultInt32>(`api/userCenter/setDelete`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 设置已读 POST /userCenter/setRead */
|
||||
export async function userCenterSetReadPost(
|
||||
body: API.MessageReadInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultInt32>(`api/userCenter/setRead`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 快捷方式菜单树 GET /userCenter/shortcutTree */
|
||||
export async function userCenterShortcutTreeGet(options?: {
|
||||
[key: string]: any;
|
||||
}) {
|
||||
return request<API.SimpleAdminResultObject>(`api/userCenter/shortcutTree`, {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 未读消息数 GET /userCenter/UnReadCount */
|
||||
export async function userCenterUnReadCountGet(options?: {
|
||||
[key: string]: any;
|
||||
}) {
|
||||
return request<API.SimpleAdminResultObject>(`api/userCenter/UnReadCount`, {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改头像 POST /userCenter/updateAvatar */
|
||||
export async function userCenterUpdateAvatarPost(
|
||||
body: {},
|
||||
File?: File,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
const formData = new FormData();
|
||||
|
||||
if (File) {
|
||||
formData.append('File', File);
|
||||
}
|
||||
|
||||
Object.keys(body).forEach((ele) => {
|
||||
const item = (body as any)[ele];
|
||||
|
||||
if (item !== undefined && item !== null) {
|
||||
if (typeof item === 'object' && !(item instanceof File)) {
|
||||
if (item instanceof Array) {
|
||||
item.forEach((f) => formData.append(ele, f || ''));
|
||||
} else {
|
||||
formData.append(ele, JSON.stringify(item));
|
||||
}
|
||||
} else {
|
||||
formData.append(ele, item);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return request<API.SimpleAdminResultObject>(`api/userCenter/updateAvatar`, {
|
||||
method: 'POST',
|
||||
data: formData,
|
||||
requestType: 'form',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改密码 POST /userCenter/updatePassword */
|
||||
export async function userCenterUpdatePasswordPost(
|
||||
body: API.UpdatePasswordInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/userCenter/updatePassword`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 更新签名 POST /userCenter/updateSignature */
|
||||
export async function userCenterUpdateSignaturePost(
|
||||
body: API.UpdateSignatureInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/userCenter/updateSignature`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 编辑个人信息 POST /userCenter/updateUserInfo */
|
||||
export async function userCenterUpdateUserInfoPost(
|
||||
body: API.UpdateInfoInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/userCenter/updateUserInfo`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 编辑工作台 POST /userCenter/updateUserWorkbench */
|
||||
export async function userCenterUpdateUserWorkbenchPost(
|
||||
body: API.UpdateWorkbenchInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/userCenter/updateUserWorkbench`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@ -1,369 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 添加用户 POST /sys/organization/user/add */
|
||||
export async function sysOrganizationUserAddPost(
|
||||
body: API.UserAddInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/organization/user/add`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除用户 POST /sys/organization/user/delete */
|
||||
export async function sysOrganizationUserDeletePost(
|
||||
body: API.BaseIdListInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/organization/user/delete`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 用户详情 GET /sys/organization/user/detail */
|
||||
export async function sysOrganizationUserDetailGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysOrganizationUserDetailGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/organization/user/detail`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 禁用用户 POST /sys/organization/user/disableUser */
|
||||
export async function sysOrganizationUserDisableUserPost(
|
||||
body: API.BaseIdInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/organization/user/disableUser`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改用户 POST /sys/organization/user/edit */
|
||||
export async function sysOrganizationUserEditPost(
|
||||
body: API.UserEditInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/organization/user/edit`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 批量修改用户 POST /sys/organization/user/edits */
|
||||
export async function sysOrganizationUserEditsPost(
|
||||
body: API.BatchEditInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/organization/user/edits`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 启用用户 POST /sys/organization/user/enableUser */
|
||||
export async function sysOrganizationUserEnableUserPost(
|
||||
body: API.BaseIdInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/organization/user/enableUser`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 用户导出 POST /sys/organization/user/export */
|
||||
export async function sysOrganizationUserExportPost(
|
||||
body: API.UserPageInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/organization/user/export`,
|
||||
{
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 给用户授权权限 POST /sys/organization/user/grantPermission */
|
||||
export async function sysOrganizationUserGrantPermissionPost(
|
||||
body: API.GrantPermissionInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/organization/user/grantPermission`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 给用户授权资源 POST /sys/organization/user/grantResource */
|
||||
export async function sysOrganizationUserGrantResourcePost(
|
||||
body: API.UserGrantResourceInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/organization/user/grantResource`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 给用户授权角色 POST /sys/organization/user/grantRole */
|
||||
export async function sysOrganizationUserGrantRolePost(
|
||||
body: API.UserGrantRoleInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/organization/user/grantRole`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 用户导入 POST /sys/organization/user/import */
|
||||
export async function sysOrganizationUserImportPost(
|
||||
body: API.ImportResultInputSysUserImportInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/organization/user/import`,
|
||||
{
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取用户拥有权限 GET /sys/organization/user/ownPermission */
|
||||
export async function sysOrganizationUserOwnPermissionGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysOrganizationUserOwnPermissionGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/organization/user/ownPermission`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取用户拥有资源 GET /sys/organization/user/ownResource */
|
||||
export async function sysOrganizationUserOwnResourceGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysOrganizationUserOwnResourceGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/organization/user/ownResource`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取用户拥有角色 GET /sys/organization/user/ownRole */
|
||||
export async function sysOrganizationUserOwnRoleGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysOrganizationUserOwnRoleGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/organization/user/ownRole`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 用户分页查询 GET /sys/organization/user/page */
|
||||
export async function sysOrganizationUserPageGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysOrganizationUserPageGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/organization/user/page`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
Expression: undefined,
|
||||
...params['Expression'],
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取权限授权树 GET /sys/organization/user/permissionTreeSelector */
|
||||
export async function sysOrganizationUserPermissionTreeSelectorGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysOrganizationUserPermissionTreeSelectorGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/organization/user/permissionTreeSelector`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 导入预览 POST /sys/organization/user/preview */
|
||||
export async function sysOrganizationUserPreviewPost(
|
||||
body: {},
|
||||
File?: File,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
const formData = new FormData();
|
||||
|
||||
if (File) {
|
||||
formData.append('File', File);
|
||||
}
|
||||
|
||||
Object.keys(body).forEach((ele) => {
|
||||
const item = (body as any)[ele];
|
||||
|
||||
if (item !== undefined && item !== null) {
|
||||
if (typeof item === 'object' && !(item instanceof File)) {
|
||||
if (item instanceof Array) {
|
||||
item.forEach((f) => formData.append(ele, f || ''));
|
||||
} else {
|
||||
formData.append(ele, JSON.stringify(item));
|
||||
}
|
||||
} else {
|
||||
formData.append(ele, item);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/organization/user/preview`,
|
||||
{
|
||||
method: 'POST',
|
||||
data: formData,
|
||||
requestType: 'form',
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 重置密码 POST /sys/organization/user/resetPassword */
|
||||
export async function sysOrganizationUserResetPasswordPost(
|
||||
body: API.BaseIdInput,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<any>(`api/sys/organization/user/resetPassword`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取用户选择器 GET /sys/organization/user/selector */
|
||||
export async function sysOrganizationUserSelectorGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.sysOrganizationUserSelectorGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/organization/user/selector`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 模板下载 GET /sys/organization/user/template */
|
||||
export async function sysOrganizationUserTemplateGet(options?: {
|
||||
[key: string]: any;
|
||||
}) {
|
||||
return request<API.SimpleAdminResultObject>(
|
||||
`api/sys/organization/user/template`,
|
||||
{
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
183
src/api/rbac/axios-config.ts
Normal file
183
src/api/rbac/axios-config.ts
Normal file
@ -0,0 +1,183 @@
|
||||
import axios, { AxiosError, AxiosRequestConfig } from 'axios'
|
||||
import { Message } from '@arco-design/web-vue'
|
||||
import router from '@/router'
|
||||
import { OpenAPI, clearAuthToken } from './index'
|
||||
import { useRbacUserStore } from '@/store/modules/rbac-user'
|
||||
|
||||
// 创建自定义 axios 实例
|
||||
// 注意:baseURL 设置为空,因为 OpenAPI.BASE 已经处理了 URL 构建
|
||||
// 生产环境:OpenAPI.BASE = 'http://43.139.210.35:5281'
|
||||
// 开发环境:OpenAPI.BASE = ''(通过 Vite 代理)
|
||||
export const axiosInstance = axios.create({
|
||||
baseURL: '', // 始终为空,URL 由 OpenAPI.BASE + path 构建
|
||||
timeout: 30000,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
|
||||
// 是否正在刷新 Token
|
||||
let isRefreshing = false
|
||||
// 等待刷新的请求队列
|
||||
let refreshSubscribers: ((token: string) => void)[] = []
|
||||
|
||||
// 添加请求到等待队列
|
||||
function subscribeTokenRefresh(callback: (token: string) => void) {
|
||||
refreshSubscribers.push(callback)
|
||||
}
|
||||
|
||||
// 通知所有等待的请求
|
||||
function onTokenRefreshed(token: string) {
|
||||
refreshSubscribers.forEach(callback => callback(token))
|
||||
refreshSubscribers = []
|
||||
}
|
||||
|
||||
// 请求拦截器
|
||||
axiosInstance.interceptors.request.use(
|
||||
async (config: AxiosRequestConfig) => {
|
||||
const userStore = useRbacUserStore()
|
||||
|
||||
// 确保 headers 存在
|
||||
if (!config.headers) {
|
||||
config.headers = {}
|
||||
}
|
||||
|
||||
// 优先使用 userStore 的 accessToken(最可靠)
|
||||
let token: string | undefined
|
||||
|
||||
if (userStore.accessToken) {
|
||||
token = userStore.accessToken
|
||||
} else if (OpenAPI.TOKEN) {
|
||||
// 兼容:从 OpenAPI 配置中获取 token
|
||||
token = typeof OpenAPI.TOKEN === 'function'
|
||||
? await OpenAPI.TOKEN({} as any)
|
||||
: OpenAPI.TOKEN
|
||||
}
|
||||
|
||||
// 如果找到了 token,设置 Authorization header
|
||||
if (token) {
|
||||
// 如果token已经包含Bearer前缀,直接使用;否则添加Bearer前缀
|
||||
if (typeof token === 'string' && token.startsWith('Bearer ')) {
|
||||
config.headers.Authorization = token
|
||||
} else if (typeof token === 'string' && token.startsWith('Bearer_')) {
|
||||
// 处理 Bearer_xxx 格式,转换为 Bearer xxx
|
||||
config.headers.Authorization = `Bearer ${token.replace('Bearer_', '')}`
|
||||
} else {
|
||||
config.headers.Authorization = `Bearer ${token}`
|
||||
}
|
||||
|
||||
// 调试信息
|
||||
const isDev = (import.meta as any).env?.MODE === 'development'
|
||||
if (isDev) {
|
||||
console.log('[RBAC Request] Authorization header set:', config.headers.Authorization?.substring(0, 20) + '...')
|
||||
}
|
||||
} else {
|
||||
// 调试信息:如果没有 token,记录日志(生产环境也记录,方便排查)
|
||||
const isDev = (import.meta as any).env?.MODE === 'development'
|
||||
console.warn('[RBAC Request] No token found:', {
|
||||
hasAccessToken: !!userStore.accessToken,
|
||||
hasOpenAPIToken: !!OpenAPI.TOKEN,
|
||||
url: config.url,
|
||||
isDev
|
||||
})
|
||||
}
|
||||
|
||||
return config
|
||||
},
|
||||
(error: AxiosError) => {
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
// 响应拦截器
|
||||
axiosInstance.interceptors.response.use(
|
||||
(response) => {
|
||||
return response
|
||||
},
|
||||
async (error: AxiosError) => {
|
||||
const originalRequest = error.config as AxiosRequestConfig & { _retry?: boolean }
|
||||
const userStore = useRbacUserStore()
|
||||
|
||||
if (error.response) {
|
||||
const status = error.response.status
|
||||
const data: any = error.response.data
|
||||
|
||||
// 401 错误处理:尝试刷新 Token
|
||||
if (status === 401 && !originalRequest._retry) {
|
||||
// 如果没有 refreshToken,直接登出
|
||||
if (!userStore.refreshToken) {
|
||||
userStore.logout()
|
||||
router.push('/login')
|
||||
Message.error('未授权,请重新登录')
|
||||
return Promise.reject(error)
|
||||
}
|
||||
|
||||
// 如果正在刷新,将请求加入队列
|
||||
if (isRefreshing) {
|
||||
return new Promise(resolve => {
|
||||
subscribeTokenRefresh((token: string) => {
|
||||
if (!originalRequest.headers) {
|
||||
originalRequest.headers = {}
|
||||
}
|
||||
originalRequest.headers.Authorization = `Bearer ${token}`
|
||||
resolve(axiosInstance(originalRequest))
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
originalRequest._retry = true
|
||||
isRefreshing = true
|
||||
|
||||
try {
|
||||
// 尝试刷新 Token
|
||||
const success = await userStore.refreshAccessToken()
|
||||
|
||||
if (success) {
|
||||
// 刷新成功,重试原请求
|
||||
onTokenRefreshed(userStore.accessToken)
|
||||
if (!originalRequest.headers) {
|
||||
originalRequest.headers = {}
|
||||
}
|
||||
originalRequest.headers.Authorization = `Bearer ${userStore.accessToken}`
|
||||
return axiosInstance(originalRequest)
|
||||
} else {
|
||||
// 刷新失败,登出
|
||||
userStore.logout()
|
||||
router.push('/login')
|
||||
Message.error('登录已过期,请重新登录')
|
||||
return Promise.reject(error)
|
||||
}
|
||||
} catch {
|
||||
userStore.logout()
|
||||
router.push('/login')
|
||||
Message.error('登录已过期,请重新登录')
|
||||
return Promise.reject(error)
|
||||
} finally {
|
||||
isRefreshing = false
|
||||
}
|
||||
}
|
||||
|
||||
switch (status) {
|
||||
case 401:
|
||||
Message.error('未授权,请重新登录')
|
||||
break
|
||||
case 403:
|
||||
Message.error('没有权限访问')
|
||||
break
|
||||
case 404:
|
||||
Message.error('请求的资源不存在')
|
||||
break
|
||||
case 500:
|
||||
Message.error(data?.message || '服务器错误')
|
||||
break
|
||||
default:
|
||||
Message.error(data?.message || '请求失败')
|
||||
}
|
||||
} else if (error.request) {
|
||||
Message.error('网络错误,请检查网络连接')
|
||||
} else {
|
||||
Message.error('请求配置错误')
|
||||
}
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
25
src/api/rbac/generated/core/ApiError.ts
Normal file
25
src/api/rbac/generated/core/ApiError.ts
Normal file
@ -0,0 +1,25 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { ApiRequestOptions } from './ApiRequestOptions';
|
||||
import type { ApiResult } from './ApiResult';
|
||||
|
||||
export class ApiError extends Error {
|
||||
public readonly url: string;
|
||||
public readonly status: number;
|
||||
public readonly statusText: string;
|
||||
public readonly body: any;
|
||||
public readonly request: ApiRequestOptions;
|
||||
|
||||
constructor(request: ApiRequestOptions, response: ApiResult, message: string) {
|
||||
super(message);
|
||||
|
||||
this.name = 'ApiError';
|
||||
this.url = response.url;
|
||||
this.status = response.status;
|
||||
this.statusText = response.statusText;
|
||||
this.body = response.body;
|
||||
this.request = request;
|
||||
}
|
||||
}
|
||||
17
src/api/rbac/generated/core/ApiRequestOptions.ts
Normal file
17
src/api/rbac/generated/core/ApiRequestOptions.ts
Normal file
@ -0,0 +1,17 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type ApiRequestOptions = {
|
||||
readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';
|
||||
readonly url: string;
|
||||
readonly path?: Record<string, any>;
|
||||
readonly cookies?: Record<string, any>;
|
||||
readonly headers?: Record<string, any>;
|
||||
readonly query?: Record<string, any>;
|
||||
readonly formData?: Record<string, any>;
|
||||
readonly body?: any;
|
||||
readonly mediaType?: string;
|
||||
readonly responseHeader?: string;
|
||||
readonly errors?: Record<number, string>;
|
||||
};
|
||||
11
src/api/rbac/generated/core/ApiResult.ts
Normal file
11
src/api/rbac/generated/core/ApiResult.ts
Normal file
@ -0,0 +1,11 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type ApiResult = {
|
||||
readonly url: string;
|
||||
readonly ok: boolean;
|
||||
readonly status: number;
|
||||
readonly statusText: string;
|
||||
readonly body: any;
|
||||
};
|
||||
131
src/api/rbac/generated/core/CancelablePromise.ts
Normal file
131
src/api/rbac/generated/core/CancelablePromise.ts
Normal file
@ -0,0 +1,131 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export class CancelError extends Error {
|
||||
|
||||
constructor(message: string) {
|
||||
super(message);
|
||||
this.name = 'CancelError';
|
||||
}
|
||||
|
||||
public get isCancelled(): boolean {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
export interface OnCancel {
|
||||
readonly isResolved: boolean;
|
||||
readonly isRejected: boolean;
|
||||
readonly isCancelled: boolean;
|
||||
|
||||
(cancelHandler: () => void): void;
|
||||
}
|
||||
|
||||
export class CancelablePromise<T> implements Promise<T> {
|
||||
#isResolved: boolean;
|
||||
#isRejected: boolean;
|
||||
#isCancelled: boolean;
|
||||
readonly #cancelHandlers: (() => void)[];
|
||||
readonly #promise: Promise<T>;
|
||||
#resolve?: (value: T | PromiseLike<T>) => void;
|
||||
#reject?: (reason?: any) => void;
|
||||
|
||||
constructor(
|
||||
executor: (
|
||||
resolve: (value: T | PromiseLike<T>) => void,
|
||||
reject: (reason?: any) => void,
|
||||
onCancel: OnCancel
|
||||
) => void
|
||||
) {
|
||||
this.#isResolved = false;
|
||||
this.#isRejected = false;
|
||||
this.#isCancelled = false;
|
||||
this.#cancelHandlers = [];
|
||||
this.#promise = new Promise<T>((resolve, reject) => {
|
||||
this.#resolve = resolve;
|
||||
this.#reject = reject;
|
||||
|
||||
const onResolve = (value: T | PromiseLike<T>): void => {
|
||||
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
||||
return;
|
||||
}
|
||||
this.#isResolved = true;
|
||||
if (this.#resolve) this.#resolve(value);
|
||||
};
|
||||
|
||||
const onReject = (reason?: any): void => {
|
||||
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
||||
return;
|
||||
}
|
||||
this.#isRejected = true;
|
||||
if (this.#reject) this.#reject(reason);
|
||||
};
|
||||
|
||||
const onCancel = (cancelHandler: () => void): void => {
|
||||
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
||||
return;
|
||||
}
|
||||
this.#cancelHandlers.push(cancelHandler);
|
||||
};
|
||||
|
||||
Object.defineProperty(onCancel, 'isResolved', {
|
||||
get: (): boolean => this.#isResolved,
|
||||
});
|
||||
|
||||
Object.defineProperty(onCancel, 'isRejected', {
|
||||
get: (): boolean => this.#isRejected,
|
||||
});
|
||||
|
||||
Object.defineProperty(onCancel, 'isCancelled', {
|
||||
get: (): boolean => this.#isCancelled,
|
||||
});
|
||||
|
||||
return executor(onResolve, onReject, onCancel as OnCancel);
|
||||
});
|
||||
}
|
||||
|
||||
get [Symbol.toStringTag]() {
|
||||
return "Cancellable Promise";
|
||||
}
|
||||
|
||||
public then<TResult1 = T, TResult2 = never>(
|
||||
onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,
|
||||
onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null
|
||||
): Promise<TResult1 | TResult2> {
|
||||
return this.#promise.then(onFulfilled, onRejected);
|
||||
}
|
||||
|
||||
public catch<TResult = never>(
|
||||
onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null
|
||||
): Promise<T | TResult> {
|
||||
return this.#promise.catch(onRejected);
|
||||
}
|
||||
|
||||
public finally(onFinally?: (() => void) | null): Promise<T> {
|
||||
return this.#promise.finally(onFinally);
|
||||
}
|
||||
|
||||
public cancel(): void {
|
||||
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
||||
return;
|
||||
}
|
||||
this.#isCancelled = true;
|
||||
if (this.#cancelHandlers.length) {
|
||||
try {
|
||||
for (const cancelHandler of this.#cancelHandlers) {
|
||||
cancelHandler();
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn('Cancellation threw an error', error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.#cancelHandlers.length = 0;
|
||||
if (this.#reject) this.#reject(new CancelError('Request aborted'));
|
||||
}
|
||||
|
||||
public get isCancelled(): boolean {
|
||||
return this.#isCancelled;
|
||||
}
|
||||
}
|
||||
32
src/api/rbac/generated/core/OpenAPI.ts
Normal file
32
src/api/rbac/generated/core/OpenAPI.ts
Normal file
@ -0,0 +1,32 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { ApiRequestOptions } from './ApiRequestOptions';
|
||||
|
||||
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
|
||||
type Headers = Record<string, string>;
|
||||
|
||||
export type OpenAPIConfig = {
|
||||
BASE: string;
|
||||
VERSION: string;
|
||||
WITH_CREDENTIALS: boolean;
|
||||
CREDENTIALS: 'include' | 'omit' | 'same-origin';
|
||||
TOKEN?: string | Resolver<string> | undefined;
|
||||
USERNAME?: string | Resolver<string> | undefined;
|
||||
PASSWORD?: string | Resolver<string> | undefined;
|
||||
HEADERS?: Headers | Resolver<Headers> | undefined;
|
||||
ENCODE_PATH?: ((path: string) => string) | undefined;
|
||||
};
|
||||
|
||||
export const OpenAPI: OpenAPIConfig = {
|
||||
BASE: '',
|
||||
VERSION: '1',
|
||||
WITH_CREDENTIALS: false,
|
||||
CREDENTIALS: 'include',
|
||||
TOKEN: undefined,
|
||||
USERNAME: undefined,
|
||||
PASSWORD: undefined,
|
||||
HEADERS: undefined,
|
||||
ENCODE_PATH: undefined,
|
||||
};
|
||||
329
src/api/rbac/generated/core/request.ts
Normal file
329
src/api/rbac/generated/core/request.ts
Normal file
@ -0,0 +1,329 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import axios from 'axios';
|
||||
import type { AxiosError, AxiosRequestConfig, AxiosResponse, AxiosInstance } from 'axios';
|
||||
// 在浏览器环境中使用原生的 FormData,而不是 Node.js 的 form-data 包
|
||||
// import FormData from 'form-data';
|
||||
|
||||
import { ApiError } from './ApiError';
|
||||
import type { ApiRequestOptions } from './ApiRequestOptions';
|
||||
import type { ApiResult } from './ApiResult';
|
||||
import { CancelablePromise } from './CancelablePromise';
|
||||
import type { OnCancel } from './CancelablePromise';
|
||||
import type { OpenAPIConfig } from './OpenAPI';
|
||||
import { axiosInstance } from '../../axios-config';
|
||||
|
||||
export const isDefined = <T>(value: T | null | undefined): value is Exclude<T, null | undefined> => {
|
||||
return value !== undefined && value !== null;
|
||||
};
|
||||
|
||||
export const isString = (value: any): value is string => {
|
||||
return typeof value === 'string';
|
||||
};
|
||||
|
||||
export const isStringWithValue = (value: any): value is string => {
|
||||
return isString(value) && value !== '';
|
||||
};
|
||||
|
||||
export const isBlob = (value: any): value is Blob => {
|
||||
return (
|
||||
typeof value === 'object' &&
|
||||
typeof value.type === 'string' &&
|
||||
typeof value.stream === 'function' &&
|
||||
typeof value.arrayBuffer === 'function' &&
|
||||
typeof value.constructor === 'function' &&
|
||||
typeof value.constructor.name === 'string' &&
|
||||
/^(Blob|File)$/.test(value.constructor.name) &&
|
||||
/^(Blob|File)$/.test(value[Symbol.toStringTag])
|
||||
);
|
||||
};
|
||||
|
||||
// 在浏览器环境中,FormData 是全局对象
|
||||
export const isFormData = (value: any): value is FormData => {
|
||||
return typeof FormData !== 'undefined' && value instanceof FormData;
|
||||
};
|
||||
|
||||
export const isSuccess = (status: number): boolean => {
|
||||
return status >= 200 && status < 300;
|
||||
};
|
||||
|
||||
export const base64 = (str: string): string => {
|
||||
try {
|
||||
return btoa(str);
|
||||
} catch (err) {
|
||||
// @ts-ignore
|
||||
return Buffer.from(str).toString('base64');
|
||||
}
|
||||
};
|
||||
|
||||
export const getQueryString = (params: Record<string, any>): string => {
|
||||
const qs: string[] = [];
|
||||
|
||||
const append = (key: string, value: any) => {
|
||||
qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
|
||||
};
|
||||
|
||||
const process = (key: string, value: any) => {
|
||||
if (isDefined(value)) {
|
||||
if (Array.isArray(value)) {
|
||||
value.forEach(v => {
|
||||
process(key, v);
|
||||
});
|
||||
} else if (typeof value === 'object') {
|
||||
Object.entries(value).forEach(([k, v]) => {
|
||||
process(`${key}[${k}]`, v);
|
||||
});
|
||||
} else {
|
||||
append(key, value);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Object.entries(params).forEach(([key, value]) => {
|
||||
process(key, value);
|
||||
});
|
||||
|
||||
if (qs.length > 0) {
|
||||
return `?${qs.join('&')}`;
|
||||
}
|
||||
|
||||
return '';
|
||||
};
|
||||
|
||||
const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => {
|
||||
const encoder = config.ENCODE_PATH || encodeURI;
|
||||
|
||||
const path = options.url
|
||||
.replace('{api-version}', config.VERSION)
|
||||
.replace(/{(.*?)}/g, (substring: string, group: string) => {
|
||||
if (options.path?.hasOwnProperty(group)) {
|
||||
return encoder(String(options.path[group]));
|
||||
}
|
||||
return substring;
|
||||
});
|
||||
|
||||
const url = `${config.BASE}${path}`;
|
||||
if (options.query) {
|
||||
return `${url}${getQueryString(options.query)}`;
|
||||
}
|
||||
return url;
|
||||
};
|
||||
|
||||
export const getFormData = (options: ApiRequestOptions): FormData | undefined => {
|
||||
if (options.formData) {
|
||||
const formData = new FormData();
|
||||
|
||||
const process = (key: string, value: any) => {
|
||||
if (isString(value) || isBlob(value)) {
|
||||
formData.append(key, value);
|
||||
} else {
|
||||
formData.append(key, JSON.stringify(value));
|
||||
}
|
||||
};
|
||||
|
||||
Object.entries(options.formData)
|
||||
.filter(([_, value]) => isDefined(value))
|
||||
.forEach(([key, value]) => {
|
||||
if (Array.isArray(value)) {
|
||||
value.forEach(v => process(key, v));
|
||||
} else {
|
||||
process(key, value);
|
||||
}
|
||||
});
|
||||
|
||||
return formData;
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
|
||||
|
||||
export const resolve = async <T>(options: ApiRequestOptions, resolver?: T | Resolver<T>): Promise<T | undefined> => {
|
||||
if (typeof resolver === 'function') {
|
||||
return (resolver as Resolver<T>)(options);
|
||||
}
|
||||
return resolver;
|
||||
};
|
||||
|
||||
export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions, formData?: FormData): Promise<Record<string, string>> => {
|
||||
const [token, username, password, additionalHeaders] = await Promise.all([
|
||||
resolve(options, config.TOKEN),
|
||||
resolve(options, config.USERNAME),
|
||||
resolve(options, config.PASSWORD),
|
||||
resolve(options, config.HEADERS),
|
||||
]);
|
||||
|
||||
// 浏览器原生的 FormData 没有 getHeaders 方法,只有 Node.js 的 form-data 包才有
|
||||
// 在浏览器环境中,FormData 会自动设置正确的 Content-Type(包括 boundary)
|
||||
const formHeaders = (typeof formData !== 'undefined' && typeof (formData as any)?.getHeaders === 'function')
|
||||
? (formData as any).getHeaders()
|
||||
: {}
|
||||
|
||||
const headers = Object.entries({
|
||||
Accept: 'application/json',
|
||||
...additionalHeaders,
|
||||
...options.headers,
|
||||
...formHeaders,
|
||||
})
|
||||
.filter(([_, value]) => isDefined(value))
|
||||
.reduce((headers, [key, value]) => ({
|
||||
...headers,
|
||||
[key]: String(value),
|
||||
}), {} as Record<string, string>);
|
||||
|
||||
if (isStringWithValue(token)) {
|
||||
headers['Authorization'] = `Bearer ${token}`;
|
||||
}
|
||||
|
||||
if (isStringWithValue(username) && isStringWithValue(password)) {
|
||||
const credentials = base64(`${username}:${password}`);
|
||||
headers['Authorization'] = `Basic ${credentials}`;
|
||||
}
|
||||
|
||||
if (options.body) {
|
||||
if (options.mediaType) {
|
||||
headers['Content-Type'] = options.mediaType;
|
||||
} else if (isBlob(options.body)) {
|
||||
headers['Content-Type'] = options.body.type || 'application/octet-stream';
|
||||
} else if (isString(options.body)) {
|
||||
headers['Content-Type'] = 'text/plain';
|
||||
} else if (!isFormData(options.body)) {
|
||||
headers['Content-Type'] = 'application/json';
|
||||
}
|
||||
}
|
||||
|
||||
return headers;
|
||||
};
|
||||
|
||||
export const getRequestBody = (options: ApiRequestOptions): any => {
|
||||
if (options.body) {
|
||||
return options.body;
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
export const sendRequest = async <T>(
|
||||
config: OpenAPIConfig,
|
||||
options: ApiRequestOptions,
|
||||
url: string,
|
||||
body: any,
|
||||
formData: FormData | undefined,
|
||||
headers: Record<string, string>,
|
||||
onCancel: OnCancel,
|
||||
axiosClient: AxiosInstance
|
||||
): Promise<AxiosResponse<T>> => {
|
||||
const source = axios.CancelToken.source();
|
||||
|
||||
const requestConfig: AxiosRequestConfig = {
|
||||
url,
|
||||
headers,
|
||||
data: body ?? formData,
|
||||
method: options.method,
|
||||
withCredentials: config.WITH_CREDENTIALS,
|
||||
cancelToken: source.token,
|
||||
};
|
||||
|
||||
onCancel(() => source.cancel('The user aborted a request.'));
|
||||
|
||||
try {
|
||||
return await axiosClient.request(requestConfig);
|
||||
} catch (error) {
|
||||
const axiosError = error as AxiosError<T>;
|
||||
if (axiosError.response) {
|
||||
return axiosError.response;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
export const getResponseHeader = (response: AxiosResponse<any>, responseHeader?: string): string | undefined => {
|
||||
if (responseHeader) {
|
||||
const content = response.headers[responseHeader];
|
||||
if (isString(content)) {
|
||||
return content;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
export const getResponseBody = (response: AxiosResponse<any>): any => {
|
||||
if (response.status !== 204) {
|
||||
return response.data;
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => {
|
||||
const errors: Record<number, string> = {
|
||||
400: 'Bad Request',
|
||||
401: 'Unauthorized',
|
||||
403: 'Forbidden',
|
||||
404: 'Not Found',
|
||||
500: 'Internal Server Error',
|
||||
502: 'Bad Gateway',
|
||||
503: 'Service Unavailable',
|
||||
...options.errors,
|
||||
}
|
||||
|
||||
const error = errors[result.status];
|
||||
if (error) {
|
||||
throw new ApiError(options, result, error);
|
||||
}
|
||||
|
||||
if (!result.ok) {
|
||||
const errorStatus = result.status ?? 'unknown';
|
||||
const errorStatusText = result.statusText ?? 'unknown';
|
||||
const errorBody = (() => {
|
||||
try {
|
||||
return JSON.stringify(result.body, null, 2);
|
||||
} catch (e) {
|
||||
return undefined;
|
||||
}
|
||||
})();
|
||||
|
||||
throw new ApiError(options, result,
|
||||
`Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Request method
|
||||
* @param config The OpenAPI configuration object
|
||||
* @param options The request options from the service
|
||||
* @param axiosClient The axios client instance to use
|
||||
* @returns CancelablePromise<T>
|
||||
* @throws ApiError
|
||||
*/
|
||||
export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions, axiosClient: AxiosInstance = axiosInstance): CancelablePromise<T> => {
|
||||
return new CancelablePromise(async (resolve, reject, onCancel) => {
|
||||
try {
|
||||
const url = getUrl(config, options);
|
||||
const formData = getFormData(options);
|
||||
const body = getRequestBody(options);
|
||||
const headers = await getHeaders(config, options, formData);
|
||||
|
||||
if (!onCancel.isCancelled) {
|
||||
const response = await sendRequest<T>(config, options, url, body, formData, headers, onCancel, axiosClient);
|
||||
const responseBody = getResponseBody(response);
|
||||
const responseHeader = getResponseHeader(response, options.responseHeader);
|
||||
|
||||
const result: ApiResult = {
|
||||
url,
|
||||
ok: isSuccess(response.status),
|
||||
status: response.status,
|
||||
statusText: response.statusText,
|
||||
body: responseHeader ?? responseBody,
|
||||
};
|
||||
|
||||
catchErrorCodes(options, result);
|
||||
|
||||
resolve(result.body);
|
||||
}
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
};
|
||||
42
src/api/rbac/generated/index.ts
Normal file
42
src/api/rbac/generated/index.ts
Normal file
@ -0,0 +1,42 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export { ApiError } from './core/ApiError';
|
||||
export { CancelablePromise, CancelError } from './core/CancelablePromise';
|
||||
export { OpenAPI } from './core/OpenAPI';
|
||||
export type { OpenAPIConfig } from './core/OpenAPI';
|
||||
|
||||
export type { ApplicationExceptionResult } from './models/ApplicationExceptionResult';
|
||||
export type { MenuCreateDto } from './models/MenuCreateDto';
|
||||
export type { MenuDto } from './models/MenuDto';
|
||||
export type { MenuTreeDto } from './models/MenuTreeDto';
|
||||
export { MenuType } from './models/MenuType';
|
||||
export type { MenuUpdateDto } from './models/MenuUpdateDto';
|
||||
export type { OrganizationCreateDto } from './models/OrganizationCreateDto';
|
||||
export type { OrganizationDto } from './models/OrganizationDto';
|
||||
export type { OrganizationMoveDto } from './models/OrganizationMoveDto';
|
||||
export type { OrganizationTreeDto } from './models/OrganizationTreeDto';
|
||||
export type { OrganizationType } from './models/OrganizationType';
|
||||
export type { OrganizationUpdateDto } from './models/OrganizationUpdateDto';
|
||||
export type { PermissionDefinitionDto } from './models/PermissionDefinitionDto';
|
||||
export type { PermissionGroupDto } from './models/PermissionGroupDto';
|
||||
export type { RoleCreateDto } from './models/RoleCreateDto';
|
||||
export type { RoleDto } from './models/RoleDto';
|
||||
export type { RoleDtoPagedResultDto } from './models/RoleDtoPagedResultDto';
|
||||
export type { RoleSimpleDto } from './models/RoleSimpleDto';
|
||||
export type { RoleUpdateDto } from './models/RoleUpdateDto';
|
||||
export type { UpdatePasswordDto } from './models/UpdatePasswordDto';
|
||||
export type { UserCreateDto } from './models/UserCreateDto';
|
||||
export type { UserDto } from './models/UserDto';
|
||||
export type { UserDtoPagedResultDto } from './models/UserDtoPagedResultDto';
|
||||
export type { UserInfoDto } from './models/UserInfoDto';
|
||||
export type { UserSimpleDto } from './models/UserSimpleDto';
|
||||
export type { UserUpdateDto } from './models/UserUpdateDto';
|
||||
|
||||
export { AuthService } from './services/AuthService';
|
||||
export { MenuService } from './services/MenuService';
|
||||
export { OrganizationService } from './services/OrganizationService';
|
||||
export { PermissionService } from './services/PermissionService';
|
||||
export { RoleService } from './services/RoleService';
|
||||
export { UserService } from './services/UserService';
|
||||
@ -0,0 +1,9 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type ApplicationExceptionResult = {
|
||||
message?: string | null;
|
||||
details?: string | null;
|
||||
};
|
||||
|
||||
52
src/api/rbac/generated/models/MenuCreateDto.ts
Normal file
52
src/api/rbac/generated/models/MenuCreateDto.ts
Normal file
@ -0,0 +1,52 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { MenuType } from './MenuType';
|
||||
/**
|
||||
* 创建菜单 DTO
|
||||
*/
|
||||
export type MenuCreateDto = {
|
||||
/**
|
||||
* 父级菜单ID
|
||||
*/
|
||||
pId?: string | null;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* 权限代码
|
||||
*/
|
||||
permissionCode?: string | null;
|
||||
type: MenuType;
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
icon?: string | null;
|
||||
/**
|
||||
* 路由
|
||||
*/
|
||||
route?: string | null;
|
||||
/**
|
||||
* 组件
|
||||
*/
|
||||
component?: string | null;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
order?: number;
|
||||
/**
|
||||
* 是否隐藏
|
||||
*/
|
||||
isHidden?: boolean;
|
||||
/**
|
||||
* 是否缓存
|
||||
*/
|
||||
isCached?: boolean;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
description?: string | null;
|
||||
};
|
||||
|
||||
57
src/api/rbac/generated/models/MenuDto.ts
Normal file
57
src/api/rbac/generated/models/MenuDto.ts
Normal file
@ -0,0 +1,57 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { MenuType } from './MenuType';
|
||||
/**
|
||||
* 菜单 DTO
|
||||
*/
|
||||
export type MenuDto = {
|
||||
id?: string;
|
||||
createdAt?: string;
|
||||
createdBy?: string | null;
|
||||
updatedAt?: string | null;
|
||||
updatedBy?: string | null;
|
||||
/**
|
||||
* 父级菜单ID
|
||||
*/
|
||||
pId?: string;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
name?: string | null;
|
||||
/**
|
||||
* 权限代码
|
||||
*/
|
||||
permissionCode?: string | null;
|
||||
type?: MenuType;
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
icon?: string | null;
|
||||
/**
|
||||
* 路由
|
||||
*/
|
||||
route?: string | null;
|
||||
/**
|
||||
* 组件
|
||||
*/
|
||||
component?: string | null;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
order?: number;
|
||||
/**
|
||||
* 是否隐藏
|
||||
*/
|
||||
isHidden?: boolean;
|
||||
/**
|
||||
* 是否缓存
|
||||
*/
|
||||
isCached?: boolean;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
description?: string | null;
|
||||
};
|
||||
|
||||
61
src/api/rbac/generated/models/MenuTreeDto.ts
Normal file
61
src/api/rbac/generated/models/MenuTreeDto.ts
Normal file
@ -0,0 +1,61 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { MenuType } from './MenuType';
|
||||
/**
|
||||
* 菜单树 DTO
|
||||
*/
|
||||
export type MenuTreeDto = {
|
||||
id?: string;
|
||||
createdAt?: string;
|
||||
createdBy?: string | null;
|
||||
updatedAt?: string | null;
|
||||
updatedBy?: string | null;
|
||||
/**
|
||||
* 父级菜单ID
|
||||
*/
|
||||
pId?: string;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
name?: string | null;
|
||||
/**
|
||||
* 权限代码
|
||||
*/
|
||||
permissionCode?: string | null;
|
||||
type?: MenuType;
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
icon?: string | null;
|
||||
/**
|
||||
* 路由
|
||||
*/
|
||||
route?: string | null;
|
||||
/**
|
||||
* 组件
|
||||
*/
|
||||
component?: string | null;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
order?: number;
|
||||
/**
|
||||
* 是否隐藏
|
||||
*/
|
||||
isHidden?: boolean;
|
||||
/**
|
||||
* 是否缓存
|
||||
*/
|
||||
isCached?: boolean;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
description?: string | null;
|
||||
/**
|
||||
* 子菜单列表
|
||||
*/
|
||||
children?: Array<MenuTreeDto> | null;
|
||||
};
|
||||
|
||||
8
src/api/rbac/generated/models/MenuType.ts
Normal file
8
src/api/rbac/generated/models/MenuType.ts
Normal file
@ -0,0 +1,8 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export enum MenuType {
|
||||
'_1' = 1,
|
||||
'_2' = 2,
|
||||
}
|
||||
42
src/api/rbac/generated/models/MenuUpdateDto.ts
Normal file
42
src/api/rbac/generated/models/MenuUpdateDto.ts
Normal file
@ -0,0 +1,42 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* 更新菜单 DTO
|
||||
*/
|
||||
export type MenuUpdateDto = {
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
name?: string | null;
|
||||
/**
|
||||
* 权限代码
|
||||
*/
|
||||
permissionCode?: string | null;
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
icon?: string | null;
|
||||
/**
|
||||
* 路由
|
||||
*/
|
||||
route?: string | null;
|
||||
/**
|
||||
* 组件
|
||||
*/
|
||||
component?: string | null;
|
||||
/**
|
||||
* 是否隐藏
|
||||
*/
|
||||
isHidden?: boolean | null;
|
||||
/**
|
||||
* 是否缓存
|
||||
*/
|
||||
isCached?: boolean | null;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
description?: string | null;
|
||||
};
|
||||
|
||||
16
src/api/rbac/generated/models/OrganizationCreateDto.ts
Normal file
16
src/api/rbac/generated/models/OrganizationCreateDto.ts
Normal file
@ -0,0 +1,16 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { OrganizationType } from './OrganizationType';
|
||||
export type OrganizationCreateDto = {
|
||||
parentId?: string | null;
|
||||
name?: string | null;
|
||||
code?: string | null;
|
||||
type?: OrganizationType;
|
||||
leaderId?: string | null;
|
||||
order?: number;
|
||||
description?: string | null;
|
||||
isEnabled?: boolean;
|
||||
};
|
||||
|
||||
22
src/api/rbac/generated/models/OrganizationDto.ts
Normal file
22
src/api/rbac/generated/models/OrganizationDto.ts
Normal file
@ -0,0 +1,22 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { OrganizationType } from './OrganizationType';
|
||||
export type OrganizationDto = {
|
||||
id?: string;
|
||||
parentId?: string | null;
|
||||
name?: string | null;
|
||||
code?: string | null;
|
||||
type?: OrganizationType;
|
||||
leaderId?: string | null;
|
||||
leaderName?: string | null;
|
||||
order?: number;
|
||||
description?: string | null;
|
||||
isEnabled?: boolean;
|
||||
createdBy?: string;
|
||||
createdAt?: string;
|
||||
updatedBy?: string;
|
||||
updatedAt?: string;
|
||||
};
|
||||
|
||||
8
src/api/rbac/generated/models/OrganizationMoveDto.ts
Normal file
8
src/api/rbac/generated/models/OrganizationMoveDto.ts
Normal file
@ -0,0 +1,8 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type OrganizationMoveDto = {
|
||||
newParentId?: string | null;
|
||||
};
|
||||
|
||||
18
src/api/rbac/generated/models/OrganizationTreeDto.ts
Normal file
18
src/api/rbac/generated/models/OrganizationTreeDto.ts
Normal file
@ -0,0 +1,18 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { OrganizationType } from './OrganizationType';
|
||||
export type OrganizationTreeDto = {
|
||||
id?: string;
|
||||
parentId?: string | null;
|
||||
name?: string | null;
|
||||
code?: string | null;
|
||||
type?: OrganizationType;
|
||||
leaderId?: string | null;
|
||||
leaderName?: string | null;
|
||||
order?: number;
|
||||
isEnabled?: boolean;
|
||||
children?: Array<OrganizationTreeDto> | null;
|
||||
};
|
||||
|
||||
6
src/api/rbac/generated/models/OrganizationType.ts
Normal file
6
src/api/rbac/generated/models/OrganizationType.ts
Normal file
@ -0,0 +1,6 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type OrganizationType = 1 | 2 | 3;
|
||||
|
||||
14
src/api/rbac/generated/models/OrganizationUpdateDto.ts
Normal file
14
src/api/rbac/generated/models/OrganizationUpdateDto.ts
Normal file
@ -0,0 +1,14 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { OrganizationType } from './OrganizationType';
|
||||
export type OrganizationUpdateDto = {
|
||||
name?: string | null;
|
||||
type?: OrganizationType;
|
||||
leaderId?: string | null;
|
||||
order?: number | null;
|
||||
description?: string | null;
|
||||
isEnabled?: boolean | null;
|
||||
};
|
||||
|
||||
30
src/api/rbac/generated/models/PermissionDefinitionDto.ts
Normal file
30
src/api/rbac/generated/models/PermissionDefinitionDto.ts
Normal file
@ -0,0 +1,30 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* 权限定义 DTO
|
||||
*/
|
||||
export type PermissionDefinitionDto = {
|
||||
/**
|
||||
* 权限代码
|
||||
*/
|
||||
code?: string | null;
|
||||
/**
|
||||
* 权限名称
|
||||
*/
|
||||
name?: string | null;
|
||||
/**
|
||||
* 父级权限代码
|
||||
*/
|
||||
parentCode?: string | null;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
description?: string | null;
|
||||
/**
|
||||
* 子权限列表
|
||||
*/
|
||||
children?: Array<PermissionDefinitionDto> | null;
|
||||
};
|
||||
|
||||
23
src/api/rbac/generated/models/PermissionGroupDto.ts
Normal file
23
src/api/rbac/generated/models/PermissionGroupDto.ts
Normal file
@ -0,0 +1,23 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { PermissionDefinitionDto } from './PermissionDefinitionDto';
|
||||
/**
|
||||
* 权限分组 DTO
|
||||
*/
|
||||
export type PermissionGroupDto = {
|
||||
/**
|
||||
* 分组代码
|
||||
*/
|
||||
code?: string | null;
|
||||
/**
|
||||
* 分组名称
|
||||
*/
|
||||
name?: string | null;
|
||||
/**
|
||||
* 权限列表
|
||||
*/
|
||||
permissions?: Array<PermissionDefinitionDto> | null;
|
||||
};
|
||||
|
||||
22
src/api/rbac/generated/models/RoleCreateDto.ts
Normal file
22
src/api/rbac/generated/models/RoleCreateDto.ts
Normal file
@ -0,0 +1,22 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* 创建角色 DTO
|
||||
*/
|
||||
export type RoleCreateDto = {
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
code: string;
|
||||
/**
|
||||
* 权限列表
|
||||
*/
|
||||
permissions?: Array<string> | null;
|
||||
};
|
||||
|
||||
27
src/api/rbac/generated/models/RoleDto.ts
Normal file
27
src/api/rbac/generated/models/RoleDto.ts
Normal file
@ -0,0 +1,27 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* 角色 DTO
|
||||
*/
|
||||
export type RoleDto = {
|
||||
id?: string;
|
||||
createdAt?: string;
|
||||
createdBy?: string | null;
|
||||
updatedAt?: string | null;
|
||||
updatedBy?: string | null;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
name?: string | null;
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
code?: string | null;
|
||||
/**
|
||||
* 权限列表
|
||||
*/
|
||||
permissions?: Array<string> | null;
|
||||
};
|
||||
|
||||
19
src/api/rbac/generated/models/RoleDtoPagedResultDto.ts
Normal file
19
src/api/rbac/generated/models/RoleDtoPagedResultDto.ts
Normal file
@ -0,0 +1,19 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { RoleDto } from './RoleDto';
|
||||
/**
|
||||
* 分页结果 DTO
|
||||
*/
|
||||
export type RoleDtoPagedResultDto = {
|
||||
/**
|
||||
* 总数量
|
||||
*/
|
||||
total?: number;
|
||||
/**
|
||||
* 数据列表
|
||||
*/
|
||||
items?: Array<RoleDto> | null;
|
||||
};
|
||||
|
||||
19
src/api/rbac/generated/models/RoleSimpleDto.ts
Normal file
19
src/api/rbac/generated/models/RoleSimpleDto.ts
Normal file
@ -0,0 +1,19 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* 角色简单 DTO
|
||||
*/
|
||||
export type RoleSimpleDto = {
|
||||
id?: string;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
name?: string | null;
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
code?: string | null;
|
||||
};
|
||||
|
||||
14
src/api/rbac/generated/models/RoleUpdateDto.ts
Normal file
14
src/api/rbac/generated/models/RoleUpdateDto.ts
Normal file
@ -0,0 +1,14 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* 更新角色 DTO
|
||||
*/
|
||||
export type RoleUpdateDto = {
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
name?: string | null;
|
||||
};
|
||||
|
||||
18
src/api/rbac/generated/models/UpdatePasswordDto.ts
Normal file
18
src/api/rbac/generated/models/UpdatePasswordDto.ts
Normal file
@ -0,0 +1,18 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* 修改密码 DTO
|
||||
*/
|
||||
export type UpdatePasswordDto = {
|
||||
/**
|
||||
* 旧密码
|
||||
*/
|
||||
oldPassword: string;
|
||||
/**
|
||||
* 新密码
|
||||
*/
|
||||
newPassword: string;
|
||||
};
|
||||
|
||||
34
src/api/rbac/generated/models/UserCreateDto.ts
Normal file
34
src/api/rbac/generated/models/UserCreateDto.ts
Normal file
@ -0,0 +1,34 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* 创建用户 DTO
|
||||
*/
|
||||
export type UserCreateDto = {
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
account: string;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
password: string;
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
email?: string | null;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
avatar?: string | null;
|
||||
/**
|
||||
* 角色ID列表
|
||||
*/
|
||||
roleIds?: Array<string> | null;
|
||||
};
|
||||
|
||||
36
src/api/rbac/generated/models/UserDto.ts
Normal file
36
src/api/rbac/generated/models/UserDto.ts
Normal file
@ -0,0 +1,36 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { RoleSimpleDto } from './RoleSimpleDto';
|
||||
/**
|
||||
* 用户 DTO
|
||||
*/
|
||||
export type UserDto = {
|
||||
id?: string;
|
||||
createdAt?: string;
|
||||
createdBy?: string | null;
|
||||
updatedAt?: string | null;
|
||||
updatedBy?: string | null;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
name?: string | null;
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
account?: string | null;
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
email?: string | null;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
avatar?: string | null;
|
||||
/**
|
||||
* 角色列表
|
||||
*/
|
||||
roles?: Array<RoleSimpleDto> | null;
|
||||
};
|
||||
|
||||
19
src/api/rbac/generated/models/UserDtoPagedResultDto.ts
Normal file
19
src/api/rbac/generated/models/UserDtoPagedResultDto.ts
Normal file
@ -0,0 +1,19 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { UserDto } from './UserDto';
|
||||
/**
|
||||
* 分页结果 DTO
|
||||
*/
|
||||
export type UserDtoPagedResultDto = {
|
||||
/**
|
||||
* 总数量
|
||||
*/
|
||||
total?: number;
|
||||
/**
|
||||
* 数据列表
|
||||
*/
|
||||
items?: Array<UserDto> | null;
|
||||
};
|
||||
|
||||
45
src/api/rbac/generated/models/UserInfoDto.ts
Normal file
45
src/api/rbac/generated/models/UserInfoDto.ts
Normal file
@ -0,0 +1,45 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { MenuTreeDto } from './MenuTreeDto';
|
||||
import type { RoleSimpleDto } from './RoleSimpleDto';
|
||||
/**
|
||||
* 用户信息 DTO(包含权限和菜单)
|
||||
*/
|
||||
export type UserInfoDto = {
|
||||
id?: string;
|
||||
createdAt?: string;
|
||||
createdBy?: string | null;
|
||||
updatedAt?: string | null;
|
||||
updatedBy?: string | null;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
name?: string | null;
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
account?: string | null;
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
email?: string | null;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
avatar?: string | null;
|
||||
/**
|
||||
* 角色列表
|
||||
*/
|
||||
roles?: Array<RoleSimpleDto> | null;
|
||||
/**
|
||||
* 权限列表
|
||||
*/
|
||||
permissions?: Array<string> | null;
|
||||
/**
|
||||
* 菜单列表
|
||||
*/
|
||||
menus?: Array<MenuTreeDto> | null;
|
||||
};
|
||||
|
||||
23
src/api/rbac/generated/models/UserSimpleDto.ts
Normal file
23
src/api/rbac/generated/models/UserSimpleDto.ts
Normal file
@ -0,0 +1,23 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* 用户简单 DTO
|
||||
*/
|
||||
export type UserSimpleDto = {
|
||||
id?: string;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
name?: string | null;
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
account?: string | null;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
avatar?: string | null;
|
||||
};
|
||||
|
||||
22
src/api/rbac/generated/models/UserUpdateDto.ts
Normal file
22
src/api/rbac/generated/models/UserUpdateDto.ts
Normal file
@ -0,0 +1,22 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* 更新用户 DTO
|
||||
*/
|
||||
export type UserUpdateDto = {
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
name?: string | null;
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
email?: string | null;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
avatar?: string | null;
|
||||
};
|
||||
|
||||
76
src/api/rbac/generated/services/AuthService.ts
Normal file
76
src/api/rbac/generated/services/AuthService.ts
Normal file
@ -0,0 +1,76 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { UserInfoDto } from '../models/UserInfoDto';
|
||||
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||
import { OpenAPI } from '../core/OpenAPI';
|
||||
import { request as __request } from '../core/request';
|
||||
export class AuthService {
|
||||
/**
|
||||
* @param account
|
||||
* @param password
|
||||
* @returns UserInfoDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static postRbacAuthLogin(
|
||||
account?: string,
|
||||
password?: string,
|
||||
): CancelablePromise<UserInfoDto> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/rbac/auth/login',
|
||||
query: {
|
||||
'account': account,
|
||||
'password': password,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param userId
|
||||
* @returns UserInfoDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getRbacAuthGetCurrentUser(
|
||||
userId?: string,
|
||||
): CancelablePromise<UserInfoDto> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/rbac/auth/get-current-user',
|
||||
query: {
|
||||
'userId': userId,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param userId
|
||||
* @param oldPassword
|
||||
* @param newPassword
|
||||
* @returns any Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static postRbacAuthChangePassword(
|
||||
userId?: string,
|
||||
oldPassword?: string,
|
||||
newPassword?: string,
|
||||
): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/rbac/auth/change-password',
|
||||
query: {
|
||||
'userId': userId,
|
||||
'oldPassword': oldPassword,
|
||||
'newPassword': newPassword,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
168
src/api/rbac/generated/services/MenuService.ts
Normal file
168
src/api/rbac/generated/services/MenuService.ts
Normal file
@ -0,0 +1,168 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { MenuCreateDto } from '../models/MenuCreateDto';
|
||||
import type { MenuDto } from '../models/MenuDto';
|
||||
import type { MenuTreeDto } from '../models/MenuTreeDto';
|
||||
import type { MenuUpdateDto } from '../models/MenuUpdateDto';
|
||||
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||
import { OpenAPI } from '../core/OpenAPI';
|
||||
import { request as __request } from '../core/request';
|
||||
export class MenuService {
|
||||
/**
|
||||
* @param id
|
||||
* @returns MenuDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getRbacMenuGet(
|
||||
id?: string,
|
||||
): CancelablePromise<MenuDto> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/rbac/menu/get',
|
||||
query: {
|
||||
'id': id,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @returns MenuTreeDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getRbacMenuGetMenuTree(): CancelablePromise<Array<MenuTreeDto>> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/rbac/menu/get-menu-tree',
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param userId
|
||||
* @returns MenuTreeDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getRbacMenuGetUserMenus(
|
||||
userId?: string,
|
||||
): CancelablePromise<Array<MenuTreeDto>> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/rbac/menu/get-user-menus',
|
||||
query: {
|
||||
'userId': userId,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param requestBody
|
||||
* @returns MenuDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static postRbacMenuCreate(
|
||||
requestBody?: MenuCreateDto,
|
||||
): CancelablePromise<MenuDto> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/rbac/menu/create',
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param id
|
||||
* @param requestBody
|
||||
* @returns MenuDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static putRbacMenuUpdate(
|
||||
id?: string,
|
||||
requestBody?: MenuUpdateDto,
|
||||
): CancelablePromise<MenuDto> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'PUT',
|
||||
url: '/rbac/menu/update',
|
||||
query: {
|
||||
'id': id,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param id
|
||||
* @param order
|
||||
* @returns any Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static putRbacMenuUpdateOrder(
|
||||
id?: string,
|
||||
order?: number,
|
||||
): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'PUT',
|
||||
url: '/rbac/menu/update-order',
|
||||
query: {
|
||||
'id': id,
|
||||
'order': order,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param id
|
||||
* @returns any Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static deleteRbacMenuDelete(
|
||||
id?: string,
|
||||
): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'DELETE',
|
||||
url: '/rbac/menu/delete',
|
||||
query: {
|
||||
'id': id,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param menuId
|
||||
* @param targetParentId
|
||||
* @returns any Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static postRbacMenuMoveMenu(
|
||||
menuId?: string,
|
||||
targetParentId?: string,
|
||||
): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/rbac/menu/move-menu',
|
||||
query: {
|
||||
'menuId': menuId,
|
||||
'targetParentId': targetParentId,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
148
src/api/rbac/generated/services/OrganizationService.ts
Normal file
148
src/api/rbac/generated/services/OrganizationService.ts
Normal file
@ -0,0 +1,148 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { OrganizationCreateDto } from '../models/OrganizationCreateDto';
|
||||
import type { OrganizationDto } from '../models/OrganizationDto';
|
||||
import type { OrganizationMoveDto } from '../models/OrganizationMoveDto';
|
||||
import type { OrganizationTreeDto } from '../models/OrganizationTreeDto';
|
||||
import type { OrganizationUpdateDto } from '../models/OrganizationUpdateDto';
|
||||
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||
import { OpenAPI } from '../core/OpenAPI';
|
||||
import { request as __request } from '../core/request';
|
||||
export class OrganizationService {
|
||||
/**
|
||||
* @returns OrganizationDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getRbacOrganizationGet({
|
||||
id,
|
||||
}: {
|
||||
id?: string,
|
||||
}): CancelablePromise<OrganizationDto> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/rbac/organization/get',
|
||||
query: {
|
||||
'id': id,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @returns OrganizationDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getRbacOrganizationGetList(): CancelablePromise<Array<OrganizationDto>> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/rbac/organization/get-list',
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @returns OrganizationTreeDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getRbacOrganizationGetTree(): CancelablePromise<Array<OrganizationTreeDto>> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/rbac/organization/get-tree',
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @returns OrganizationDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static postRbacOrganizationCreate({
|
||||
requestBody,
|
||||
}: {
|
||||
requestBody?: OrganizationCreateDto,
|
||||
}): CancelablePromise<OrganizationDto> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/rbac/organization/create',
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @returns OrganizationDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static putRbacOrganizationUpdate({
|
||||
id,
|
||||
requestBody,
|
||||
}: {
|
||||
id?: string,
|
||||
requestBody?: OrganizationUpdateDto,
|
||||
}): CancelablePromise<OrganizationDto> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'PUT',
|
||||
url: '/rbac/organization/update',
|
||||
query: {
|
||||
'id': id,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @returns any Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static deleteRbacOrganizationDelete({
|
||||
id,
|
||||
}: {
|
||||
id?: string,
|
||||
}): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'DELETE',
|
||||
url: '/rbac/organization/delete',
|
||||
query: {
|
||||
'id': id,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @returns any Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static postRbacOrganizationMove({
|
||||
id,
|
||||
requestBody,
|
||||
}: {
|
||||
id?: string,
|
||||
requestBody?: OrganizationMoveDto,
|
||||
}): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/rbac/organization/move',
|
||||
query: {
|
||||
'id': id,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
82
src/api/rbac/generated/services/PermissionService.ts
Normal file
82
src/api/rbac/generated/services/PermissionService.ts
Normal file
@ -0,0 +1,82 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { PermissionDefinitionDto } from '../models/PermissionDefinitionDto';
|
||||
import type { PermissionGroupDto } from '../models/PermissionGroupDto';
|
||||
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||
import { OpenAPI } from '../core/OpenAPI';
|
||||
import { request as __request } from '../core/request';
|
||||
export class PermissionService {
|
||||
/**
|
||||
* @returns PermissionDefinitionDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getRbacPermissionGetAllPermissions(): CancelablePromise<Array<PermissionDefinitionDto>> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/rbac/permission/get-all-permissions',
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @returns PermissionGroupDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getRbacPermissionGetPermissionTree(): CancelablePromise<Array<PermissionGroupDto>> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/rbac/permission/get-permission-tree',
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param userId
|
||||
* @param permissionCode
|
||||
* @returns boolean Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static postRbacPermissionCheckPermission(
|
||||
userId?: string,
|
||||
permissionCode?: string,
|
||||
): CancelablePromise<boolean> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/rbac/permission/check-permission',
|
||||
query: {
|
||||
'userId': userId,
|
||||
'permissionCode': permissionCode,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param userId
|
||||
* @param requestBody
|
||||
* @returns boolean Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static postRbacPermissionCheckPermissions(
|
||||
userId?: string,
|
||||
requestBody?: Array<string>,
|
||||
): CancelablePromise<Record<string, boolean>> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/rbac/permission/check-permissions',
|
||||
query: {
|
||||
'userId': userId,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
218
src/api/rbac/generated/services/RoleService.ts
Normal file
218
src/api/rbac/generated/services/RoleService.ts
Normal file
@ -0,0 +1,218 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { RoleCreateDto } from '../models/RoleCreateDto';
|
||||
import type { RoleDto } from '../models/RoleDto';
|
||||
import type { RoleDtoPagedResultDto } from '../models/RoleDtoPagedResultDto';
|
||||
import type { RoleSimpleDto } from '../models/RoleSimpleDto';
|
||||
import type { RoleUpdateDto } from '../models/RoleUpdateDto';
|
||||
import type { UserSimpleDto } from '../models/UserSimpleDto';
|
||||
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||
import { OpenAPI } from '../core/OpenAPI';
|
||||
import { request as __request } from '../core/request';
|
||||
export class RoleService {
|
||||
/**
|
||||
* @param id
|
||||
* @returns RoleDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getRbacRoleGet(
|
||||
id?: string,
|
||||
): CancelablePromise<RoleDto> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/rbac/role/get',
|
||||
query: {
|
||||
'id': id,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param keyword 关键字(搜索名称或编码)
|
||||
* @param page 页码(从1开始)
|
||||
* @param pageSize 每页数量
|
||||
* @param orderBy 排序字段
|
||||
* @param descending 是否降序
|
||||
* @returns RoleDtoPagedResultDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getRbacRoleGetList(
|
||||
keyword?: string,
|
||||
page?: number,
|
||||
pageSize?: number,
|
||||
orderBy?: string,
|
||||
descending?: boolean,
|
||||
): CancelablePromise<RoleDtoPagedResultDto> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/rbac/role/get-list',
|
||||
query: {
|
||||
'Keyword': keyword,
|
||||
'Page': page,
|
||||
'PageSize': pageSize,
|
||||
'OrderBy': orderBy,
|
||||
'Descending': descending,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @returns RoleSimpleDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getRbacRoleGetAllRoles(): CancelablePromise<Array<RoleSimpleDto>> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/rbac/role/get-all-roles',
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param requestBody
|
||||
* @returns RoleDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static postRbacRoleCreate(
|
||||
requestBody?: RoleCreateDto,
|
||||
): CancelablePromise<RoleDto> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/rbac/role/create',
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param id
|
||||
* @param requestBody
|
||||
* @returns RoleDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static putRbacRoleUpdate(
|
||||
id?: string,
|
||||
requestBody?: RoleUpdateDto,
|
||||
): CancelablePromise<RoleDto> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'PUT',
|
||||
url: '/rbac/role/update',
|
||||
query: {
|
||||
'id': id,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param id
|
||||
* @returns any Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static deleteRbacRoleDelete(
|
||||
id?: string,
|
||||
): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'DELETE',
|
||||
url: '/rbac/role/delete',
|
||||
query: {
|
||||
'id': id,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param roleId
|
||||
* @param requestBody
|
||||
* @returns any Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static postRbacRoleAssignPermissions(
|
||||
roleId?: string,
|
||||
requestBody?: Array<string>,
|
||||
): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/rbac/role/assign-permissions',
|
||||
query: {
|
||||
'roleId': roleId,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param roleId
|
||||
* @returns string Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getRbacRoleGetRolePermissions(
|
||||
roleId?: string,
|
||||
): CancelablePromise<Array<string>> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/rbac/role/get-role-permissions',
|
||||
query: {
|
||||
'roleId': roleId,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param roleId
|
||||
* @returns UserSimpleDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getRbacRoleGetRoleUsers(
|
||||
roleId?: string,
|
||||
): CancelablePromise<Array<UserSimpleDto>> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/rbac/role/get-role-users',
|
||||
query: {
|
||||
'roleId': roleId,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param roleId
|
||||
* @returns number Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getRbacRoleGetRoleUserCount(
|
||||
roleId?: string,
|
||||
): CancelablePromise<number> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/rbac/role/get-role-user-count',
|
||||
query: {
|
||||
'roleId': roleId,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
295
src/api/rbac/generated/services/UserService.ts
Normal file
295
src/api/rbac/generated/services/UserService.ts
Normal file
@ -0,0 +1,295 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { RoleDto } from '../models/RoleDto';
|
||||
import type { UpdatePasswordDto } from '../models/UpdatePasswordDto';
|
||||
import type { UserCreateDto } from '../models/UserCreateDto';
|
||||
import type { UserDto } from '../models/UserDto';
|
||||
import type { UserDtoPagedResultDto } from '../models/UserDtoPagedResultDto';
|
||||
import type { UserSimpleDto } from '../models/UserSimpleDto';
|
||||
import type { UserUpdateDto } from '../models/UserUpdateDto';
|
||||
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||
import { OpenAPI } from '../core/OpenAPI';
|
||||
import { request as __request } from '../core/request';
|
||||
export class UserService {
|
||||
/**
|
||||
* @param id
|
||||
* @returns UserDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getRbacUserGet(
|
||||
id?: string,
|
||||
): CancelablePromise<UserDto> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/rbac/user/get',
|
||||
query: {
|
||||
'id': id,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param keyword 关键字(搜索名称或账号)
|
||||
* @param roleId 角色ID
|
||||
* @param page 页码(从1开始)
|
||||
* @param pageSize 每页数量
|
||||
* @param orderBy 排序字段
|
||||
* @param descending 是否降序
|
||||
* @returns UserDtoPagedResultDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getRbacUserGetList(
|
||||
keyword?: string,
|
||||
roleId?: string,
|
||||
page?: number,
|
||||
pageSize?: number,
|
||||
orderBy?: string,
|
||||
descending?: boolean,
|
||||
): CancelablePromise<UserDtoPagedResultDto> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/rbac/user/get-list',
|
||||
query: {
|
||||
'Keyword': keyword,
|
||||
'RoleId': roleId,
|
||||
'Page': page,
|
||||
'PageSize': pageSize,
|
||||
'OrderBy': orderBy,
|
||||
'Descending': descending,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param roleId
|
||||
* @returns UserSimpleDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getRbacUserGetUsersByRole(
|
||||
roleId?: string,
|
||||
): CancelablePromise<Array<UserSimpleDto>> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/rbac/user/get-users-by-role',
|
||||
query: {
|
||||
'roleId': roleId,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param requestBody
|
||||
* @returns UserDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static postRbacUserCreate(
|
||||
requestBody?: UserCreateDto,
|
||||
): CancelablePromise<UserDto> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/rbac/user/create',
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param id
|
||||
* @param requestBody
|
||||
* @returns UserDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static putRbacUserUpdate(
|
||||
id?: string,
|
||||
requestBody?: UserUpdateDto,
|
||||
): CancelablePromise<UserDto> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'PUT',
|
||||
url: '/rbac/user/update',
|
||||
query: {
|
||||
'id': id,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param id
|
||||
* @param requestBody
|
||||
* @returns any Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static putRbacUserUpdatePassword(
|
||||
id?: string,
|
||||
requestBody?: UpdatePasswordDto,
|
||||
): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'PUT',
|
||||
url: '/rbac/user/update-password',
|
||||
query: {
|
||||
'id': id,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param id
|
||||
* @param avatarUrl
|
||||
* @returns any Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static putRbacUserUpdateAvatar(
|
||||
id?: string,
|
||||
avatarUrl?: string,
|
||||
): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'PUT',
|
||||
url: '/rbac/user/update-avatar',
|
||||
query: {
|
||||
'id': id,
|
||||
'avatarUrl': avatarUrl,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param id
|
||||
* @returns any Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static deleteRbacUserDelete(
|
||||
id?: string,
|
||||
): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'DELETE',
|
||||
url: '/rbac/user/delete',
|
||||
query: {
|
||||
'id': id,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param ids
|
||||
* @returns any Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static deleteRbacUserDeleteBatch(
|
||||
ids?: Array<string>,
|
||||
): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'DELETE',
|
||||
url: '/rbac/user/delete-batch',
|
||||
query: {
|
||||
'ids': ids,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param userId
|
||||
* @param requestBody
|
||||
* @returns any Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static postRbacUserAssignRoles(
|
||||
userId?: string,
|
||||
requestBody?: Array<string>,
|
||||
): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/rbac/user/assign-roles',
|
||||
query: {
|
||||
'userId': userId,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param userId
|
||||
* @returns RoleDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getRbacUserGetUserRoles(
|
||||
userId?: string,
|
||||
): CancelablePromise<Array<RoleDto>> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/rbac/user/get-user-roles',
|
||||
query: {
|
||||
'userId': userId,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param userId
|
||||
* @returns string Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getRbacUserGetUserPermissions(
|
||||
userId?: string,
|
||||
): CancelablePromise<Array<string>> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/rbac/user/get-user-permissions',
|
||||
query: {
|
||||
'userId': userId,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param userId
|
||||
* @param permissionCode
|
||||
* @returns boolean Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static postRbacUserHasPermission(
|
||||
userId?: string,
|
||||
permissionCode?: string,
|
||||
): CancelablePromise<boolean> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/rbac/user/has-permission',
|
||||
query: {
|
||||
'userId': userId,
|
||||
'permissionCode': permissionCode,
|
||||
},
|
||||
errors: {
|
||||
400: `Bad Request`,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
42
src/api/rbac/index.ts
Normal file
42
src/api/rbac/index.ts
Normal file
@ -0,0 +1,42 @@
|
||||
/**
|
||||
* API 统一导出
|
||||
* 使用自动生成的 Service
|
||||
*/
|
||||
|
||||
// 导出所有生成的类型和服务
|
||||
export * from './generated'
|
||||
|
||||
// 配置 API
|
||||
import { OpenAPI } from './generated/core/OpenAPI'
|
||||
import { axiosInstance } from './axios-config'
|
||||
|
||||
// 设置基础 URL
|
||||
// 生产环境和开发环境都使用相对路径,通过 nginx/Vite 代理转发
|
||||
// 生产环境:通过 nginx 代理 /rbac -> http://43.139.210.35:5281
|
||||
// 开发环境:通过 Vite 代理 /rbac -> http://43.139.210.35:5281
|
||||
OpenAPI.BASE = ''
|
||||
|
||||
// 调试信息
|
||||
const isProduction = (import.meta as any).env?.MODE === 'production' || (import.meta as any).env?.PROD === true
|
||||
if (isProduction) {
|
||||
console.log('[RBAC Config] Production mode: BASE =', OpenAPI.BASE, '(using nginx proxy)')
|
||||
} else {
|
||||
console.log('[RBAC Config] Development mode: BASE =', OpenAPI.BASE, '(using Vite proxy)')
|
||||
}
|
||||
|
||||
// 认证 token 管理
|
||||
export function setAuthToken(token: string) {
|
||||
OpenAPI.TOKEN = token
|
||||
}
|
||||
|
||||
export function clearAuthToken() {
|
||||
OpenAPI.TOKEN = undefined
|
||||
}
|
||||
|
||||
// 获取当前 token
|
||||
export function getAuthToken() {
|
||||
return OpenAPI.TOKEN
|
||||
}
|
||||
|
||||
// 导出 axios 实例供其他地方使用
|
||||
export { axiosInstance }
|
||||
@ -1,47 +1,56 @@
|
||||
import { computed } from 'vue';
|
||||
import { RouteRecordRaw, RouteRecordNormalized } from 'vue-router';
|
||||
import usePermission from '@/hooks/permission';
|
||||
import router from '@/router';
|
||||
import { useAppStore, useAuthStore } from '@/store';
|
||||
import appClientMenus from '@/router/app-menus';
|
||||
import { cloneDeep } from 'lodash';
|
||||
import { getRouteName } from '@/utils/route-name-mapper';
|
||||
|
||||
// 缓存模块映射,避免每次计算都执行 import.meta.glob(兼容非 Vite 环境)
|
||||
const modules: Record<string, any> = {};
|
||||
|
||||
export default function useMenuTree() {
|
||||
const permission = usePermission();
|
||||
const appStore = useAppStore();
|
||||
const authStore = useAuthStore();
|
||||
|
||||
const appRoute = computed(() => {
|
||||
// 优先使用授权菜单(如果存在)
|
||||
if (authStore.authMenuListGet.length > 0) {
|
||||
console.log('使用授权菜单,菜单数量:', authStore.authMenuListGet.length);
|
||||
console.log('显示菜单列表:', authStore.showMenuListGet);
|
||||
// 将授权菜单转换为路由格式
|
||||
const routes = convertMenuToRoute(authStore.showMenuListGet);
|
||||
console.log('转换后的路由:', routes);
|
||||
return routes as RouteRecordNormalized[];
|
||||
const appRoute = computed<RouteRecordRaw[]>(() => {
|
||||
// 完全使用前端静态路由,不依赖后端、不做过滤
|
||||
if (appClientMenus && appClientMenus.length) {
|
||||
return appClientMenus as RouteRecordNormalized[];
|
||||
}
|
||||
// 其次使用服务器菜单
|
||||
if (appStore.menuFromServer && appStore.appAsyncMenus.length > 0) {
|
||||
console.log('使用服务器菜单');
|
||||
return appStore.appAsyncMenus;
|
||||
}
|
||||
// 最后使用客户端菜单
|
||||
console.log('使用客户端菜单');
|
||||
return appClientMenus;
|
||||
// 兜底:当静态菜单尚未就绪时,从 router 已注册路由构建菜单,避免初次进入为空白
|
||||
const staticRoutes = router
|
||||
.getRoutes()
|
||||
.filter((r) => r.meta?.requiresAuth && r.path && r.path !== '/');
|
||||
return staticRoutes.map((r) => ({
|
||||
path: r.path,
|
||||
name: r.name,
|
||||
meta: r.meta,
|
||||
redirect: r.redirect,
|
||||
children: r.children,
|
||||
})) as RouteRecordRaw[];
|
||||
});
|
||||
|
||||
// 组件路径映射:将不存在的路径映射到实际存在的路径
|
||||
const componentPathMap: Record<string, string> = {
|
||||
'home/index': 'dashboard/workplace/index',
|
||||
'home': 'dashboard/workplace/index',
|
||||
};
|
||||
|
||||
/** 将菜单转换为路由格式 */
|
||||
function convertMenuToRoute(menuList: any[]): RouteRecordRaw[] {
|
||||
if (!menuList || !Array.isArray(menuList) || menuList.length === 0) {
|
||||
console.warn('菜单列表为空或格式不正确');
|
||||
return [];
|
||||
}
|
||||
|
||||
return menuList.map((menu) => {
|
||||
return menuList.map((menu, index) => {
|
||||
// 确保菜单有必要的字段
|
||||
if (!menu) {
|
||||
console.warn('菜单项为空,跳过');
|
||||
return null;
|
||||
}
|
||||
|
||||
// 过滤掉特殊的"系统首页"菜单(category 为 "SPA" 且 module 为 null 的菜单)
|
||||
// 这类菜单通常是从其他地方自动添加的,不应该显示在导航菜单中
|
||||
if (menu.category === 'SPA' && (menu.module === null || menu.module === undefined)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -52,10 +61,15 @@ export default function useMenuTree() {
|
||||
name: menu.name,
|
||||
});
|
||||
|
||||
const route: RouteRecordRaw = {
|
||||
// 生成唯一的路由名称,基于菜单的唯一标识符(code、path 或 name)
|
||||
// 使用稳定的标识符而不是随机数,确保每次计算都生成相同的名称
|
||||
const uniqueId = menu.code || menu.path || menu.name || `menu_${index}`;
|
||||
const fallbackName = routeName || uniqueId.toString().replace(/[^a-zA-Z0-9]/g, '_');
|
||||
|
||||
const route = {
|
||||
path: menu.path || (menu.name ? `/${menu.name}` : '/'),
|
||||
// 使用映射的路由名称,如果没有则使用路径生成,最后兜底
|
||||
name: routeName || menu.path?.replace(/\//g, '') || `menu_${Math.random()}`,
|
||||
name: fallbackName,
|
||||
meta: {
|
||||
...(menu.meta || {}),
|
||||
locale: menu.meta?.title || menu.meta?.locale || menu.title || menu.name || '',
|
||||
@ -67,11 +81,10 @@ export default function useMenuTree() {
|
||||
children: menu.children && Array.isArray(menu.children) && menu.children.length > 0
|
||||
? convertMenuToRoute(menu.children).filter(Boolean) as RouteRecordRaw[]
|
||||
: undefined,
|
||||
};
|
||||
} as RouteRecordRaw;
|
||||
|
||||
// 如果有组件路径,设置组件
|
||||
if (menu.component && typeof menu.component === 'string') {
|
||||
const modules = import.meta.glob('@/views/**/*.vue');
|
||||
// 后端返回的 component 一般是类似:
|
||||
// - 'views/dashboard/workplace/index'
|
||||
// - 'trajectoryCenter/trajectoryOrder/index'
|
||||
@ -81,35 +94,43 @@ export default function useMenuTree() {
|
||||
componentPath = componentPath.replace(/^@\/views\//, '').replace(/^\/src\/views\//, '');
|
||||
// 如果还带有 'views/' 前缀,也去掉一次
|
||||
componentPath = componentPath.replace(/^views\//, '');
|
||||
|
||||
// 检查是否需要映射
|
||||
if (componentPathMap[componentPath]) {
|
||||
componentPath = componentPathMap[componentPath];
|
||||
}
|
||||
|
||||
const fullPath = `/src/views/${componentPath}.vue`;
|
||||
if (modules[fullPath]) {
|
||||
route.component = modules[fullPath];
|
||||
} else {
|
||||
console.warn(`组件路径不存在: ${fullPath}`);
|
||||
}
|
||||
// 如果组件不存在,不设置 component,让路由使用默认布局或父路由的布局
|
||||
// 这样路由仍然可以工作,只是没有对应的组件
|
||||
}
|
||||
|
||||
return route;
|
||||
}).filter(Boolean) as RouteRecordRaw[];
|
||||
}
|
||||
const menuTree = computed(() => {
|
||||
const copyRouter = cloneDeep(appRoute.value) as RouteRecordNormalized[];
|
||||
copyRouter.sort((a: RouteRecordNormalized, b: RouteRecordNormalized) => {
|
||||
return (a.meta.order || 0) - (b.meta.order || 0);
|
||||
});
|
||||
// 如果 appRoute 为空,直接返回空数组
|
||||
if (!appRoute.value || appRoute.value.length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// 使用浅拷贝而不是深拷贝,因为后续操作不会修改原始对象
|
||||
const routes = [...(appRoute.value as RouteRecordRaw[])];
|
||||
|
||||
// 先排序
|
||||
routes.sort((a, b) => (a.meta?.order || 0) - (b.meta?.order || 0));
|
||||
|
||||
function travel(_routes: RouteRecordRaw[], layer: number) {
|
||||
if (!_routes) return null;
|
||||
|
||||
const collector: any = _routes.map((element) => {
|
||||
// no access
|
||||
if (!permission.accessRouter(element)) {
|
||||
return null;
|
||||
}
|
||||
if (!_routes || _routes.length === 0) return [];
|
||||
|
||||
const collector = (_routes as RouteRecordRaw[]).map((element) => {
|
||||
// leaf node
|
||||
if (element.meta?.hideChildrenInMenu || !element.children) {
|
||||
element.children = [];
|
||||
return element;
|
||||
return element as RouteRecordRaw;
|
||||
}
|
||||
|
||||
// route filter hideInMenu true
|
||||
@ -127,23 +148,23 @@ export default function useMenuTree() {
|
||||
|
||||
if (subItem.length) {
|
||||
element.children = subItem;
|
||||
return element;
|
||||
return element as RouteRecordRaw;
|
||||
}
|
||||
// the else logic
|
||||
if (layer > 1) {
|
||||
element.children = subItem;
|
||||
return element;
|
||||
return element as RouteRecordRaw;
|
||||
}
|
||||
|
||||
if (element.meta?.hideInMenu === false) {
|
||||
return element;
|
||||
return element as RouteRecordRaw;
|
||||
}
|
||||
|
||||
return null;
|
||||
});
|
||||
return collector.filter(Boolean);
|
||||
return collector.filter(Boolean) as RouteRecordRaw[];
|
||||
}
|
||||
return travel(copyRouter, 0);
|
||||
return travel(routes, 0);
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
@ -142,9 +142,10 @@
|
||||
return newUnRead.value.filter((item) => item.category === category);
|
||||
}
|
||||
|
||||
/** 显示更多 - 跳转到站内信页面 */
|
||||
/** 显示更多 - 站内信功能已移除 */
|
||||
function toMessage() {
|
||||
router.push({ name: 'UserMessage' });
|
||||
// 站内信功能已移除,不再跳转
|
||||
console.log('站内信功能已移除');
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -108,16 +108,10 @@ const onMessageDropdownVisibleChange = (visible: boolean) => {
|
||||
}
|
||||
};
|
||||
|
||||
// 点击菜单项
|
||||
// 点击菜单项 - 站内信功能已移除
|
||||
const onMessageMenuClick = (event: any) => {
|
||||
const { key } = event;
|
||||
if (key === 'notification') {
|
||||
router.push({ name: 'UserMessage', query: { type: 'notification' } });
|
||||
} else if (key === 'message') {
|
||||
router.push({ name: 'UserMessage', query: { type: 'message' } });
|
||||
} else if (key === 'notice') {
|
||||
router.push({ name: 'UserMessage', query: { type: 'notice' } });
|
||||
}
|
||||
// 站内信功能已移除,不再跳转
|
||||
console.log('站内信功能已移除');
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
@ -28,35 +28,46 @@
|
||||
class="cursor-pointer hover:text-blue-600 text-gray-800"
|
||||
@click="() => goto(menuItem)"
|
||||
>
|
||||
{{ formatMenuTitle(menuItem.title || menuItem.meta?.locale) }}
|
||||
{{ formatMenuTitle(menuItem.name || menuItem.meta?.title) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #title>
|
||||
<span>{{ formatMenuTitle(item.title || item.meta?.locale) }}</span>
|
||||
<span>{{ formatMenuTitle(item.name || item.meta?.title) }}</span>
|
||||
</template>
|
||||
<a-link
|
||||
<span
|
||||
:key="key"
|
||||
v-if="!item.meta?.hideInMenu"
|
||||
:to="item.path"
|
||||
:class="{'active': belongTopMenu === item.path || belongTopMenu.startsWith(item.path) }"
|
||||
v-if="!item.meta?.isHide"
|
||||
:class="{'active': belongTopMenu === (item.path || item.route) || (item.path && belongTopMenu.startsWith(item.path)) }"
|
||||
class="top-nav-menu-item"
|
||||
@click="(e) => { if (item.children && item.children.length > 0) e.preventDefault(); }"
|
||||
@click="(e) => {
|
||||
e.preventDefault();
|
||||
if (item.children && item.children.length > 0) {
|
||||
// 有子菜单时不跳转,只显示弹出层
|
||||
return;
|
||||
} else {
|
||||
// 如果没有子菜单,执行跳转
|
||||
goto(item);
|
||||
}
|
||||
}"
|
||||
>
|
||||
{{ formatMenuTitle(item.title || item.meta?.locale) }}
|
||||
</a-link>
|
||||
{{ formatMenuTitle(item.name || item.meta?.title) }}
|
||||
</span>
|
||||
</a-popover>
|
||||
<a-link
|
||||
<span
|
||||
v-else
|
||||
:key="key"
|
||||
v-if="!item.meta?.hideInMenu"
|
||||
:to="item.path"
|
||||
:class="{'active': belongTopMenu === item.path || belongTopMenu.startsWith(item.path) }"
|
||||
v-if="!item.meta?.isHide"
|
||||
:class="{'active': belongTopMenu === (item.path || item.route) || (item.path && belongTopMenu.startsWith(item.path)) }"
|
||||
class="top-nav-menu-item"
|
||||
@click="(e) => {
|
||||
e.preventDefault();
|
||||
goto(item);
|
||||
}"
|
||||
>
|
||||
{{ formatMenuTitle(item.title || item.meta?.locale) }}
|
||||
</a-link>
|
||||
{{ formatMenuTitle(item.name || item.meta?.title) }}
|
||||
</span>
|
||||
</template>
|
||||
</template>
|
||||
</div>
|
||||
@ -158,52 +169,214 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, onMounted } from 'vue';
|
||||
import { useRoute, useRouter, RouteRecordRaw } from 'vue-router';
|
||||
import { computed, ref, onMounted, watch } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useAppStore, useUserStore } from '@/store';
|
||||
import useMenuTree from '@/components/menu/use-menu-tree';
|
||||
import { useRbacUserStore } from '@/store/modules/rbac-user';
|
||||
import TabBar from '@/components/tab-bar/index.vue';
|
||||
import RightTopMessage from './RightTopMessage.vue';
|
||||
import RightTopUser from './RightTopUser.vue';
|
||||
import SelectLang from './SelectLang.vue';
|
||||
import { openWindow, regexUrl } from '@/utils';
|
||||
import { MenuService, AuthService } from '@/api/rbac';
|
||||
import type { MenuTreeDto } from '@/api/rbac';
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const appStore = useAppStore();
|
||||
const userStore = useUserStore();
|
||||
const { menuTree } = useMenuTree();
|
||||
const rbacUserStore = useRbacUserStore();
|
||||
|
||||
const topMenuCon = ref<HTMLElement | null>(null);
|
||||
const topNavEnable = computed(() => true); // 启用顶部导航
|
||||
const tabNavEnable = computed(() => appStore.tabBar);
|
||||
|
||||
// 菜单数据
|
||||
const menuData = computed(() => menuTree.value || []);
|
||||
// 菜单数据 - 全量菜单树和用户菜单权限
|
||||
const allMenuTreeData = ref<MenuTreeDto[]>([]);
|
||||
const menuLoading = ref(false);
|
||||
|
||||
// 使用 store 中的用户菜单权限(computed,自动响应式)
|
||||
const userMenuTreeData = computed(() => rbacUserStore.menus || []);
|
||||
|
||||
// 根据用户菜单权限过滤菜单树
|
||||
function filterMenuByUserPermission(allMenus: MenuTreeDto[], userMenus: MenuTreeDto[]): MenuTreeDto[] {
|
||||
// 创建用户菜单ID集合,用于快速查找
|
||||
const userMenuIdSet = new Set<string>();
|
||||
|
||||
function collectMenuIds(menus: MenuTreeDto[]) {
|
||||
menus.forEach(menu => {
|
||||
if (menu.id) {
|
||||
userMenuIdSet.add(String(menu.id));
|
||||
}
|
||||
if (menu.children && menu.children.length > 0) {
|
||||
collectMenuIds(menu.children);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
collectMenuIds(userMenus);
|
||||
|
||||
// 过滤菜单树,只保留用户有权限的菜单
|
||||
function filterMenus(menus: MenuTreeDto[]): MenuTreeDto[] {
|
||||
const result: MenuTreeDto[] = [];
|
||||
|
||||
for (const menu of menus) {
|
||||
const menuId = menu.id ? String(menu.id) : null;
|
||||
const hasPermission = menuId && userMenuIdSet.has(menuId);
|
||||
|
||||
// 先处理子菜单
|
||||
let filteredChildren: MenuTreeDto[] | null = null;
|
||||
if (menu.children && menu.children.length > 0) {
|
||||
filteredChildren = filterMenus(menu.children);
|
||||
}
|
||||
|
||||
// 如果菜单本身有权限,或者子菜单有权限,则保留
|
||||
if (hasPermission || (filteredChildren && filteredChildren.length > 0)) {
|
||||
const filteredMenu: MenuTreeDto = {
|
||||
...menu,
|
||||
children: filteredChildren && filteredChildren.length > 0 ? filteredChildren : null,
|
||||
};
|
||||
result.push(filteredMenu);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
return filterMenus(allMenus);
|
||||
}
|
||||
|
||||
// 将 MenuTreeDto 转换为导航栏菜单格式
|
||||
function convertMenuTreeToNavMenu(menuTree: MenuTreeDto[]): any[] {
|
||||
return menuTree
|
||||
.filter(menu => {
|
||||
// 只显示一级菜单(type === 1 或没有 type)
|
||||
if (menu.type === 2) return false; // 过滤按钮
|
||||
if (menu.isHidden) return false; // 过滤隐藏菜单
|
||||
return true;
|
||||
})
|
||||
.map(menu => {
|
||||
const navMenu: any = {
|
||||
id: menu.id,
|
||||
name: menu.name,
|
||||
path: menu.route,
|
||||
route: menu.route,
|
||||
type: menu.type,
|
||||
meta: {
|
||||
title: menu.name,
|
||||
icon: menu.icon,
|
||||
order: menu.order,
|
||||
isHide: menu.isHidden || false,
|
||||
},
|
||||
};
|
||||
|
||||
// 只保留二级菜单,移除三级及更深层级
|
||||
if (menu.children && menu.children.length > 0) {
|
||||
navMenu.children = menu.children
|
||||
.filter((child: MenuTreeDto) => {
|
||||
if (child.type === 2) return false; // 过滤按钮
|
||||
if (child.isHidden) return false; // 过滤隐藏菜单
|
||||
return true;
|
||||
})
|
||||
.map((child: MenuTreeDto) => {
|
||||
// 移除二级菜单的 children
|
||||
return {
|
||||
id: child.id,
|
||||
name: child.name,
|
||||
path: child.route,
|
||||
route: child.route,
|
||||
type: child.type,
|
||||
meta: {
|
||||
title: child.name,
|
||||
icon: child.icon,
|
||||
order: child.order,
|
||||
isHide: child.isHidden || false,
|
||||
},
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
return navMenu;
|
||||
});
|
||||
}
|
||||
|
||||
// 菜单数据 - 根据用户权限过滤后的菜单列表
|
||||
const menuData = computed(() => {
|
||||
const userMenus = userMenuTreeData.value;
|
||||
|
||||
// 如果全量菜单树为空,返回空数组
|
||||
if (allMenuTreeData.value.length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// 如果用户菜单权限为空,返回空数组
|
||||
if (userMenus.length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// 根据用户菜单权限过滤全量菜单树
|
||||
const filteredMenus = filterMenuByUserPermission(
|
||||
allMenuTreeData.value,
|
||||
userMenus
|
||||
);
|
||||
|
||||
// 转换为导航栏格式
|
||||
return convertMenuTreeToNavMenu(filteredMenus);
|
||||
});
|
||||
|
||||
// 加载菜单树和用户菜单权限
|
||||
async function loadMenuTree() {
|
||||
menuLoading.value = true;
|
||||
try {
|
||||
// 先检查用户是否已登录
|
||||
if (!rbacUserStore.isLoggedIn) {
|
||||
allMenuTreeData.value = [];
|
||||
return;
|
||||
}
|
||||
|
||||
// 确保用户信息已加载(如果菜单为空,重新获取)
|
||||
const currentUserMenus = rbacUserStore.menus;
|
||||
if (!currentUserMenus || currentUserMenus.length === 0) {
|
||||
try {
|
||||
await rbacUserStore.getCurrentUser();
|
||||
} catch (userError) {
|
||||
console.error('获取用户信息失败:', userError);
|
||||
}
|
||||
}
|
||||
|
||||
// 加载全量菜单树
|
||||
try {
|
||||
const allMenus = await MenuService.getRbacMenuGetMenuTree() || [];
|
||||
allMenuTreeData.value = allMenus;
|
||||
} catch (menuError) {
|
||||
console.error('加载全量菜单树失败:', menuError);
|
||||
allMenuTreeData.value = [];
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载菜单树或用户信息失败:', error);
|
||||
allMenuTreeData.value = [];
|
||||
} finally {
|
||||
menuLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 当前路由所属的顶部菜单
|
||||
const belongTopMenu = computed(() => {
|
||||
const currentPath = route.path;
|
||||
// 查找当前路由所属的顶级菜单
|
||||
for (const menu of menuData.value) {
|
||||
if (menu.path && currentPath.startsWith(menu.path)) {
|
||||
return menu.path;
|
||||
const menuPath = menu.path || menu.route;
|
||||
if (menuPath && currentPath.startsWith(menuPath)) {
|
||||
return menuPath;
|
||||
}
|
||||
// 检查子菜单
|
||||
if (menu.children) {
|
||||
for (const child of menu.children) {
|
||||
if (child.path && currentPath.startsWith(child.path)) {
|
||||
return menu.path || '';
|
||||
}
|
||||
// 检查更深层的子菜单
|
||||
if (child.children) {
|
||||
for (const grandChild of child.children) {
|
||||
if (grandChild.path && currentPath.startsWith(grandChild.path)) {
|
||||
return menu.path || '';
|
||||
}
|
||||
}
|
||||
const childPath = child.path || child.route;
|
||||
if (childPath && currentPath.startsWith(childPath)) {
|
||||
return menuPath || '';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -214,30 +387,45 @@ const belongTopMenu = computed(() => {
|
||||
// 格式化菜单标题
|
||||
const formatMenuTitle = (title?: string) => {
|
||||
if (!title) return '';
|
||||
return t(title) || title;
|
||||
// 如果是 locale key,尝试翻译
|
||||
if (title.startsWith('menu.')) {
|
||||
return t(title) || title;
|
||||
}
|
||||
return title;
|
||||
};
|
||||
|
||||
// 过滤页面 - 只显示2级菜单,忽略3级菜单
|
||||
const filterPage = (pages?: RouteRecordRaw[]) => {
|
||||
const filterPage = (pages?: any[]) => {
|
||||
if (!pages) return [];
|
||||
return pages.filter(item => {
|
||||
// 过滤掉隐藏的菜单
|
||||
if (item.meta?.hideInMenu === true) return false;
|
||||
// 只显示2级菜单,如果有3级菜单(children),我们仍然显示2级菜单本身
|
||||
// 但不显示3级菜单的内容
|
||||
return pages
|
||||
.filter(item => {
|
||||
// 过滤掉隐藏的菜单
|
||||
if (item.meta?.isHide || item.meta?.hideInMenu) return false;
|
||||
// 过滤掉按钮类型的菜单
|
||||
if (item.type === 2) return false;
|
||||
return true;
|
||||
})
|
||||
.map(item => {
|
||||
// 确保二级菜单不包含 children(三级菜单)
|
||||
const { children, ...itemWithoutChildren } = item;
|
||||
return itemWithoutChildren;
|
||||
});
|
||||
};
|
||||
|
||||
// 检查是否有子菜单
|
||||
const hasChildren = (item: any) => {
|
||||
if (!item.children || item.children.length === 0) return false;
|
||||
// 检查是否有可见的子菜单
|
||||
return item.children.some((child: any) => {
|
||||
if (child.meta?.isHide || child.meta?.hideInMenu) return false;
|
||||
if (child.type === 2) return false; // 过滤按钮
|
||||
return true;
|
||||
});
|
||||
};
|
||||
|
||||
// 检查是否有子菜单
|
||||
const hasChildren = (item: RouteRecordRaw) => {
|
||||
return item.children && item.children.length > 0 &&
|
||||
item.children.some(child => child.meta?.hideInMenu !== true);
|
||||
};
|
||||
|
||||
// 将菜单项按每行4个分组
|
||||
const getMenuRows = (items: RouteRecordRaw[]) => {
|
||||
const rows: RouteRecordRaw[][] = [];
|
||||
const getMenuRows = (items: any[]) => {
|
||||
const rows: any[][] = [];
|
||||
for (let i = 0; i < items.length; i += 4) {
|
||||
rows.push(items.slice(i, i + 4));
|
||||
}
|
||||
@ -245,14 +433,38 @@ const getMenuRows = (items: RouteRecordRaw[]) => {
|
||||
};
|
||||
|
||||
// 跳转
|
||||
const goto = (item: RouteRecordRaw) => {
|
||||
if (regexUrl.test(item.path)) {
|
||||
openWindow(item.path);
|
||||
const goto = (item: any) => {
|
||||
if (!item) {
|
||||
return;
|
||||
}
|
||||
// 使用路由 name 跳转
|
||||
router.push({
|
||||
name: item.name,
|
||||
|
||||
// 获取路径,优先使用 path,其次使用 route
|
||||
let targetPath = item.path || item.route;
|
||||
|
||||
if (!targetPath) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 确保路径以 / 开头
|
||||
if (!targetPath.startsWith('/') && !regexUrl.test(targetPath)) {
|
||||
targetPath = '/' + targetPath;
|
||||
}
|
||||
|
||||
// 如果是外部链接,使用 openWindow
|
||||
if (regexUrl.test(targetPath)) {
|
||||
openWindow(targetPath);
|
||||
return;
|
||||
}
|
||||
|
||||
// 使用路由 path 跳转
|
||||
router.push(targetPath).catch((error) => {
|
||||
console.error(`路由跳转失败: path=${targetPath}`, error);
|
||||
// 如果路由不存在,尝试使用 name 跳转
|
||||
if (item.name) {
|
||||
router.push({ name: item.name }).catch((nameError) => {
|
||||
console.error(`使用路由名称跳转也失败: name=${item.name}`, nameError);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@ -324,8 +536,10 @@ const onBalanceMenuClick = (event: any) => {
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
loadServiceDataList();
|
||||
// 加载菜单树
|
||||
await loadMenuTree();
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -386,7 +600,8 @@ onMounted(() => {
|
||||
border-radius: 20px;
|
||||
white-space: nowrap;
|
||||
transition: all 0.3s ease;
|
||||
margin: 0 4px;
|
||||
margin: 0 16px;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover,
|
||||
&.active {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { ref } from 'vue';
|
||||
import { sysSysInfoGet } from '@/api/SimpleAdmin/common';
|
||||
// RBAC 系统暂不使用系统配置接口
|
||||
// import { sysSysInfoGet } from '@/api/SimpleAdmin/common';
|
||||
|
||||
/**
|
||||
* 系统配置 composable
|
||||
@ -16,49 +17,20 @@ export function useSystemConfig() {
|
||||
const logoUrl = ref<string>('');
|
||||
|
||||
/**
|
||||
* 获取系统配置
|
||||
* 获取系统配置 - RBAC 系统使用默认值
|
||||
*/
|
||||
const fetchSysInfo = async () => {
|
||||
try {
|
||||
loading.value = true;
|
||||
const res = await sysSysInfoGet();
|
||||
const data = (res as any)?.data || res || {};
|
||||
console.log('获取系统配置:', data);
|
||||
|
||||
// 如果返回的是数组格式(配置项列表),需要转换为对象
|
||||
if (Array.isArray(data)) {
|
||||
const configObj: any = {};
|
||||
data.forEach((item: any) => {
|
||||
if (item.configKey && item.configValue !== undefined) {
|
||||
configObj[item.configKey] = item.configValue;
|
||||
}
|
||||
});
|
||||
console.log('转换后的配置对象:', configObj);
|
||||
console.log('SYS_LOGO值:', configObj.SYS_LOGO);
|
||||
sysInfo.value = configObj;
|
||||
|
||||
// 如果有logo URL,设置图片URL
|
||||
if (configObj.SYS_LOGO) {
|
||||
loadLogoImage(configObj.SYS_LOGO);
|
||||
} else {
|
||||
logoUrl.value = '/src/assets/logo.png';
|
||||
}
|
||||
|
||||
return configObj;
|
||||
} else {
|
||||
// 如果已经是对象格式,直接使用
|
||||
console.log('SYS_LOGO值:', data.SYS_LOGO);
|
||||
sysInfo.value = data;
|
||||
|
||||
// 如果有logo URL,设置图片URL
|
||||
if (data.SYS_LOGO) {
|
||||
loadLogoImage(data.SYS_LOGO);
|
||||
} else {
|
||||
logoUrl.value = '/src/assets/logo.png';
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
// RBAC 系统使用默认配置
|
||||
const defaultConfig = {
|
||||
SYS_NAME: '哪哪发物流',
|
||||
SYS_VERSION: 'v1.0.0',
|
||||
SYS_LOGO: '/src/assets/logo.png',
|
||||
};
|
||||
sysInfo.value = defaultConfig;
|
||||
logoUrl.value = defaultConfig.SYS_LOGO;
|
||||
return defaultConfig;
|
||||
} catch (error) {
|
||||
console.error('获取系统配置失败', error);
|
||||
return {};
|
||||
|
||||
@ -23,8 +23,6 @@ import locale403 from '@/views/exception/403/locale/en-US';
|
||||
import locale404 from '@/views/exception/404/locale/en-US';
|
||||
import locale500 from '@/views/exception/500/locale/en-US';
|
||||
|
||||
import localeUserSetting from '@/views/user/setting/locale/en-US';
|
||||
|
||||
import localeSettings from './en-US/settings';
|
||||
|
||||
export default {
|
||||
@ -65,8 +63,6 @@ export default {
|
||||
'menu.visualization.dataAnalysis': 'Analysis',
|
||||
'menu.visualization.multiDimensionDataAnalysis': 'Multi-Dimension Data Analysis',
|
||||
'menu.user': 'User Center',
|
||||
'menu.user.setting': 'Settings',
|
||||
'menu.user.message': 'Messages',
|
||||
'menu.user.recharge': 'Recharge',
|
||||
'menu.user.rechargeRecord': 'Recharge Records',
|
||||
'menu.arcoWebsite': 'Arco Design',
|
||||
@ -114,6 +110,7 @@ export default {
|
||||
'menu.api.apiDebugger': 'API Debugger',
|
||||
'menu.system': 'System',
|
||||
'menu.system.org': 'Organization',
|
||||
'menu.system.organization': 'Organization',
|
||||
'menu.system.user': 'User',
|
||||
'menu.system.position': 'Position',
|
||||
'menu.system.role': 'Role',
|
||||
@ -1925,5 +1922,4 @@ export default {
|
||||
...locale403,
|
||||
...locale404,
|
||||
...locale500,
|
||||
...localeUserSetting,
|
||||
};
|
||||
|
||||
@ -23,8 +23,6 @@ import locale403 from '@/views/exception/403/locale/zh-CN';
|
||||
import locale404 from '@/views/exception/404/locale/zh-CN';
|
||||
import locale500 from '@/views/exception/500/locale/zh-CN';
|
||||
|
||||
import localeUserSetting from '@/views/user/setting/locale/zh-CN';
|
||||
|
||||
import localeSettings from './zh-CN/settings';
|
||||
|
||||
export default {
|
||||
@ -65,8 +63,6 @@ export default {
|
||||
'menu.visualization.dataAnalysis': '分析页',
|
||||
'menu.visualization.multiDimensionDataAnalysis': '多维度数据分析',
|
||||
'menu.user': '个人',
|
||||
'menu.user.setting': '个人设置',
|
||||
'menu.user.message': '站内信',
|
||||
'menu.user.recharge': '资金充值',
|
||||
'menu.user.rechargeRecord': '充值记录',
|
||||
'menu.arcoWebsite': 'Arco Design',
|
||||
@ -114,6 +110,7 @@ export default {
|
||||
'menu.api.apiDebugger': 'API调试',
|
||||
'menu.system': '系统',
|
||||
'menu.system.org': '组织管理',
|
||||
'menu.system.organization': '组织管理',
|
||||
'menu.system.user': '用户管理',
|
||||
'menu.system.position': '职位管理',
|
||||
'menu.system.role': '角色管理',
|
||||
@ -1916,5 +1913,4 @@ export default {
|
||||
...locale403,
|
||||
...locale404,
|
||||
...locale500,
|
||||
...localeUserSetting,
|
||||
};
|
||||
|
||||
@ -16,6 +16,8 @@ import globalProperties from './plugins/globalProperties';
|
||||
import './mock';
|
||||
// 导入 ECharts 配置,确保组件在应用启动时注册
|
||||
import './utils/echarts';
|
||||
// 初始化 RBAC token(从localStorage恢复)
|
||||
import { setAuthToken } from './api/rbac';
|
||||
import App from './App.vue';
|
||||
// Styles are imported via arco-plugin. See config/plugin/arcoStyleImport.ts in the directory for details
|
||||
// 样式通过 arco-plugin 插件导入。详见目录文件 config/plugin/arcoStyleImport.ts
|
||||
@ -130,4 +132,11 @@ watch(() => i18n.global.locale.value, () => {
|
||||
setupVxeTableI18n();
|
||||
});
|
||||
|
||||
// 初始化 RBAC token(从localStorage恢复)
|
||||
// 优先使用新的 access_token,兼容旧的 rbac_token
|
||||
const rbacAccessToken = localStorage.getItem('rbac_access_token') || localStorage.getItem('rbac_token');
|
||||
if (rbacAccessToken) {
|
||||
setAuthToken(rbacAccessToken);
|
||||
}
|
||||
|
||||
app.mount('#app');
|
||||
|
||||
@ -17,8 +17,6 @@ import '@/views/profile/basic/mock';
|
||||
import '@/views/visualization/data-analysis/mock';
|
||||
import '@/views/visualization/multi-dimension-data-analysis/mock';
|
||||
|
||||
import '@/views/user/setting/mock';
|
||||
|
||||
Mock.setup({
|
||||
timeout: '600-1000',
|
||||
});
|
||||
|
||||
@ -71,7 +71,7 @@ setupMock({
|
||||
Mock.mock(new RegExp('/api/user/menu'), () => {
|
||||
const menuList = [
|
||||
{
|
||||
path: '/dashboard',
|
||||
path: '/home',
|
||||
name: 'home',
|
||||
meta: {
|
||||
locale: 'menu.server.home',
|
||||
|
||||
@ -14,5 +14,5 @@ export const DEFAULT_ROUTE_NAME = 'Workplace';
|
||||
export const DEFAULT_ROUTE = {
|
||||
title: 'menu.home.workplace',
|
||||
name: DEFAULT_ROUTE_NAME,
|
||||
fullPath: '/dashboard/workplace',
|
||||
fullPath: '/home/workplace',
|
||||
};
|
||||
|
||||
@ -5,7 +5,7 @@ import { useAuthStore } from '@/store';
|
||||
import router from '@/router';
|
||||
import { getRouteName } from '@/utils/route-name-mapper';
|
||||
|
||||
const HOME_URL = '/dashboard/workplace'; // 默认首页路径
|
||||
const HOME_URL = '/home/workplace'; // 默认首页路径
|
||||
|
||||
// 引入 views 文件夹下所有 vue 文件
|
||||
const modules = import.meta.glob('@/views/**/*.vue');
|
||||
@ -53,17 +53,30 @@ export const initDynamicRouter = async () => {
|
||||
const chooseModule = userStore.chooseModuleGet; // 获取当前选择模块
|
||||
let homePath: string = HOME_URL; // 首页路径
|
||||
|
||||
console.log('初始化动态路由,选择的模块ID:', chooseModule);
|
||||
|
||||
if (!chooseModule) {
|
||||
console.error('未选择模块');
|
||||
return routerError(false, '请选择模块', '请先选择模块!');
|
||||
}
|
||||
|
||||
// 1.获取菜单列表 && 按钮权限列表(强制刷新,不使用缓存)
|
||||
await authStore.getAuthMenuList(chooseModule, true);
|
||||
try {
|
||||
console.log('开始获取菜单列表,模块ID:', chooseModule);
|
||||
await authStore.getAuthMenuList(chooseModule, true);
|
||||
console.log('菜单列表获取成功,菜单数量:', authStore.authMenuListGet.length);
|
||||
} catch (menuError: any) {
|
||||
console.error('获取菜单列表失败:', menuError);
|
||||
const errorMsg = menuError?.response?.data?.msg || menuError?.message || '获取菜单列表失败';
|
||||
return routerError(true, '获取菜单失败', errorMsg);
|
||||
}
|
||||
|
||||
await authStore.getAuthButtonList();
|
||||
|
||||
// 2.判断当前用户有没有菜单权限
|
||||
if (!authStore.authMenuListGet.length) {
|
||||
return routerError();
|
||||
console.error('菜单列表为空,用户没有菜单权限');
|
||||
return routerError(true, '无权限访问', '当前账号在该模块下无任何菜单权限,请联系系统管理员!');
|
||||
}
|
||||
|
||||
// 获取首页路径
|
||||
|
||||
@ -3,15 +3,28 @@ import NProgress from 'nprogress'; // progress bar
|
||||
|
||||
import usePermission from '@/hooks/permission';
|
||||
import { useUserStore, useAppStore } from '@/store';
|
||||
import { useRbacUserStore } from '@/store/modules/rbac-user';
|
||||
import { hasPermission } from '@/utils/rbac-permission';
|
||||
import { appRoutes } from '../routes';
|
||||
import { WHITE_LIST, NOT_FOUND } from '../constants';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
|
||||
export default function setupPermissionGuard(router: Router) {
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
const appStore = useAppStore();
|
||||
const userStore = useUserStore();
|
||||
const rbacUserStore = useRbacUserStore();
|
||||
const Permission = usePermission();
|
||||
const permissionsAllow = Permission.accessRouter(to);
|
||||
|
||||
// 检查 RBAC 权限
|
||||
if (to.meta?.permission) {
|
||||
if (!hasPermission(to.meta.permission as string)) {
|
||||
Message.error('没有权限访问该页面');
|
||||
next(from.path || '/');
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (appStore.menuFromServer) {
|
||||
// 针对来自服务端的菜单配置进行处理
|
||||
// Handle routing configuration from the server
|
||||
|
||||
@ -2,8 +2,8 @@ import type { Router, LocationQueryRaw } from 'vue-router';
|
||||
import NProgress from 'nprogress'; // progress bar
|
||||
|
||||
import { useUserStore } from '@/store';
|
||||
import { useRbacUserStore } from '@/store/modules/rbac-user';
|
||||
import { isLogin } from '@/utils/auth';
|
||||
import { sysAuthBGetLoginUserGet } from '@/api/SimpleAdmin/bEndPermissionVerify';
|
||||
|
||||
export default function setupUserLoginInfoGuard(router: Router) {
|
||||
// 标记是否已经获取过用户信息,避免重复请求
|
||||
@ -36,24 +36,32 @@ export default function setupUserLoginInfoGuard(router: Router) {
|
||||
if (!hasFetchedUserInfo) {
|
||||
hasFetchedUserInfo = true;
|
||||
try {
|
||||
const res = await sysAuthBGetLoginUserGet();
|
||||
// request.ts 已经处理了响应格式,如果响应是 { code: 200, data: {...} },会直接返回 data
|
||||
const userInfo = res?.data || res;
|
||||
|
||||
if (userInfo && (userInfo.name || userInfo.accountId)) {
|
||||
userStore.setInfo(userInfo as any);
|
||||
next();
|
||||
// 使用 RBAC 系统获取用户信息
|
||||
const rbacUserStore = useRbacUserStore();
|
||||
if (rbacUserStore.userInfo?.id) {
|
||||
// 从 RBAC store 获取用户信息
|
||||
await rbacUserStore.getCurrentUser();
|
||||
const rbacUserInfo = rbacUserStore.userInfo;
|
||||
|
||||
if (rbacUserInfo) {
|
||||
// 将 RBAC 用户信息转换为 itfx 用户信息格式
|
||||
const userInfo: any = {
|
||||
account: rbacUserInfo.account,
|
||||
name: rbacUserInfo.name || rbacUserInfo.account,
|
||||
avatar: rbacUserInfo.avatar,
|
||||
email: rbacUserInfo.email,
|
||||
id: rbacUserInfo.id,
|
||||
accountId: rbacUserInfo.id, // 兼容 accountId
|
||||
defaultModule: undefined,
|
||||
moduleList: [],
|
||||
};
|
||||
userStore.setInfo(userInfo);
|
||||
next();
|
||||
} else {
|
||||
throw new Error('用户信息不存在');
|
||||
}
|
||||
} else {
|
||||
// 获取用户信息失败,跳转到登录页
|
||||
hasFetchedUserInfo = false;
|
||||
await userStore.logout();
|
||||
next({
|
||||
name: 'login',
|
||||
query: {
|
||||
redirect: to.name as string,
|
||||
...to.query,
|
||||
} as LocationQueryRaw,
|
||||
});
|
||||
throw new Error('用户未登录');
|
||||
}
|
||||
} catch (error) {
|
||||
// 获取用户信息失败(可能是 token 过期),跳转到登录页
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { createRouter, createWebHashHistory } from 'vue-router';
|
||||
import { createRouter, createWebHistory } from 'vue-router';
|
||||
import NProgress from 'nprogress'; // progress bar
|
||||
import 'nprogress/nprogress.css';
|
||||
|
||||
@ -9,7 +9,7 @@ import createRouteGuard from './guard';
|
||||
NProgress.configure({ showSpinner: false }); // NProgress Configuration
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHashHistory(),
|
||||
history: createWebHistory(),
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import type { RouteRecordNormalized } from 'vue-router';
|
||||
|
||||
// 统一从 newModules 目录读取所有路由模块
|
||||
// 注意:路由配置需要同步加载,但路由组件本身是懒加载的
|
||||
const modules = import.meta.glob('./newModules/*.ts', { eager: true });
|
||||
const externalModules = import.meta.glob('./externalModules/*.ts', {
|
||||
eager: true,
|
||||
|
||||
@ -2,7 +2,7 @@ import { DEFAULT_LAYOUT } from '../base';
|
||||
import { AppRouteRecordRaw } from '../types';
|
||||
|
||||
const DASHBOARD: AppRouteRecordRaw = {
|
||||
path: '/dashboard',
|
||||
path: '/home',
|
||||
name: 'home',
|
||||
component: DEFAULT_LAYOUT,
|
||||
meta: {
|
||||
|
||||
@ -1,39 +1,2 @@
|
||||
import { DEFAULT_LAYOUT } from '../base';
|
||||
import { AppRouteRecordRaw } from '../types';
|
||||
|
||||
const FORM: AppRouteRecordRaw = {
|
||||
path: '/form',
|
||||
name: 'form',
|
||||
component: DEFAULT_LAYOUT,
|
||||
meta: {
|
||||
locale: 'menu.form',
|
||||
icon: 'icon-settings',
|
||||
requiresAuth: true,
|
||||
order: 3,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'step',
|
||||
name: 'Step',
|
||||
component: () => import('@/views/form/step/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.form.step',
|
||||
requiresAuth: true,
|
||||
roles: ['admin'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'group',
|
||||
name: 'Group',
|
||||
component: () => import('@/views/form/group/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.form.group',
|
||||
requiresAuth: true,
|
||||
roles: ['admin'],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default FORM;
|
||||
export default [];
|
||||
|
||||
|
||||
@ -12,15 +12,6 @@ const ORGANIZATION: AppRouteRecordRaw = {
|
||||
order: 999,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'org',
|
||||
name: 'OrganizationOrg',
|
||||
component: () => import('@/views/system/organization/org/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.system.org',
|
||||
requiresAuth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'user',
|
||||
name: 'OrganizationUser',
|
||||
@ -28,15 +19,7 @@ const ORGANIZATION: AppRouteRecordRaw = {
|
||||
meta: {
|
||||
locale: 'menu.system.user',
|
||||
requiresAuth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'position',
|
||||
name: 'OrganizationPosition',
|
||||
component: () => import('@/views/system/organization/position/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.system.position',
|
||||
requiresAuth: true,
|
||||
permission: 'Rbac.Users.Query',
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -46,15 +29,7 @@ const ORGANIZATION: AppRouteRecordRaw = {
|
||||
meta: {
|
||||
locale: 'menu.system.role',
|
||||
requiresAuth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'module',
|
||||
name: 'OrganizationModule',
|
||||
component: () => import('@/views/system/organization/module/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.system.module',
|
||||
requiresAuth: true,
|
||||
permission: 'Rbac.Roles.Query',
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -64,51 +39,17 @@ const ORGANIZATION: AppRouteRecordRaw = {
|
||||
meta: {
|
||||
locale: 'menu.system.menu',
|
||||
requiresAuth: true,
|
||||
permission: 'Rbac.Menus.Query',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'dict',
|
||||
name: 'OrganizationDict',
|
||||
component: () => import('@/views/system/dict/index.vue'),
|
||||
path: 'organizations',
|
||||
name: 'OrganizationManagement',
|
||||
component: () => import('@/views/system/organization/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.system.dict',
|
||||
requiresAuth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'config',
|
||||
name: 'OrganizationConfig',
|
||||
component: () => import('@/views/system/config/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.system.config',
|
||||
requiresAuth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'announcement',
|
||||
name: 'OrganizationAnnouncement',
|
||||
component: () => import('@/views/system/announcement/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.system.announcement',
|
||||
requiresAuth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'vislog',
|
||||
name: 'OrganizationVisLog',
|
||||
component: () => import('@/views/system/audit/vislog/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.system.vislog',
|
||||
requiresAuth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'oplog',
|
||||
name: 'OrganizationOpLog',
|
||||
component: () => import('@/views/system/audit/oplog/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.system.oplog',
|
||||
locale: 'menu.system.organization',
|
||||
requiresAuth: true,
|
||||
permission: 'Rbac.Organizations.Query',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@ -1,28 +1 @@
|
||||
import { DEFAULT_LAYOUT } from '../base';
|
||||
import { AppRouteRecordRaw } from '../types';
|
||||
|
||||
const PROFILE: AppRouteRecordRaw = {
|
||||
path: '/profile',
|
||||
name: 'profile',
|
||||
component: DEFAULT_LAYOUT,
|
||||
meta: {
|
||||
locale: 'menu.profile',
|
||||
requiresAuth: true,
|
||||
icon: 'icon-file',
|
||||
order: 4,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'basic',
|
||||
name: 'Basic',
|
||||
component: () => import('@/views/profile/basic/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.profile.basic',
|
||||
requiresAuth: true,
|
||||
roles: ['admin'],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default PROFILE;
|
||||
export default [];
|
||||
|
||||
@ -1,39 +1,2 @@
|
||||
import { DEFAULT_LAYOUT } from '../base';
|
||||
import { AppRouteRecordRaw } from '../types';
|
||||
|
||||
const RESULT: AppRouteRecordRaw = {
|
||||
path: '/result',
|
||||
name: 'result',
|
||||
component: DEFAULT_LAYOUT,
|
||||
meta: {
|
||||
locale: 'menu.result',
|
||||
icon: 'icon-check-circle',
|
||||
requiresAuth: true,
|
||||
order: 5,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'success',
|
||||
name: 'Success',
|
||||
component: () => import('@/views/result/success/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.result.success',
|
||||
requiresAuth: true,
|
||||
roles: ['admin'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'error',
|
||||
name: 'Error',
|
||||
component: () => import('@/views/result/error/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.result.error',
|
||||
requiresAuth: true,
|
||||
roles: ['admin'],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default RESULT;
|
||||
export default [];
|
||||
|
||||
|
||||
59
src/router/routes/newModules/system-management.ts
Normal file
59
src/router/routes/newModules/system-management.ts
Normal file
@ -0,0 +1,59 @@
|
||||
import { DEFAULT_LAYOUT } from '../base';
|
||||
import { AppRouteRecordRaw } from '../types';
|
||||
|
||||
const SYSTEM_MANAGEMENT: AppRouteRecordRaw = {
|
||||
path: '/system',
|
||||
name: 'SystemManagement',
|
||||
component: DEFAULT_LAYOUT,
|
||||
meta: {
|
||||
locale: 'menu.system',
|
||||
icon: 'icon-settings',
|
||||
requiresAuth: true,
|
||||
order: 999,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'users',
|
||||
name: 'SystemUsers',
|
||||
component: () => import('@/views/system/organization/user/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.system.user',
|
||||
requiresAuth: true,
|
||||
permission: 'Rbac.Users.Query',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'roles',
|
||||
name: 'SystemRoles',
|
||||
component: () => import('@/views/system/permission/role/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.system.role',
|
||||
requiresAuth: true,
|
||||
permission: 'Rbac.Roles.Query',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'menus',
|
||||
name: 'SystemMenus',
|
||||
component: () => import('@/views/system/permission/menu/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.system.menu',
|
||||
requiresAuth: true,
|
||||
permission: 'Rbac.Menus.Query',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'organizations',
|
||||
name: 'SystemOrganizations',
|
||||
component: () => import('@/views/system/organization/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.system.organization',
|
||||
requiresAuth: true,
|
||||
permission: 'Rbac.Organizations.Query',
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default SYSTEM_MANAGEMENT;
|
||||
|
||||
@ -2,8 +2,8 @@ import { DEFAULT_LAYOUT } from '../base';
|
||||
import { AppRouteRecordRaw } from '../types';
|
||||
|
||||
const SYSTEM: AppRouteRecordRaw = {
|
||||
path: '/system',
|
||||
name: 'system',
|
||||
path: '/api',
|
||||
name: 'api',
|
||||
component: DEFAULT_LAYOUT,
|
||||
meta: {
|
||||
locale: 'menu.api',
|
||||
@ -19,6 +19,7 @@ const SYSTEM: AppRouteRecordRaw = {
|
||||
meta: {
|
||||
locale: 'menu.api.upstreamInterface',
|
||||
requiresAuth: true,
|
||||
permission: 'Api.Interfaces.Query',
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -29,6 +30,7 @@ const SYSTEM: AppRouteRecordRaw = {
|
||||
locale: 'menu.api.createInterface',
|
||||
requiresAuth: true,
|
||||
hideInMenu: true,
|
||||
permission: 'Api.Interfaces.Create',
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -38,6 +40,7 @@ const SYSTEM: AppRouteRecordRaw = {
|
||||
meta: {
|
||||
locale: 'menu.api.downstreamInterface',
|
||||
requiresAuth: true,
|
||||
permission: 'Api.ServiceProviders.Query',
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -46,21 +49,22 @@ const SYSTEM: AppRouteRecordRaw = {
|
||||
component: () => import('@/views/system/interface/interface-config.vue'),
|
||||
meta: {
|
||||
locale: 'menu.api.editInterface',
|
||||
activeMenu: '/system/interface',
|
||||
activeMenu: '/api/interface',
|
||||
hideInMenu: true,
|
||||
dynamicNewTab: true,
|
||||
requiresAuth: true,
|
||||
permission: 'Api.Interfaces.Update',
|
||||
},
|
||||
},
|
||||
|
||||
// {
|
||||
// path: '/system/serviceProvider/serviceInterfaceList',
|
||||
// path: '/api/serviceProvider/serviceInterfaceList',
|
||||
// name: 'ServiceInterfaceList',
|
||||
// component: () =>
|
||||
// import('@/views/system/serviceProvidersList/serviceInterFaceIist.vue'),
|
||||
// meta: {
|
||||
// locale: '服务商接口列表',
|
||||
// activeMenu: '/system/serviceProvider/serviceInterfaceList',
|
||||
// activeMenu: '/api/serviceProvider/serviceInterfaceList',
|
||||
// hidden: true,
|
||||
// dynamicNewTab: true,
|
||||
// requiresAuth: true,
|
||||
@ -68,12 +72,13 @@ const SYSTEM: AppRouteRecordRaw = {
|
||||
// },
|
||||
|
||||
{
|
||||
path: '/system/newList/adhibition-list',
|
||||
path: '/api/newList/adhibition-list',
|
||||
name: 'AdhibitionList',
|
||||
component: () => import('@/views/system/newList/adhibition-list.vue'),
|
||||
meta: {
|
||||
locale: 'menu.api.appList',
|
||||
requiresAuth: true,
|
||||
permission: 'Api.Applications.Query',
|
||||
},
|
||||
},
|
||||
|
||||
@ -85,27 +90,30 @@ const SYSTEM: AppRouteRecordRaw = {
|
||||
meta: {
|
||||
locale: 'menu.api.requestLog',
|
||||
requiresAuth: true,
|
||||
permission: 'Api.Logs.Query',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
path: '/system/applicationStatistics',
|
||||
path: '/api/applicationStatistics',
|
||||
name: 'ApplicationStatistics',
|
||||
component: () => import('@/views/system/applicationStatistics.vue'),
|
||||
meta: {
|
||||
locale: 'menu.api.callStatistics',
|
||||
requiresAuth: true,
|
||||
permission: 'Api.Statistics.Query',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
path: '/system/newList/createApplication',
|
||||
path: '/api/newList/createApplication',
|
||||
name: 'CreateApplication',
|
||||
component: () => import('@/views/system/newList/createApplication.vue'),
|
||||
meta: {
|
||||
locale: 'menu.api.createApplication',
|
||||
requiresAuth: true,
|
||||
hideInMenu: true,
|
||||
permission: 'Api.Applications.Create',
|
||||
},
|
||||
},
|
||||
|
||||
@ -119,6 +127,7 @@ const SYSTEM: AppRouteRecordRaw = {
|
||||
dynamicNewTab: false,
|
||||
hideInMenu: true,
|
||||
requiresAuth: true,
|
||||
permission: 'Api.ServiceProviders.Create',
|
||||
},
|
||||
},
|
||||
|
||||
@ -129,6 +138,7 @@ const SYSTEM: AppRouteRecordRaw = {
|
||||
meta: {
|
||||
locale: 'menu.api.apiDebugger',
|
||||
requiresAuth: true,
|
||||
permission: 'Api.Debugger.Query',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@ -2,7 +2,7 @@ import { DEFAULT_LAYOUT } from '../base';
|
||||
import { AppRouteRecordRaw } from '../types';
|
||||
|
||||
const SYSTEM: AppRouteRecordRaw = {
|
||||
path: '/trajectoryCenter',
|
||||
path: '/track',
|
||||
name: 'TrajectoryCenter',
|
||||
component: DEFAULT_LAYOUT,
|
||||
meta: {
|
||||
@ -13,7 +13,7 @@ const SYSTEM: AppRouteRecordRaw = {
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'trajectoryOrder',
|
||||
path: 'order',
|
||||
name: 'TrajectoryOrder',
|
||||
component: () =>
|
||||
import('@/views/trajectoryCenter/trajectoryOrder/index.vue'),
|
||||
@ -21,10 +21,11 @@ const SYSTEM: AppRouteRecordRaw = {
|
||||
locale: 'menu.track.trackOrder',
|
||||
requiresAuth: true,
|
||||
order: 1,
|
||||
permission: 'Track.Orders.Query',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'trajectoryWarningOrder',
|
||||
path: 'warningOrder',
|
||||
name: 'TrajectoryWarningOrder',
|
||||
component: () =>
|
||||
import('@/views/trajectoryCenter/trajectoryWarningOrder/index.vue'),
|
||||
@ -32,10 +33,11 @@ const SYSTEM: AppRouteRecordRaw = {
|
||||
locale: 'menu.track.warningOrder',
|
||||
requiresAuth: true,
|
||||
order: 2,
|
||||
permission: 'Track.Warnings.Query',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'trajectoryState',
|
||||
path: 'state',
|
||||
name: 'TrajectoryState',
|
||||
component: () =>
|
||||
import('@/views/trajectoryCenter/trajectoryState/index.vue'),
|
||||
@ -43,10 +45,11 @@ const SYSTEM: AppRouteRecordRaw = {
|
||||
locale: 'menu.track.trackState',
|
||||
requiresAuth: true,
|
||||
order: 3,
|
||||
permission: 'Track.States.Query',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'trajectoryFlag',
|
||||
path: 'flag',
|
||||
name: 'TrajectoryFlag',
|
||||
component: () =>
|
||||
import('@/views/trajectoryCenter/trajectoryFlag/index.vue'),
|
||||
@ -54,10 +57,11 @@ const SYSTEM: AppRouteRecordRaw = {
|
||||
locale: 'menu.track.trackFlag',
|
||||
requiresAuth: true,
|
||||
order: 4,
|
||||
permission: 'Track.Flags.Query',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'trajectoryContent',
|
||||
path: 'content',
|
||||
name: 'TrajectoryContent',
|
||||
component: () =>
|
||||
import('@/views/trajectoryCenter/trajectoryContent/index.vue'),
|
||||
@ -65,10 +69,11 @@ const SYSTEM: AppRouteRecordRaw = {
|
||||
locale: 'menu.track.trackContent',
|
||||
requiresAuth: true,
|
||||
order: 5,
|
||||
permission: 'Track.Content.Query',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'trajectoryPull',
|
||||
path: 'pull',
|
||||
name: 'TrajectoryPull',
|
||||
component: () =>
|
||||
import('@/views/trajectoryCenter/trajectoryMapping/Pull.vue'),
|
||||
@ -76,10 +81,11 @@ const SYSTEM: AppRouteRecordRaw = {
|
||||
locale: 'menu.track.trackPull',
|
||||
requiresAuth: true,
|
||||
order: 6,
|
||||
permission: 'Track.Mapping.Query',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'trajectoryPush',
|
||||
path: 'push',
|
||||
name: 'TrajectoryPush',
|
||||
component: () =>
|
||||
import('@/views/trajectoryCenter/trajectoryMapping/Push.vue'),
|
||||
@ -87,6 +93,7 @@ const SYSTEM: AppRouteRecordRaw = {
|
||||
locale: 'menu.track.trackPush',
|
||||
requiresAuth: true,
|
||||
order: 7,
|
||||
permission: 'Track.Mapping.Query',
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -97,6 +104,7 @@ const SYSTEM: AppRouteRecordRaw = {
|
||||
locale: 'menu.track.kpiRegion',
|
||||
requiresAuth: true,
|
||||
order: 8,
|
||||
permission: 'Track.Kpi.Query',
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -108,6 +116,7 @@ const SYSTEM: AppRouteRecordRaw = {
|
||||
locale: 'menu.track.kpiEarlyWarningConfig',
|
||||
requiresAuth: true,
|
||||
order: 9,
|
||||
permission: 'Track.Kpi.Query',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@ -12,26 +12,6 @@ const USER: AppRouteRecordRaw = {
|
||||
order: 7,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'setting',
|
||||
name: 'Setting',
|
||||
component: () => import('@/views/user/setting/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.user.setting',
|
||||
requiresAuth: true,
|
||||
roles: ['*'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'message',
|
||||
name: 'UserMessage',
|
||||
component: () => import('@/views/system/message/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.user.message',
|
||||
requiresAuth: true,
|
||||
roles: ['*'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'recharge',
|
||||
name: 'VipRechargeDeposit',
|
||||
|
||||
@ -1,39 +1 @@
|
||||
import { DEFAULT_LAYOUT } from '../base';
|
||||
import { AppRouteRecordRaw } from '../types';
|
||||
|
||||
const VISUALIZATION: AppRouteRecordRaw = {
|
||||
path: '/visualization',
|
||||
name: 'visualization',
|
||||
component: DEFAULT_LAYOUT,
|
||||
meta: {
|
||||
locale: 'menu.visualization',
|
||||
requiresAuth: true,
|
||||
icon: 'icon-apps',
|
||||
order: 1,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'data-analysis',
|
||||
name: 'DataAnalysis',
|
||||
component: () => import('@/views/visualization/data-analysis/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.visualization.dataAnalysis',
|
||||
requiresAuth: true,
|
||||
roles: ['admin'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'multi-dimension-data-analysis',
|
||||
name: 'MultiDimensionDataAnalysis',
|
||||
component: () =>
|
||||
import('@/views/visualization/multi-dimension-data-analysis/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.visualization.multiDimensionDataAnalysis',
|
||||
requiresAuth: true,
|
||||
roles: ['admin'],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default VISUALIZATION;
|
||||
export default [];
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { userCenterLoginMenuGet } from '@/api/SimpleAdmin/userCenter';
|
||||
import { useUserStore } from '../user';
|
||||
import { MenuService } from '@/api/rbac';
|
||||
import { useRbacUserStore } from '../rbac-user';
|
||||
|
||||
const name = 'auth'; // 定义模块名称
|
||||
|
||||
@ -9,16 +9,20 @@ export interface MenuItem {
|
||||
id?: number | string;
|
||||
name?: string;
|
||||
path?: string;
|
||||
route?: string; // 兼容 route 字段
|
||||
component?: string;
|
||||
type?: number; // 菜单类型:1=菜单,2=按钮
|
||||
meta?: {
|
||||
title?: string;
|
||||
icon?: string;
|
||||
order?: number;
|
||||
isHide?: boolean;
|
||||
hideInMenu?: boolean; // 兼容 hideInMenu
|
||||
isFull?: boolean;
|
||||
isAffix?: boolean;
|
||||
isKeepAlive?: boolean;
|
||||
isHome?: boolean;
|
||||
locale?: string; // 国际化 key
|
||||
[key: string]: any;
|
||||
};
|
||||
children?: MenuItem[];
|
||||
@ -69,10 +73,19 @@ export const useAuthStore = defineStore({
|
||||
this.authMenuList = [];
|
||||
}
|
||||
|
||||
// 每次都从服务器获取最新菜单数据,不使用缓存
|
||||
const res = await userCenterLoginMenuGet({ id: moduleId });
|
||||
const resData = (res as any)?.data?.data || (res as any)?.data || res || [];
|
||||
this.authMenuList = Array.isArray(resData) ? resData : [];
|
||||
// 使用 RBAC 系统获取用户菜单
|
||||
const rbacUserStore = useRbacUserStore();
|
||||
if (!rbacUserStore.userInfo?.id) {
|
||||
console.warn('用户未登录,无法获取菜单');
|
||||
this.authMenuList = [];
|
||||
return;
|
||||
}
|
||||
|
||||
// 从 RBAC 系统获取用户菜单树
|
||||
const menuTree = await MenuService.getRbacMenuGetUserMenus(rbacUserStore.userInfo.id);
|
||||
// 将菜单树转换为菜单列表格式
|
||||
const menuList = convertMenuTreeToMenuList(menuTree || []);
|
||||
this.authMenuList = Array.isArray(menuList) ? menuList : [];
|
||||
console.log('获取到的菜单列表:', this.authMenuList);
|
||||
console.log('菜单列表长度:', this.authMenuList.length);
|
||||
} catch (error) {
|
||||
@ -92,7 +105,18 @@ export const useAuthStore = defineStore({
|
||||
/** 过滤隐藏的菜单 */
|
||||
function filterHideMenu(menuList: MenuItem[]): MenuItem[] {
|
||||
return menuList
|
||||
.filter((item) => !item.meta?.isHide)
|
||||
.filter((item) => {
|
||||
// 过滤掉隐藏的菜单
|
||||
if (item.meta?.isHide) {
|
||||
return false;
|
||||
}
|
||||
// 过滤掉特殊的"系统首页"菜单(category 为 "SPA" 且 module 为 null 的菜单)
|
||||
// 这类菜单通常是从其他地方自动添加的,不应该显示在导航菜单中
|
||||
if (item.category === 'SPA' && (item.module === null || item.module === undefined)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
})
|
||||
.map((item) => {
|
||||
if (item.children && item.children.length > 0) {
|
||||
return {
|
||||
@ -122,3 +146,35 @@ function flattenMenuList(menuList: MenuItem[]): MenuItem[] {
|
||||
return result;
|
||||
}
|
||||
|
||||
/** 将 RBAC 菜单树转换为菜单列表格式 */
|
||||
function convertMenuTreeToMenuList(menuTree: any[]): MenuItem[] {
|
||||
return menuTree.map((menu: any) => {
|
||||
const menuItem: MenuItem = {
|
||||
id: menu.id,
|
||||
name: menu.name,
|
||||
path: menu.route || menu.path, // 优先使用 route,兼容 path
|
||||
route: menu.route, // 保留 route 字段
|
||||
component: menu.component,
|
||||
type: menu.type, // 菜单类型
|
||||
meta: {
|
||||
title: menu.name,
|
||||
icon: menu.icon,
|
||||
order: menu.order,
|
||||
isHide: menu.isHidden || false, // 使用 isHidden 字段
|
||||
hideInMenu: menu.isHidden || false, // 兼容字段
|
||||
isFull: menu.isFull,
|
||||
isAffix: menu.isAffix,
|
||||
isKeepAlive: menu.isCached || false, // 使用 isCached 字段
|
||||
isHome: menu.isHome,
|
||||
locale: menu.meta?.locale, // 保留 locale
|
||||
},
|
||||
};
|
||||
|
||||
if (menu.children && menu.children.length > 0) {
|
||||
menuItem.children = convertMenuTreeToMenuList(menu.children);
|
||||
}
|
||||
|
||||
return menuItem;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user