mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat: 整合登录
This commit is contained in:
65
src/typings/api.d.ts → src/typings/api/api.d.ts
vendored
65
src/typings/api.d.ts → src/typings/api/api.d.ts
vendored
@ -8,40 +8,38 @@ declare namespace Api {
|
||||
/** common params of paginating */
|
||||
interface PaginatingCommonParams {
|
||||
/** current page number */
|
||||
current: number;
|
||||
pageNum: number;
|
||||
/** page size */
|
||||
size: number;
|
||||
pageSize: number;
|
||||
/** total count */
|
||||
total: number;
|
||||
}
|
||||
|
||||
/** common params of paginating query list data */
|
||||
interface PaginatingQueryRecord<T = any> extends PaginatingCommonParams {
|
||||
records: T[];
|
||||
rows: T[];
|
||||
}
|
||||
|
||||
/**
|
||||
* enable status
|
||||
*
|
||||
* - "1": enabled
|
||||
* - "2": disabled
|
||||
* - "0": enabled
|
||||
* - "1": disabled
|
||||
*/
|
||||
type EnableStatus = '1' | '2';
|
||||
type EnableStatus = '0' | '1';
|
||||
|
||||
/** common record */
|
||||
type CommonRecord<T = any> = {
|
||||
/** record id */
|
||||
id: number;
|
||||
/** record creator */
|
||||
createBy: string;
|
||||
/** record dept */
|
||||
createDept?: any;
|
||||
/** record create time */
|
||||
createTime: string;
|
||||
/** record updater */
|
||||
updateBy: string;
|
||||
/** record update time */
|
||||
updateTime: string;
|
||||
/** record status */
|
||||
status: EnableStatus | null;
|
||||
} & T;
|
||||
}
|
||||
|
||||
@ -51,16 +49,53 @@ declare namespace Api {
|
||||
* backend api module: "auth"
|
||||
*/
|
||||
namespace Auth {
|
||||
interface LoginData {
|
||||
tenantId?: string;
|
||||
username?: string;
|
||||
password?: string;
|
||||
rememberMe?: boolean;
|
||||
socialCode?: string;
|
||||
socialState?: string;
|
||||
source?: string;
|
||||
code?: string;
|
||||
uuid?: string;
|
||||
clientId: string;
|
||||
grantType: string;
|
||||
}
|
||||
|
||||
type LoginForm = Pick<LoginData, 'tenantId' | 'username' | 'password' | 'rememberMe' | 'code' | 'uuid'>;
|
||||
|
||||
interface LoginToken {
|
||||
token: string;
|
||||
refreshToken: string;
|
||||
access_token: string;
|
||||
client_id: string;
|
||||
expire_in: number;
|
||||
openid: string;
|
||||
refresh_expire_in: number;
|
||||
refresh_token: string;
|
||||
scope: string;
|
||||
}
|
||||
|
||||
interface UserInfo {
|
||||
userId: string;
|
||||
userName: string;
|
||||
user?: Api.System.User;
|
||||
roles: string[];
|
||||
buttons: string[];
|
||||
permissions: string[];
|
||||
}
|
||||
|
||||
interface Tenant {
|
||||
companyName: string;
|
||||
domain: string;
|
||||
tenantId: string;
|
||||
}
|
||||
|
||||
interface TenantList {
|
||||
tenantEnabled: boolean;
|
||||
voList: Tenant[];
|
||||
}
|
||||
|
||||
interface CaptchaCode {
|
||||
captchaEnabled: boolean;
|
||||
uuid?: string;
|
||||
img?: string;
|
||||
}
|
||||
}
|
||||
|
123
src/typings/api/system.api.d.ts
vendored
Normal file
123
src/typings/api/system.api.d.ts
vendored
Normal file
@ -0,0 +1,123 @@
|
||||
/**
|
||||
* Namespace Api
|
||||
*
|
||||
* All backend api type
|
||||
*/
|
||||
declare namespace Api {
|
||||
/**
|
||||
* namespace System
|
||||
*
|
||||
* backend api module: "system"
|
||||
*/
|
||||
namespace System {
|
||||
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'pageNum' | 'pageSize'>;
|
||||
|
||||
/** role */
|
||||
type Role = Common.CommonRecord<{
|
||||
roleId: string | number;
|
||||
roleName: string;
|
||||
roleKey: string;
|
||||
roleSort: number;
|
||||
dataScope: string;
|
||||
menuCheckStrictly: boolean;
|
||||
deptCheckStrictly: boolean;
|
||||
status: string;
|
||||
delFlag: string;
|
||||
remark?: any;
|
||||
flag: boolean;
|
||||
menuIds?: Array<string | number>;
|
||||
deptIds?: Array<string | number>;
|
||||
admin: boolean;
|
||||
}>;
|
||||
|
||||
/** role search params */
|
||||
type RoleSearchParams = CommonType.RecordNullable<
|
||||
Pick<Role, 'roleName' | 'roleKey' | 'status'> & CommonSearchParams
|
||||
>;
|
||||
|
||||
/** role list */
|
||||
type RoleList = Common.PaginatingQueryRecord<Role>;
|
||||
|
||||
/** all role */
|
||||
type AllRole = Pick<Role, 'roleId' | 'roleName' | 'roleKey'>;
|
||||
|
||||
/**
|
||||
* user gender
|
||||
*
|
||||
* - "1": "male"
|
||||
* - "2": "female"
|
||||
*/
|
||||
type UserGender = '1' | '2';
|
||||
|
||||
/** user */
|
||||
type User = Common.CommonRecord<{
|
||||
userId: string | number;
|
||||
deptId: number;
|
||||
userName: string;
|
||||
nickName: string;
|
||||
userType: string;
|
||||
email: string;
|
||||
phonenumber: string;
|
||||
sex: string;
|
||||
avatar: string;
|
||||
status: string;
|
||||
delFlag: string;
|
||||
loginIp: string;
|
||||
loginDate: string;
|
||||
remark: string;
|
||||
deptName: string;
|
||||
roles: Role[];
|
||||
roleIds: any;
|
||||
postIds: any;
|
||||
roleId: any;
|
||||
admin: boolean;
|
||||
}>;
|
||||
|
||||
/** user search params */
|
||||
type UserSearchParams = CommonType.RecordNullable<
|
||||
Pick<User, 'userName' | 'sex' | 'nickName' | 'phonenumber' | 'email' | 'status'> & CommonSearchParams
|
||||
>;
|
||||
|
||||
/** user list */
|
||||
type UserList = Common.PaginatingQueryRecord<User>;
|
||||
|
||||
/**
|
||||
* menu type
|
||||
*
|
||||
* - "M": "目录"
|
||||
* - "C": "菜单"
|
||||
* - "F": "按钮"
|
||||
*/
|
||||
type MenuType = 'M' | 'C' | 'F';
|
||||
|
||||
type Menu = Common.CommonRecord<
|
||||
{
|
||||
parentName: string;
|
||||
parentId: string | number;
|
||||
children: Menu[];
|
||||
menuId: string | number;
|
||||
menuName: string;
|
||||
orderNum: number;
|
||||
path: string;
|
||||
component: string;
|
||||
queryParam: string;
|
||||
isFrame: string;
|
||||
isCache: string;
|
||||
menuType: MenuType;
|
||||
visible: string;
|
||||
status: Common.EnableStatus;
|
||||
perms: string;
|
||||
icon: string;
|
||||
componentInfo: string;
|
||||
remark: string;
|
||||
keywords?: string;
|
||||
} & Pick<import('vue-router').RouteMeta, 'i18nKey'>
|
||||
>;
|
||||
|
||||
/** menu list */
|
||||
type MenuList = Common.PaginatingQueryRecord<Menu>;
|
||||
|
||||
type MenuSearchParams = CommonType.RecordNullable<Pick<Api.System.Menu, 'menuName' | 'status' | 'keywords'>> &
|
||||
CommonSearchParams;
|
||||
}
|
||||
}
|
3
src/typings/app.d.ts
vendored
3
src/typings/app.d.ts
vendored
@ -532,6 +532,7 @@ declare namespace App {
|
||||
baseURL: string;
|
||||
/** The proxy pattern of the backend service base url */
|
||||
proxyPattern: string;
|
||||
ws?: boolean;
|
||||
}
|
||||
|
||||
interface OtherServiceConfigItem extends ServiceConfigItem {
|
||||
@ -556,6 +557,8 @@ declare namespace App {
|
||||
msg: string;
|
||||
/** The backend service response data */
|
||||
data: T;
|
||||
rows?: any[];
|
||||
total?: number;
|
||||
};
|
||||
|
||||
/** The demo backend service response data */
|
||||
|
1
src/typings/components.d.ts
vendored
1
src/typings/components.d.ts
vendored
@ -76,6 +76,7 @@ declare module 'vue' {
|
||||
NScrollbar: typeof import('naive-ui')['NScrollbar']
|
||||
NSelect: typeof import('naive-ui')['NSelect']
|
||||
NSpace: typeof import('naive-ui')['NSpace']
|
||||
NSpin: typeof import('naive-ui')['NSpin']
|
||||
NStatistic: typeof import('naive-ui')['NStatistic']
|
||||
NSwitch: typeof import('naive-ui')['NSwitch']
|
||||
NTab: typeof import('naive-ui')['NTab']
|
||||
|
5
src/typings/env.d.ts
vendored
5
src/typings/env.d.ts
vendored
@ -103,6 +103,11 @@ declare namespace Env {
|
||||
readonly VITE_ICONIFY_URL?: string;
|
||||
/** Used to differentiate storage across different domains */
|
||||
readonly VITE_STORAGE_PREFIX?: string;
|
||||
readonly VITE_APP_CLIENT_ID?: string;
|
||||
readonly VITE_APP_ENCRYPT?: string;
|
||||
readonly VITE_APP_RSA_PUBLIC_KEY?: string;
|
||||
readonly VITE_APP_RSA_PRIVATE_KEY?: string;
|
||||
readonly VITE_APP_WEBSOCKET: string;
|
||||
}
|
||||
}
|
||||
|
||||
|
5
src/typings/storage.d.ts
vendored
5
src/typings/storage.d.ts
vendored
@ -7,6 +7,11 @@ declare namespace StorageType {
|
||||
// * the theme settings
|
||||
// */
|
||||
// themeSettings: App.Theme.ThemeSetting;
|
||||
sessionObj: {
|
||||
url: string;
|
||||
data: any;
|
||||
time: number;
|
||||
};
|
||||
}
|
||||
|
||||
interface Local {
|
||||
|
Reference in New Issue
Block a user