### GET /system/tenant/syncTenantPackage Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Synchronizes tenant package menu permissions. ```APIDOC ## GET /system/tenant/syncTenantPackage ### Description This endpoint synchronizes the menu permissions associated with a tenant's package. ### Method GET ### Endpoint /system/tenant/syncTenantPackage #### Query Parameters - **tenantId** (string) - Required - The ID of the tenant. - **packageId** (integer) - Required - The ID of the tenant's package. ### Request Example ```bash curl -X GET "http://localhost:8080/system/tenant/syncTenantPackage?tenantId=000001&packageId=1" \ -H "Authorization: Bearer eyJ..." ``` ### Response #### Success Response (200) - **code** (integer) - The status code, typically 200 for success. - **msg** (string) - A message indicating the operation was successful. ``` -------------------------------- ### Start Workflow Instance Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Initiates a new workflow instance with specified flow code, business ID, and variables. Requires authentication and a JSON payload. ```bash curl -X POST http://localhost:8080/workflow/task/startWorkFlow \ -H "Authorization: Bearer eyJ..." \ -H "Content-Type: application/json" \ -d '{ "flowCode": "leave_apply", "businessId": "BIZ_20240101_001", "variables": { "applyUserId": "100", "days": "3", "reason": "年假" } }' # 响应 { "code": 200, "msg": "提交成功", "data": { "instanceId": 1001, "taskId": 2001 } } ``` -------------------------------- ### GET /system/tenant/dynamic/{tenantId} Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Dynamically switches the current context to a specified tenant. Available for super administrators. ```APIDOC ## GET /system/tenant/dynamic/{tenantId} ### Description This endpoint allows a super administrator to dynamically switch the current operational context to a specified tenant. This is useful for cross-tenant management operations. ### Method GET ### Endpoint /system/tenant/dynamic/{tenantId} #### Path Parameters - **tenantId** (string) - Required - The ID of the tenant to switch to. ### Request Example ```bash curl -X GET http://localhost:8080/system/tenant/dynamic/000001 \ -H "Authorization: Bearer eyJ..." ``` ### Response #### Success Response (200) - **code** (integer) - The status code, typically 200 for success. - **msg** (string) - A message indicating the operation was successful. ### Clear Dynamic Tenant Context To clear the dynamic tenant context, use the following endpoint: ```bash curl -X GET http://localhost:8080/system/tenant/dynamic/clear \ -H "Authorization: Bearer eyJ..." ``` ``` -------------------------------- ### GET /resource/oss/download/{ossId} Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Downloads a file from object storage using its OSS ID. ```APIDOC ## GET /resource/oss/download/{ossId} ### Description This endpoint allows you to download a file from the object storage using its unique OSS ID. ### Method GET ### Endpoint /resource/oss/download/{ossId} #### Path Parameters - **ossId** (string) - Required - The OSS ID of the file to download. ### Request Example ```bash curl -X GET http://localhost:8080/resource/oss/download/1234567890 \ -H "Authorization: Bearer eyJ..." \ --output downloaded_image.png ``` ``` -------------------------------- ### Get Current Login User Information with LoginHelper Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt LoginHelper is a static utility class to retrieve current logged-in user information from Sa-Token sessions, supporting multi-tenant scenarios. It provides methods to get the full user object, common fields like user ID, username, and tenant ID, and perform permission checks. ```java // 获取当前登录用户完整信息 LoginUser loginUser = LoginHelper.getLoginUser(); // 获取常用字段(无需从 Session 反序列化完整对象) Long userId = LoginHelper.getUserId(); String userName = LoginHelper.getUsername(); String tenantId = LoginHelper.getTenantId(); Long deptId = LoginHelper.getDeptId(); // 权限判断 boolean isSuperAdmin = LoginHelper.isSuperAdmin(); boolean isTenantAdmin = LoginHelper.isTenantAdmin(); boolean isLoggedIn = LoginHelper.isLogin(); // 多端登录(PC 与 App 使用不同 deviceType) SaLoginParameter model = new SaLoginParameter().setDevice(DeviceType.PC.getDevice()); LoginHelper.login(loginUser, model); ``` -------------------------------- ### GET /tool/gen/db/list - Query Importable Tables Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Fetches a list of data tables available in the database for code generation. Supports filtering by table name and pagination. ```bash curl -X GET "http://localhost:8080/tool/gen/db/list?tableName=sys_&pageNum=1&pageSize=10" \ -H "Authorization: Bearer eyJ..." { "rows": [ { "tableName": "sys_user", "tableComment": "用户信息表", "createTime": "2024-01-01" } ], "total": 1 } ``` -------------------------------- ### GET /system/menu/getRouters Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Fetches the router menu for the current user, used for dynamic side menu generation. ```APIDOC ## GET /system/menu/getRouters ### Description This endpoint retrieves the router menu configuration for the currently authenticated user. This is typically called after login to dynamically generate the side navigation menu and routing table in the frontend application. ### Method GET ### Endpoint /system/menu/getRouters ### Request Example ```bash curl -X GET http://localhost:8080/system/menu/getRouters \ -H "Authorization: Bearer eyJ..." ``` ### Response #### Success Response (200) - **code** (integer) - The status code, typically 200 for success. - **data** (array) - An array of route objects, typically in a format compatible with Vue Router. - **name** (string) - The name of the route. - **path** (string) - The path for the route. - **hidden** (boolean) - Whether the route is hidden from the navigation. - **component** (string) - The component associated with the route. - **meta** (object) - Metadata for the route. - **title** (string) - The title displayed in the navigation. - **icon** (string) - The icon for the navigation item. - **children** (array) - An array of child routes, if any. ``` -------------------------------- ### GET /system/role/list Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Retrieves a paginated list of roles with optional filtering by role name. ```APIDOC ## GET /system/role/list ### Description This endpoint retrieves a paginated list of roles. You can filter the results by providing a `roleName`. ### Method GET ### Endpoint /system/role/list #### Query Parameters - **pageNum** (integer) - Required - The page number for pagination. - **pageSize** (integer) - Required - The number of items per page. - **roleName** (string) - Optional - Filters roles by name. ### Request Example ```bash curl -X GET "http://localhost:8080/system/role/list?pageNum=1&pageSize=10&roleName=管理员" \ -H "Authorization: Bearer eyJ..." ``` ### Response #### Success Response (200) - **rows** (array) - A list of role objects. - **roleId** (integer) - The ID of the role. - **roleName** (string) - The name of the role. - **roleKey** (string) - The key identifier for the role. - **roleSort** (integer) - The sort order of the role. - **status** (string) - The status of the role (e.g., '0' for active). - **menuIds** (array) - A list of menu IDs associated with the role. - **total** (integer) - The total number of roles available. ``` -------------------------------- ### GET /system/dept/list Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Retrieves a tree list of departments with optional filtering by status. ```APIDOC ## GET /system/dept/list ### Description This endpoint retrieves a hierarchical list of departments. You can filter the results by providing a `status`. ### Method GET ### Endpoint /system/dept/list #### Query Parameters - **status** (string) - Optional - Filters departments by their status (e.g., '0' for active). ### Request Example ```bash curl -X GET "http://localhost:8080/system/dept/list?status=0" \ -H "Authorization: Bearer eyJ..." ``` ### Response #### Success Response (200) - **code** (integer) - The status code, typically 200 for success. - **data** (array) - A list of department objects, structured hierarchically. - **deptId** (integer) - The ID of the department. - **parentId** (integer) - The ID of the parent department. - **deptName** (string) - The name of the department. - **ancestors** (string) - The ancestor string for the department. - **children** (array) - An array of child departments, if any. ``` -------------------------------- ### GET /tool/gen/db/list Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Retrieves a list of database tables that can be imported for code generation. Supports filtering by table name and pagination. ```APIDOC ## GET /tool/gen/db/list ### Description Queries the database to find tables that are available for code generation. This endpoint allows filtering by table name and supports pagination. ### Method GET ### Endpoint /tool/gen/db/list ### Query Parameters - **tableName** (string) - Optional - Filters the list of tables by name (supports wildcard). - **pageNum** (integer) - Optional - The page number to retrieve. - **pageSize** (integer) - Optional - The number of items per page. ### Response #### Success Response (200) - **rows** (array) - A list of database table objects. - **tableName** (string) - The name of the database table. - **tableComment** (string) - The comment or description of the table. - **createTime** (string) - The timestamp when the table was created. - **total** (integer) - The total number of importable tables. ``` -------------------------------- ### Get User List Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Fetches a paginated list of users. Requires the 'system:user:list' permission and supports filtering by department, username, phone number, and status. ```bash curl -X GET "http://localhost:8080/system/user/list?pageNum=1&pageSize=10&deptId=100&status=0" \ -H "Authorization: Bearer eyJ..." ``` -------------------------------- ### Get Tenant List Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Retrieves a list of tenants, typically for a login page dropdown. Supports IP rate limiting and filters tenants based on the request's Referer domain. ```bash curl -X GET "http://localhost:8080/auth/tenant/list" \ -H "Referer: http://tenant-a.example.com/" ``` -------------------------------- ### Get User Routers Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Fetches the router menu configuration for the current user, used to dynamically generate side menus and route tables in the frontend. Requires authentication. ```bash curl -X GET http://localhost:8080/system/menu/getRouters \ -H "Authorization: Bearer eyJ..." # 响应(Vue Router 格式路由) { "code": 200, "data": [ { "name": "System", "path": "/system", "hidden": false, "component": "Layout", "meta": { "title": "系统管理", "icon": "system" }, "children": [ { "name": "User", "path": "user", "component": "system/user/index", "meta": { "title": "用户管理", "perms": ["system:user:list"] } } ] } ] } ``` -------------------------------- ### GET /monitor/online/list Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Retrieves a list of currently online users. Supports filtering by username and pagination. ```APIDOC ## GET /monitor/online/list ### Description Queries the list of users currently logged into the system. This endpoint supports filtering by username and pagination. ### Method GET ### Endpoint /monitor/online/list ### Query Parameters - **userName** (string) - Optional - Filters the list of online users by username. - **pageNum** (integer) - Optional - The page number to retrieve. - **pageSize** (integer) - Optional - The number of items per page. ### Response #### Success Response (200) - **rows** (array) - A list of online user objects. - **tokenId** (string) - The unique token ID for the user's session. - **userName** (string) - The username of the online user. - **ipaddr** (string) - The IP address from which the user is connected. - **loginLocation** (string) - The geographical location of the user's IP address. - **browser** (string) - The browser used by the user. - **os** (string) - The operating system used by the user. - **loginTime** (string) - The timestamp when the user logged in. - **total** (integer) - The total number of online users. ``` -------------------------------- ### GET /tool/gen/download/{tableIds} Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Downloads a ZIP archive containing the generated code for the specified table IDs. This is typically done after importing tables and configuring generation settings. ```APIDOC ## GET /tool/gen/download/{tableIds} ### Description Downloads a ZIP file containing the code generated for the specified database tables. This endpoint is used after importing tables and configuring the code generation process. ### Method GET ### Endpoint /tool/gen/download/{tableIds} ### Path Parameters - **tableIds** (string) - Required - A comma-separated string of table IDs for which to download the generated code. ### Response #### Success Response (200) - The response is a ZIP file containing the generated code. ``` -------------------------------- ### GET /monitor/online/list - Query Online Users Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Retrieves a list of currently online users, with optional filtering by username. Includes user details like IP address, location, browser, OS, and login time. ```bash curl -X GET "http://localhost:8080/monitor/online/list?userName=admin" \ -H "Authorization: Bearer eyJ..." { "rows": [ { "tokenId": "abcd-token", "userName": "admin", "ipaddr": "192.168.1.1", "loginLocation": "广东省广州市", "browser": "Chrome", "os": "Windows 10", "loginTime": "2024-01-01 10:00:00" } ], "total": 1 } ``` -------------------------------- ### Get Tenant List Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Retrieves a list of tenants, typically used for a dropdown on the login page. The interface is rate-limited to 20 requests per 60 seconds and filters tenants based on the requesting domain. ```APIDOC ## GET /auth/tenant/list — Get Tenant List ### Description Retrieves a list of tenants, typically used for a dropdown on the login page. The interface is rate-limited to 20 requests per 60 seconds and filters tenants based on the requesting domain. ### Method GET ### Endpoint /auth/tenant/list ### Parameters #### Headers - **Referer** (string) - Required - The referring URL, used to determine the tenant domain. ### Response #### Success Response (200) - **code** (integer) - Response status code. - **data** (object) - Response data containing tenant information. - **tenantEnabled** (boolean) - Indicates if tenant functionality is enabled. - **voList** (array) - List of tenant view objects. - **tenantId** (string) - Identifier for the tenant. - **companyName** (string) - Name of the company associated with the tenant. - **domain** (string) - The domain associated with the tenant. #### Response Example ```json { "code": 200, "data": { "tenantEnabled": true, "voList": [ { "tenantId": "000000", "companyName": "总部", "domain": "tenant-a.example.com" } ] } } ``` ``` -------------------------------- ### GET /tool/gen/download/{tableIds} - Download Generated Code Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Downloads a ZIP archive containing the code generated for specified table IDs. This typically follows an import and generation process. ```bash # 先导入表,再根据 tableId 生成代码 curl -X GET "http://localhost:8080/tool/gen/download/1" \ -H "Authorization: Bearer eyJ..." \ --output generated_code.zip ``` -------------------------------- ### Manage Tenant Context with TenantHelper Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt TenantHelper manages the MyBatis-Plus multi-tenant interceptor context, allowing temporary ignoring of tenant isolation in code. It supports checking if multi-tenancy is enabled, getting the current tenant ID, and performing operations across all tenants or within a specific tenant context. ```java // 判断多租户功能是否启用 if (TenantHelper.isEnable()) { // 当前租户 ID String tenantId = TenantHelper.getTenantId(); } // 临时忽略租户隔离,查询所有租户数据(如超管操作) TenantHelper.ignore(() -> { List allUsers = userMapper.selectList(null); // 查所有租户用户 return allUsers; }); // 动态切换到指定租户上下文 TenantHelper.setDynamic("000001", true); try { // 该线程内的数据库操作都作用于租户 000001 userService.doSomethingInTenant(); } finally { TenantHelper.clearDynamic(); } ``` -------------------------------- ### GET /workflow/task/pageByTaskWait Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Retrieves a paginated list of tasks waiting for the current user's action. Supports filtering by pagination parameters. ```APIDOC ## GET /workflow/task/pageByTaskWait ### Description Queries the list of tasks currently waiting for the user's action. This endpoint supports pagination to manage large result sets. ### Method GET ### Endpoint /workflow/task/pageByTaskWait ### Query Parameters - **pageNum** (integer) - Optional - The page number to retrieve. - **pageSize** (integer) - Optional - The number of items per page. ### Response #### Success Response (200) - **rows** (array) - A list of task objects. - **taskId** (integer) - The ID of the task. - **taskName** (string) - The name of the task. - **flowName** (string) - The name of the workflow. - **businessId** (string) - The ID of the business associated with the task. - **createTime** (string) - The timestamp when the task was created. - **total** (integer) - The total number of tasks available. ``` -------------------------------- ### Get OAuth2 Binding URL Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Generates an OAuth2 authorization URL for third-party logins (e.g., GitHub, WeChat). Supports various platforms via JustAuth and requires tenant ID and domain. ```bash curl -X GET "http://localhost:8080/auth/binding/github?tenantId=000000&domain=localhost" ``` -------------------------------- ### GET /workflow/task/pageByTaskWait - Query Pending Tasks Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Retrieves a paginated list of tasks currently awaiting the current user's action. Supports filtering by page number and page size. ```bash curl -X GET "http://localhost:8080/workflow/task/pageByTaskWait?pageNum=1&pageSize=10" \ -H "Authorization: Bearer eyJ..." { "rows": [ { "taskId": 2001, "taskName": "部门经理审批", "flowName": "请假申请", "businessId": "BIZ_20240101_001", "createTime": "2024-01-01 09:00:00" } ], "total": 1 } ``` -------------------------------- ### Get Third-Party OAuth2 Redirect URL Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Generates a redirect URL for third-party OAuth2 authorization. Supports various platforms like GitHub, WeChat, DingTalk, and Feishu through the JustAuth library. ```APIDOC ## GET /auth/binding/{source} — Get Third-Party OAuth2 Redirect URL ### Description Generates a redirect URL for third-party OAuth2 authorization. Supports various platforms like GitHub, WeChat, DingTalk, and Feishu through the JustAuth library. ### Method GET ### Endpoint /auth/binding/{source} ### Parameters #### Path Parameters - **source** (string) - Required - The source of the third-party OAuth2 provider (e.g., "github"). #### Query Parameters - **tenantId** (string) - Required - Identifier for the tenant. - **domain** (string) - Required - The domain for the callback. ### Response #### Success Response (200) - **code** (integer) - Response status code. - **msg** (string) - Response message. - **data** (string) - The generated OAuth2 authorization URL. #### Response Example ```json { "code": 200, "msg": "操作成功", "data": "https://github.com/login/oauth/authorize?client_id=xxx&state=BASE64_JSON" } ``` ``` -------------------------------- ### POST /system/tenant Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Creates a new tenant in the system. Requires super admin privileges. ```APIDOC ## POST /system/tenant ### Description This endpoint creates a new tenant in the system. It requires the caller to have the super administrator role. The `@Lock4j` annotation is used to prevent concurrent duplicate creation. ### Method POST ### Endpoint /system/tenant #### Request Body - **companyName** (string) - Required - The name of the tenant's company. - **contactUserName** (string) - Required - The name of the primary contact person. - **contactPhone** (string) - Required - The phone number of the primary contact. - **domain** (string) - Required - The domain name associated with the tenant. - **packageId** (integer) - Required - The ID of the tenant's package. - **expireTime** (string) - Required - The expiration time for the tenant's subscription (YYYY-MM-DD). - **accountCount** (integer) - Required - The maximum number of accounts allowed for the tenant. - **username** (string) - Required - The username for the tenant's administrator. - **password** (string) - Required - The password for the tenant's administrator. ### Request Example ```bash curl -X POST http://localhost:8080/system/tenant \ -H "Authorization: Bearer eyJ..." \ -H "Content-Type: application/json" \ -d '{ "companyName": "新租户科技有限公司", "contactUserName": "张三", "contactPhone": "13800001111", "domain": "newtenant.example.com", "packageId": 1, "expireTime": "2026-12-31", "accountCount": 100, "username": "tenant_admin", "password": "TenantPass@123" }' ``` ### Response #### Success Response (200) - **code** (integer) - The status code, typically 200 for success. - **msg** (string) - A message indicating the operation was successful. ``` -------------------------------- ### User Registration Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Registers a new user. Requires tenant ID, username, password, confirmation password, and a verification code. Registration must be enabled in system parameters. ```bash curl -X POST http://localhost:8080/auth/register \ -H "Content-Type: application/json" \ -d '{ "tenantId": "000000", "username": "newuser", "password": "Test@1234", "confirmPassword": "Test@1234", "code": "1234", "uuid": "xxx-uuid" }' ``` -------------------------------- ### POST /workflow/task/startWorkFlow Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Initiates a new workflow instance with specified business data and variables. ```APIDOC ## POST /workflow/task/startWorkFlow ### Description This endpoint initiates a new workflow instance. You need to provide a `flowCode` to identify the workflow template, a `businessId` for tracking, and a `variables` object containing data relevant to the workflow. ### Method POST ### Endpoint /workflow/task/startWorkFlow #### Request Body - **flowCode** (string) - Required - The code identifying the workflow template. - **businessId** (string) - Required - The unique identifier for the business process. - **variables** (object) - Required - A key-value map of variables for the workflow instance. - **applyUserId** (string) - Example variable: The ID of the user applying. - **days** (string) - Example variable: Number of days for the request. - **reason** (string) - Example variable: The reason for the request. ### Request Example ```bash curl -X POST http://localhost:8080/workflow/task/startWorkFlow \ -H "Authorization: Bearer eyJ..." \ -H "Content-Type: application/json" \ -d '{ "flowCode": "leave_apply", "businessId": "BIZ_20240101_001", "variables": { "applyUserId": "100", "days": "3", "reason": "年假" } }' ``` ### Response #### Success Response (200) - **code** (integer) - The status code, typically 200 for success. - **msg** (string) - A message indicating the operation was successful. - **data** (object) - Contains information about the initiated workflow instance. - **instanceId** (integer) - The ID of the newly created workflow instance. - **taskId** (integer) - The ID of the initial task in the workflow. ``` -------------------------------- ### Create Tenant Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Adds a new tenant to the system. Requires super administrator privileges and uses `@Lock4j` to prevent concurrent creation. Requires authentication and a JSON payload. ```bash curl -X POST http://localhost:8080/system/tenant \ -H "Authorization: Bearer eyJ..." \ -H "Content-Type: application/json" \ -d '{ "companyName": "新租户科技有限公司", "contactUserName": "张三", "contactPhone": "13800001111", "domain": "newtenant.example.com", "packageId": 1, "expireTime": "2026-12-31", "accountCount": 100, "username": "tenant_admin", "password": "TenantPass@123" }' { "code": 200, "msg": "操作成功" } ``` -------------------------------- ### Sync Tenant Package Menu Permissions Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Synchronizes menu permissions for a tenant's package. Requires authentication. ```bash curl -X GET "http://localhost:8080/system/tenant/syncTenantPackage?tenantId=000001&packageId=1" \ -H "Authorization: Bearer eyJ..." { "code": 200, "msg": "操作成功" } ``` -------------------------------- ### Add New User Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Creates a new user account. Requires 'system:user:add' permission. Passwords are BCrypt encrypted, and account quotas are checked in multi-tenant mode. ```bash curl -X POST http://localhost:8080/system/user \ -H "Authorization: Bearer eyJ..." \ -H "Content-Type: application/json" \ -d '{ "userName": "zhangsan", "nickName": "张三", "deptId": 103, "phonenumber": "13900001111", "email": "zhangsan@example.com", "password": "Test@123", "sex": "0", "status": "0", "postIds": [1], "roleIds": [2] }' ``` -------------------------------- ### User Login with Password Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Use this endpoint for user authentication via password. Requires client ID, tenant ID, username, password, and a verification code. The request body is encrypted. ```bash curl -X POST http://localhost:8080/auth/login \ -H "Content-Type: application/json" \ -d '{ "clientId": "e5cd7e4891bf95d1d19206ce24a7b32e", "grantType": "password", "tenantId": "000000", "username": "admin", "password": "admin123", "code": "abcd", "uuid": "xxx-uuid" }' ``` -------------------------------- ### Dynamically Switch Tenant Context Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Allows a super administrator to switch to a specified tenant context for cross-tenant management operations. Requires authentication. ```bash curl -X GET http://localhost:8080/system/tenant/dynamic/000001 \ -H "Authorization: Bearer eyJ..." { "code": 200, "msg": "操作成功" } # 清除动态租户上下文 curl -X GET http://localhost:8080/system/tenant/dynamic/clear \ -H "Authorization: Bearer eyJ..." ``` -------------------------------- ### Upload File to OSS Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Uploads a file to the configured object storage backend (e.g., MinIO, Aliyun OSS, Tencent COS). Supports dynamic switching of storage backends. Requires authentication and a multipart/form-data request. ```bash curl -X POST http://localhost:8080/resource/oss/upload \ -H "Authorization: Bearer eyJ..." \ -F "file=@/path/to/image.png" # 成功响应 { "code": 200, "data": { "ossId": "1234567890", "fileName": "image.png", "url": "https://bucket.oss-cn-hangzhou.aliyuncs.com/2024/01/01/uuid_image.png" } } ``` -------------------------------- ### POST /resource/oss/upload Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Uploads a file to the configured object storage. Supports various backends like MinIO, Aliyun OSS, Tencent COS, and Qiniu. ```APIDOC ## POST /resource/oss/upload ### Description This endpoint uploads a file to the object storage service. The system supports multiple storage backends (e.g., MinIO, Aliyun OSS, Tencent COS, Qiniu) which can be dynamically switched via the management interface. ### Method POST ### Endpoint /resource/oss/upload #### Request Body - **file** (file) - Required - The file to upload. Use `multipart/form-data` encoding. ### Request Example ```bash curl -X POST http://localhost:8080/resource/oss/upload \ -H "Authorization: Bearer eyJ..." \ -F "file=@/path/to/image.png" ``` ### Response #### Success Response (200) - **code** (integer) - The status code, typically 200 for success. - **data** (object) - Contains information about the uploaded file. - **ossId** (string) - The unique identifier for the object in the storage. - **fileName** (string) - The original name of the uploaded file. - **url** (string) - The URL to access the uploaded file. ``` -------------------------------- ### User Registration Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Registers a new user. Requires the system to have registration enabled in system parameters. Automatically validates account quotas when multi-tenancy is enabled. ```APIDOC ## POST /auth/register — User Registration ### Description Registers a new user. Requires the system to have registration enabled in system parameters. Automatically validates account quotas when multi-tenancy is enabled. ### Method POST ### Endpoint /auth/register ### Parameters #### Request Body - **tenantId** (string) - Required - Identifier for the tenant. - **username** (string) - Required - Username for the new user. - **password** (string) - Required - Password for the new user. - **confirmPassword** (string) - Required - Confirmation of the password. - **code** (string) - Required - Verification code. - **uuid** (string) - Required - Unique identifier for the request. ### Request Example ```json { "tenantId": "000000", "username": "newuser", "password": "Test@1234", "confirmPassword": "Test@1234", "code": "1234", "uuid": "xxx-uuid" } ``` ### Response #### Success Response (200) - **code** (integer) - Response status code. - **msg** (string) - Response message. #### Error Response (500) - **code** (integer) - Response status code. - **msg** (string) - Error message indicating registration is not enabled. #### Response Example ```json { "code": 200, "msg": "操作成功" } ``` ```json { "code": 500, "msg": "当前系统没有开启注册功能!" } ``` ``` -------------------------------- ### Add User Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Creates a new user. Requires the `system:user:add` permission. Passwords are stored encrypted using BCrypt. When multi-tenancy is enabled, it automatically checks account quotas. ```APIDOC ## POST /system/user — Add User ### Description Creates a new user. Requires the `system:user:add` permission. Passwords are stored encrypted using BCrypt. When multi-tenancy is enabled, it automatically checks account quotas. ### Method POST ### Endpoint /system/user ### Parameters #### Headers - **Authorization** (string) - Required - Bearer token for authentication. #### Request Body - **userName** (string) - Required - Username for the new user. - **nickName** (string) - Required - Nickname for the new user. - **deptId** (integer) - Required - Department ID for the user. - **phonenumber** (string) - Optional - User's phone number. - **email** (string) - Optional - User's email address. - **password** (string) - Required - Password for the new user. - **sex** (string) - Optional - User's sex (e.g., "0" for male). - **status** (string) - Optional - User's status (e.g., "0" for enabled). - **postIds** (array) - Optional - Array of post IDs assigned to the user. - **roleIds** (array) - Optional - Array of role IDs assigned to the user. ### Request Example ```json { "userName": "zhangsan", "nickName": "张三", "deptId": 103, "phonenumber": "13900001111", "email": "zhangsan@example.com", "password": "Test@123", "sex": "0", "status": "0", "postIds": [1], "roleIds": [2] } ``` ### Response #### Success Response (200) - **code** (integer) - Response status code. - **msg** (string) - Response message. #### Error Response (500) - **code** (integer) - Response status code. - **msg** (string) - Error message indicating the username already exists. #### Response Example ```json { "code": 200, "msg": "操作成功" } ``` ```json { "code": 500, "msg": "新增用户'zhangsan'失败,登录账号已存在" } ``` ``` -------------------------------- ### Import User Data from Excel Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Imports user data from an Excel file. Supports updating existing records if `updateSupport` is set to true. Requires the uploaded file and authorization. ```bash curl -X POST "http://localhost:8080/system/user/importData?updateSupport=true" \ -H "Authorization: Bearer eyJ..." \ -F "file=@users_template.xlsx" ``` -------------------------------- ### Download File from OSS Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Downloads a file from object storage using its OSS ID. Requires authentication. ```bash curl -X GET http://localhost:8080/resource/oss/download/1234567890 \ -H "Authorization: Bearer eyJ..." \ --output downloaded_image.png ``` -------------------------------- ### User Login with SMS Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Authenticate users using their phone number and an SMS verification code. The request body is encrypted. ```bash curl -X POST http://localhost:8080/auth/login \ -H "Content-Type: application/json" \ -d '{ "clientId": "e5cd7e4891bf95d1d19206ce24a7b32e", "grantType": "sms", "tenantId": "000000", "phonenumber": "13800138000", "smsCode": "123456" }' ``` -------------------------------- ### Export User Data to Excel Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Exports the current user list to an Excel file. Requires appropriate authorization. ```bash curl -X POST "http://localhost:8080/system/user/export" \ -H "Authorization: Bearer eyJ..." \ --output users.xlsx ``` -------------------------------- ### POST /workflow/task/backProcess Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Rejects an approval task, requiring the task ID, node code, and a message explaining the reason for rejection. ```APIDOC ## POST /workflow/task/backProcess ### Description Rejects an approval task. This endpoint requires the task ID, the code of the node to which the task should be returned, and a message detailing the reason for rejection. ### Method POST ### Endpoint /workflow/task/backProcess ### Request Body - **taskId** (integer) - Required - The ID of the task to reject. - **nodeCode** (string) - Required - The code of the node to which the task should be returned. - **message** (string) - Required - The reason for rejecting the task. ### Request Example ```json { "taskId": 2001, "nodeCode": "apply_node", "message": "请假天数填写有误,请重新填写" } ``` ### Response #### Success Response (200) - **code** (integer) - The status code, typically 200 for success. - **msg** (string) - A message indicating the operation was successful. ``` -------------------------------- ### User Login Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Supports various authorization types including password, SMS, email, and WeChat Mini Program. The interface uses `@ApiEncrypt` for encrypted request body transmission and sends a welcome message via SSE upon successful login. ```APIDOC ## POST /auth/login — User Login ### Description Supports various authorization types including password, SMS, email, and WeChat Mini Program. The interface uses `@ApiEncrypt` for encrypted request body transmission and sends a welcome message via SSE upon successful login. ### Method POST ### Endpoint /auth/login ### Parameters #### Request Body - **clientId** (string) - Required - Client identifier. - **grantType** (string) - Required - Type of grant (e.g., "password", "sms"). - **tenantId** (string) - Required - Identifier for the tenant. - **username** (string) - Optional - Username for password grant. - **password** (string) - Optional - Password for password grant. - **phonenumber** (string) - Optional - Phone number for SMS grant. - **smsCode** (string) - Optional - SMS verification code. - **code** (string) - Optional - Verification code (e.g., for password reset or registration). - **uuid** (string) - Optional - Unique identifier for the request. ### Request Example ```json { "clientId": "e5cd7e4891bf95d1d19206ce24a7b32e", "grantType": "password", "tenantId": "000000", "username": "admin", "password": "admin123", "code": "abcd", "uuid": "xxx-uuid" } ``` ```json { "clientId": "e5cd7e4891bf95d1d19206ce24a7b32e", "grantType": "sms", "tenantId": "000000", "phonenumber": "13800138000", "smsCode": "123456" } ``` ### Response #### Success Response (200) - **code** (integer) - Response status code. - **msg** (string) - Response message. - **data** (object) - Response data containing authentication tokens. - **access_token** (string) - Access token for authentication. - **expire_in** (integer) - Token expiration time in seconds. - **client_id** (string) - Client identifier. #### Response Example ```json { "code": 200, "msg": "操作成功", "data": { "access_token": "eyJ...", "expire_in": 7200, "client_id": "e5cd7e4891bf95d1d19206ce24a7b32e" } } ``` ``` -------------------------------- ### Paginate Role List Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Retrieves a paginated list of roles with optional filtering by role name. Requires authentication. ```bash curl -X GET "http://localhost:8080/system/role/list?pageNum=1&pageSize=10&roleName=管理员" \ -H "Authorization: Bearer eyJ..." # 响应 { "rows": [ { "roleId": 1, "roleName": "超级管理员", "roleKey": "superadmin", "roleSort": 1, "status": "0", "menuIds": [1, 2, 3] } ], "total": 1 } ``` -------------------------------- ### Import Users from Excel Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Imports user data from an Excel file. Supports updating existing user records if `updateSupport` is set to true. ```APIDOC ## POST /system/user/importData — Import Users from Excel ### Description Imports user data from an Excel file. Supports updating existing user records if `updateSupport` is set to true. ### Method POST ### Endpoint /system/user/importData ### Parameters #### Query Parameters - **updateSupport** (boolean) - Optional - Whether to support updating existing user records. Defaults to false. #### Headers - **Authorization** (string) - Required - Bearer token for authentication. #### Request Body - **file** (file) - Required - The Excel file containing user data. ### Request Example ```bash curl -X POST "http://localhost:8080/system/user/importData?updateSupport=true" \ -H "Authorization: Bearer eyJ..." \ -F "file=@users_template.xlsx" ``` ### Response #### Success Response (200) - **code** (integer) - Response status code. - **msg** (string) - Response message indicating the import result. #### Response Example ```json { "code": 200, "msg": "恭喜您,数据已全部导入成功!共 5 条。" } ``` ``` -------------------------------- ### POST /workflow/task/backProcess - Reject Approval Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Rejects a workflow task, requiring a task ID, node code, and a message explaining the rejection. ```bash curl -X POST http://localhost:8080/workflow/task/backProcess \ -H "Authorization: Bearer eyJ..." \ -H "Content-Type: application/json" \ -d '{ "taskId": 2001, "nodeCode": "apply_node", "message": "请假天数填写有误,请重新填写" }' { "code": 200, "msg": "操作成功" } ``` -------------------------------- ### POST /workflow/task/taskOperation/{taskOperation} Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Performs various operations on a task, including transfer, delegation, adding a signature, or removing a signature. Requires task details and user information. ```APIDOC ## POST /workflow/task/taskOperation/{taskOperation} ### Description Performs operations on a workflow task such as transfer, delegation, adding a signature, or removing a signature. The specific operation is determined by the `{taskOperation}` path parameter. ### Method POST ### Endpoint /workflow/task/taskOperation/{taskOperation} ### Path Parameters - **taskOperation** (string) - Required - The type of operation to perform (e.g., `transferTask`, `delegateTask`, `addSignature`, `reductionSignature`). ### Request Body - **taskId** (integer) - Required - The ID of the task to operate on. - **userId** (string) - Required (for transfer/delegate) - The ID of the user to transfer or delegate the task to. - **message** (string) - Optional - A message providing context for the operation. ### Request Example (Transfer Task) ```json { "taskId": 2001, "userId": "300", "message": "本人出差,转办给张三" } ``` ### Response #### Success Response (200) - **code** (integer) - The status code, typically 200 for success. - **msg** (string) - A message indicating the operation was successful. ``` -------------------------------- ### Export Users to Excel Source: https://context7.com/dromara/ruoyi-vue-plus/llms.txt Exports user data to an Excel file. ```APIDOC ## POST /system/user/export — Export Users to Excel ### Description Exports user data to an Excel file. ### Method POST ### Endpoint /system/user/export ### Parameters #### Headers - **Authorization** (string) - Required - Bearer token for authentication. ### Request Example ```bash curl -X POST "http://localhost:8080/system/user/export" \ -H "Authorization: Bearer eyJ..." \ --output users.xlsx ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.