feat: 动态路由

This commit is contained in:
2025-09-12 15:37:07 +08:00
parent 2bb11b49fe
commit e42e1c01fb
14 changed files with 321 additions and 118 deletions

View File

@@ -40,7 +40,6 @@ export async function login(
// };
export async function getTenantIdByName(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: { name: string },
options?: { [key: string]: any }
) {

View File

@@ -1,41 +1,41 @@
import request from '@/config/axios'
import { request } from "@umijs/max";
// 获得授权信息
export const getAuthorize = (clientId: string) => {
return request.get({ url: '/system/oauth2/authorize?clientId=' + clientId })
}
// export const getAuthorize = (clientId: string) => {
// return request.get({ url: '/system/oauth2/authorize?clientId=' + clientId })
// }
// 发起授权
export const authorize = (
responseType: string,
clientId: string,
redirectUri: string,
state: string,
autoApprove: boolean,
checkedScopes: string[],
uncheckedScopes: string[]
) => {
// 构建 scopes
const scopes = {}
for (const scope of checkedScopes) {
scopes[scope] = true
}
for (const scope of uncheckedScopes) {
scopes[scope] = false
}
// 发起请求
return request.post({
url: '/system/oauth2/authorize',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
params: {
response_type: responseType,
client_id: clientId,
redirect_uri: redirectUri,
state: state,
auto_approve: autoApprove,
scope: JSON.stringify(scopes)
}
})
}
// // 发起授权
// export const authorize = (
// responseType: string,
// clientId: string,
// redirectUri: string,
// state: string,
// autoApprove: boolean,
// checkedScopes: string[],
// uncheckedScopes: string[]
// ) => {
// // 构建 scopes
// const scopes = {}
// for (const scope of checkedScopes) {
// scopes[scope] = true
// }
// for (const scope of uncheckedScopes) {
// scopes[scope] = false
// }
// // 发起请求
// return request.post({
// url: '/system/oauth2/authorize',
// headers: {
// 'Content-Type': 'application/x-www-form-urlencoded'
// },
// params: {
// response_type: responseType,
// client_id: clientId,
// redirect_uri: redirectUri,
// state: state,
// auto_approve: autoApprove,
// scope: JSON.stringify(scopes)
// }
// })
// }

View File

@@ -16,6 +16,7 @@ export interface MenuVO {
keepAlive: boolean;
alwaysShow?: boolean;
createTime: Date;
children?: MenuVO[];
}
// 查询菜单(精简)列表