Browse Source

🧟‍♀ 重构前端框架进行适配后端框架

master
wangxiang 3 years ago
parent
commit
b62fbd93d2
  1. 6
      kicc-ui/src/api/common/base/constant/index.ts
  2. 36
      kicc-ui/src/api/common/base/entity/index.ts
  3. 6
      kicc-ui/src/api/common/base/enums/index.ts
  4. 7
      kicc-ui/src/api/common/base/exception/index.ts
  5. 6
      kicc-ui/src/api/common/data/constant/index.ts
  6. 34
      kicc-ui/src/api/common/data/entity/index.ts
  7. 6
      kicc-ui/src/api/common/data/enums/index.ts
  8. 11
      kicc-ui/src/api/controller/sys/menu.ts
  9. 12
      kicc-ui/src/api/controller/sys/model/menuModel.ts
  10. 5
      kicc-ui/src/api/controller/sys/model/uploadModel.ts
  11. 22
      kicc-ui/src/api/controller/sys/upload.ts
  12. 23
      kicc-ui/src/api/controller/system/model/deptModel.ts
  13. 24
      kicc-ui/src/api/controller/system/model/menuModel.ts
  14. 18
      kicc-ui/src/api/controller/system/model/roleModel.ts
  15. 28
      kicc-ui/src/api/controller/system/model/userModel.ts
  16. 57
      kicc-ui/src/api/model/index.ts
  17. 14
      kicc-ui/src/api/platform/core/controller/menu.ts
  18. 15
      kicc-ui/src/api/platform/core/controller/upload.ts
  19. 35
      kicc-ui/src/api/platform/core/controller/user.ts
  20. 12
      kicc-ui/src/api/platform/core/entity/menu.ts
  21. 14
      kicc-ui/src/api/platform/core/entity/upload.ts
  22. 56
      kicc-ui/src/api/platform/core/entity/user.ts
  23. 2
      kicc-ui/src/api/platform/system/controller/client.ts
  24. 2
      kicc-ui/src/api/platform/system/controller/config.ts
  25. 5
      kicc-ui/src/api/platform/system/controller/dept.ts
  26. 2
      kicc-ui/src/api/platform/system/controller/dict.ts
  27. 2
      kicc-ui/src/api/platform/system/controller/dictdata.ts
  28. 2
      kicc-ui/src/api/platform/system/controller/log.ts
  29. 8
      kicc-ui/src/api/platform/system/controller/menu.ts
  30. 4
      kicc-ui/src/api/platform/system/controller/role.ts
  31. 9
      kicc-ui/src/api/platform/system/controller/user.ts
  32. 8
      kicc-ui/src/api/platform/system/entity/clientModel.ts
  33. 8
      kicc-ui/src/api/platform/system/entity/configModel.ts
  34. 30
      kicc-ui/src/api/platform/system/entity/dept.ts
  35. 8
      kicc-ui/src/api/platform/system/entity/dictDataModel.ts
  36. 8
      kicc-ui/src/api/platform/system/entity/dictModel.ts
  37. 8
      kicc-ui/src/api/platform/system/entity/logModel.ts
  38. 31
      kicc-ui/src/api/platform/system/entity/menu.ts
  39. 25
      kicc-ui/src/api/platform/system/entity/role.ts
  40. 16
      kicc-ui/src/api/platform/system/entity/user.ts
  41. 4
      kicc-ui/src/components/Upload/src/typing.ts
  42. 4
      kicc-ui/src/store/modules/permission.ts
  43. 38
      kicc-ui/src/store/modules/user.ts
  44. 5
      kicc-ui/src/utils/cache/persistent.ts
  45. 2
      kicc-ui/src/utils/cipher.ts
  46. 26
      kicc-ui/src/utils/http/axios/Axios.ts
  47. 20
      kicc-ui/src/utils/http/axios/axiosCancel.ts
  48. 33
      kicc-ui/src/utils/http/axios/axiosTransform.ts
  49. 4
      kicc-ui/src/utils/http/axios/helper.ts
  50. 28
      kicc-ui/src/utils/http/axios/index.ts
  51. 8
      kicc-ui/src/views/sys/lock/LockPage.vue
  52. 2
      kicc-ui/src/views/sys/login/LoginForm.vue
  53. 2
      kicc-ui/src/views/system/client/ClientDrawer.vue
  54. 2
      kicc-ui/src/views/system/client/index.vue
  55. 2
      kicc-ui/src/views/system/config/ConfigModal.vue
  56. 2
      kicc-ui/src/views/system/config/index.vue
  57. 2
      kicc-ui/src/views/system/dept/DeptModal.vue
  58. 2
      kicc-ui/src/views/system/dept/index.vue
  59. 2
      kicc-ui/src/views/system/dict/DictDataModal.vue
  60. 2
      kicc-ui/src/views/system/dict/DictDataTable.vue
  61. 2
      kicc-ui/src/views/system/dict/DictModal.vue
  62. 2
      kicc-ui/src/views/system/dict/index.vue
  63. 2
      kicc-ui/src/views/system/log/index.vue
  64. 2
      kicc-ui/src/views/system/menu/MenuModal.vue
  65. 2
      kicc-ui/src/views/system/menu/index.vue
  66. 4
      kicc-ui/src/views/system/role/RoleDrawer.vue
  67. 2
      kicc-ui/src/views/system/role/index.vue
  68. 2
      kicc-ui/src/views/system/role/role.data.ts
  69. 2
      kicc-ui/src/views/system/user/DeptTree.vue
  70. 2
      kicc-ui/src/views/system/user/ResetPwdModal.vue
  71. 4
      kicc-ui/src/views/system/user/UserModal.vue
  72. 2
      kicc-ui/src/views/system/user/index.vue
  73. 4
      kicc-ui/src/views/system/user/user.data.ts
  74. 7
      kicc-ui/types/axios.d.ts
  75. 31
      kicc-ui/types/store.d.ts

6
kicc-ui/src/api/common/base/constant/index.ts

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
/**
* @program: kicc-ui
* @description:
* @author: entfrm开发团队-
* @create: 2022/4/8
*/

36
kicc-ui/src/api/common/base/entity/index.ts

@ -0,0 +1,36 @@ @@ -0,0 +1,36 @@
/**
* @program: kicc-ui
* @description:
*
* @author: entfrm开发团队-
* @create: 2022/4/8
*/
/** 扩展安全框架用户信息 */
export interface KiccUser {
id: string;
username: string;
password: string;
deptId: string;
phone: string;
enabled: boolean;
tenantId: string;
authorities: Recordable[];
accountNonLocked: boolean;
accountNonExpired: boolean;
credentialsNonExpired: boolean;
[key: string]: any;
}
/** 基础模型 */
export interface BaseEntity {
tenantId: string;
currentUser: KiccUser;
sqlFilter: string;
}
/** 结果集模型 */
export interface ResultVo<T = any> {
result: T;
extend: T;
}

6
kicc-ui/src/api/common/base/enums/index.ts

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
/**
* @program: kicc-ui
* @description:
* @author: entfrm开发团队-
* @create: 2022/4/8
*/

7
kicc-ui/src/api/common/base/exception/index.ts

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
/**
* @program: kicc-ui
* @description:
*
* @author: entfrm开发团队-
* @create: 2022/4/8
*/

6
kicc-ui/src/api/common/data/constant/index.ts

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
/**
* @program: kicc-ui
* @description:
* @author: entfrm开发团队-
* @create: 2022/4/8
*/

34
kicc-ui/src/api/common/data/entity/index.ts

@ -0,0 +1,34 @@ @@ -0,0 +1,34 @@
/**
* @program: kicc-ui
* @description:
*
* @author: entfrm开发团队-
* @create: 2022/4/8
*/
/** 分页模型 */
export interface Page {
size: number;
current: number;
total: number;
[key: string]: any;
}
/** 通用模型 */
export interface CommonEntity {
createById: string;
createByName: string;
createTime: string;
updateById: string;
updateByName: string;
updateTime: string;
remarks: string;
}
/** 树结构模型 */
export interface TreeEntity<T = any> {
parentId: string;
name: string;
sort: number;
children: T[]
}

6
kicc-ui/src/api/common/data/enums/index.ts

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
/**
* @program: kicc-ui
* @description:
* @author: entfrm开发团队-
* @create: 2022/4/8
*/

11
kicc-ui/src/api/controller/sys/menu.ts

@ -1,11 +0,0 @@ @@ -1,11 +0,0 @@
import { defHttp } from '/@/utils/http/axios';
import { getMenuListResultModel } from './model/menuModel';
enum Api {
GetMenuList = '/system_proxy/system/menu/menuRoute',
}
/** 获取用户菜单 */
export const getMenuList = () => {
return defHttp.get<getMenuListResultModel>({ url: Api.GetMenuList });
};

12
kicc-ui/src/api/controller/sys/model/menuModel.ts

@ -1,12 +0,0 @@ @@ -1,12 +0,0 @@
import type { RouteMeta } from 'vue-router';
export interface RouteItem {
path: string;
component: any;
meta: RouteMeta;
name?: string;
redirect?: string;
children?: RouteItem[];
}
/** 获取菜单路由 */
export type getMenuListResultModel = RouteItem[];

5
kicc-ui/src/api/controller/sys/model/uploadModel.ts

@ -1,5 +0,0 @@ @@ -1,5 +0,0 @@
export interface UploadApiResult {
message: string;
code: number;
url: string;
}

22
kicc-ui/src/api/controller/sys/upload.ts

@ -1,22 +0,0 @@ @@ -1,22 +0,0 @@
import { UploadApiResult } from './model/uploadModel';
import { defHttp } from '/@/utils/http/axios';
import { UploadFileParams } from '/#/axios';
import { useGlobSetting } from '/@/hooks/setting';
const { uploadUrl = '' } = useGlobSetting();
/**
* @description: Upload interface
*/
export function uploadApi(
params: UploadFileParams,
onUploadProgress: (progressEvent: ProgressEvent) => void
) {
return defHttp.uploadFile<UploadApiResult>(
{
url: uploadUrl,
onUploadProgress,
},
params
);
}

23
kicc-ui/src/api/controller/system/model/deptModel.ts

@ -1,23 +0,0 @@ @@ -1,23 +0,0 @@
// 引入基础包
import { Page, R, CommonEntity } from '/@/api/model';
// 查询参数
export type DeptDto = Page & Dept;
// 部门对象
export interface Dept extends CommonEntity {
deptId: string;
code: string;
name: string;
parentId: string;
sort: number;
contacts: string;
phone: string;
address: string;
email: string;
status: string;
[key: string]: any;
}
// 响应模型
export type DeptVo = R<Dept[]>;

24
kicc-ui/src/api/controller/system/model/menuModel.ts

@ -1,24 +0,0 @@ @@ -1,24 +0,0 @@
// 引入基础包
import { Page, R, CommonEntity } from '/@/api/model';
// 查询参数
export type MenuDto = Page & Menu;
// 菜单对象
export interface Menu extends CommonEntity {
id: string;
name: string;
parentId: string;
type: string;
path: string;
component: string;
permission: string;
icon: string;
keepAlive: string;
hideMenu: string;
sort: string;
[key: string]: any;
}
// 响应模型
export type MenuVo = R<Menu[]>;

18
kicc-ui/src/api/controller/system/model/roleModel.ts

@ -1,18 +0,0 @@ @@ -1,18 +0,0 @@
// 引入基础包
import { CommonEntity, Page, R } from '/@/api/model';
// 查询参数
export type RoleDto = Page & Role;
// 角色对象
export interface Role extends CommonEntity {
id: string;
name: string;
code: string;
sort: string;
status: string;
[key: string]: any;
}
// 响应模型
export type RoleVo = R<Role[]>;

28
kicc-ui/src/api/controller/system/model/userModel.ts

@ -1,28 +0,0 @@ @@ -1,28 +0,0 @@
// 引入基础包
import { CommonEntity, Page, R } from '/@/api/model';
// 查询参数
export type UserDto = Page & User;
// 用户对象
export interface User extends CommonEntity {
id: string;
userName: string;
nickName: string;
password: string;
deptId: string;
deptName: string;
email: string;
phone: string;
sex: string;
avatar: string;
loginIp: string;
loginTime: string;
status: string;
roleIds: string[];
permissions: string[];
[key: string]: any;
}
// 响应模型
export type UserVo = R<User[]>;

57
kicc-ui/src/api/model/index.ts

@ -1,57 +0,0 @@ @@ -1,57 +0,0 @@
/** 分页模型 */
export interface Page {
size: number;
current: number;
total: number;
[key: string]: any;
}
/** 响应信息主体 */
export interface R<T extends any> {
code: number;
msg: string;
total: number;
data: T;
}
/** 扩展安全框架用户信息 */
export interface KiccUser {
tenantId: string;
id: string;
deptId: string;
phone: string;
[key: string]: any;
}
/** 基础模型 */
export interface BaseEntity {
tenantId: string;
currentUser: KiccUser;
sqlFilter: string;
}
/** 通用模型 */
export interface CommonEntity {
createById: string;
createByName: string;
createTime: string;
updateById: string;
updateByName: string;
updateTime: string;
remarks: string;
}
/** 树结构模型 */
export interface TreeEntity<T extends any> {
parentId: string;
name: string;
sort: number;
children: T[]
}
/** 结果集模型 */
export interface ResultVo<T extends any> {
result: T;
extend: T;
}

14
kicc-ui/src/api/platform/core/controller/menu.ts

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
/**
* api模板规范代码参考,
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved.
* author entfrm开发团队-
*/
import { defHttp } from '/@/utils/http/axios';
import { MenuRouteResult } from '../entity/menu';
enum Api {
list = '/system_proxy/system/menu/menuRoute',
}
/** 获取用户菜单 */
export const listMenuRoute = () => defHttp.get<MenuRouteResult>({ url: Api.list });

15
kicc-ui/src/api/platform/core/controller/upload.ts

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
/**
* api模板规范代码参考,
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved.
* author entfrm开发团队-
*/
import { UploadResult } from '../entity/upload';
import { defHttp } from '/@/utils/http/axios';
import { UploadFileParams } from '/#/axios';
import { useGlobSetting } from '/@/hooks/setting';
const { uploadUrl = '' } = useGlobSetting();
/** 通用OSS上传 */
export const commonUpload = (params: UploadFileParams, onUploadProgress: (progressEvent: ProgressEvent) => void) =>
defHttp.uploadFile<UploadResult>({ url: uploadUrl, onUploadProgress }, params);

35
kicc-ui/src/api/controller/sys/user.ts → kicc-ui/src/api/platform/core/controller/user.ts

@ -1,11 +1,16 @@ @@ -1,11 +1,16 @@
import {defHttp} from '/@/utils/http/axios';
import {GetCaptchaModel, GetUserInfoModel, LoginParams, LoginResultModel,} from './model/userModel';
import {encryptionLogin} from '/@/utils/cipher';
/**
* api模板规范代码参考,
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved.
* author entfrm开发团队-
*/
import { defHttp } from '/@/utils/http/axios';
import { Captcha, User, LoginParams, TokenEnhancer } from '../entity/user';
import { encryptionLogin } from '/@/utils/cipher';
import qs from 'qs';
import {RequestOptions} from "/#/axios";
import {useGlobSetting} from "/@/hooks/setting";
const globSetting = useGlobSetting();
import { RequestOptions } from "/#/axios";
import { useGlobSetting } from "/@/hooks/setting";
const globSetting = useGlobSetting();
enum Api {
login = '/auth_proxy/oauth/token',
logout = '/auth_proxy/token/logout',
@ -14,7 +19,7 @@ enum Api { @@ -14,7 +19,7 @@ enum Api {
}
/** 用户登录接口 */
export function login(params: LoginParams, options?: boolean | RequestOptions) {
export const login = (params: LoginParams, options?: boolean | RequestOptions) => {
// 非对称密钥ASE加密处理
const user = encryptionLogin({
data: params,
@ -30,7 +35,7 @@ export function login(params: LoginParams, options?: boolean | RequestOptions) { @@ -30,7 +35,7 @@ export function login(params: LoginParams, options?: boolean | RequestOptions) {
const scope = 'server';
const data = qs.stringify({'username': username, 'password': password});
return defHttp.post<LoginResultModel>({
return defHttp.post<TokenEnhancer>({
url: Api.login,
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
@ -38,19 +43,13 @@ export function login(params: LoginParams, options?: boolean | RequestOptions) { @@ -38,19 +43,13 @@ export function login(params: LoginParams, options?: boolean | RequestOptions) {
params: { code, realKey, grant_type, scope },
data: data
}, <RequestOptions>options);
}
};
/** 获取当前用户信息 */
export function getUserInfo() {
return defHttp.get<GetUserInfoModel>({ url: Api.getUserInfo });
}
export const getUserInfo = () => defHttp.get<User>({ url: Api.getUserInfo });
/** 登出 */
export function logout() {
return defHttp.delete({ url: Api.logout });
}
export const logout = () => defHttp.delete({ url: Api.logout });
/** 获取验证码 */
export function getCaptcha() {
return defHttp.get<GetCaptchaModel>({ url: `${Api.getCaptcha}?key=${Date.now()}` });
}
export const getCaptcha = () => defHttp.get<Captcha>({ url: `${Api.getCaptcha}?key=${Date.now()}` });

12
kicc-ui/src/api/platform/core/entity/menu.ts

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
/**
* @program: kicc-ui
* @description:
*
* @author: entfrm开发团队-
* @create: 2022/4/8
*/
import {AppRouteRecordRaw} from "/@/router/types";
/** 菜单路由响应对象 */
export type MenuRouteResult = AppRouteRecordRaw[];

14
kicc-ui/src/api/platform/core/entity/upload.ts

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
/**
* @program: kicc-ui
* @description:
*
* @author: entfrm开发团队-
* @create: 2022/4/8
*/
/** oss上传返回结果对象 */
export interface UploadResult {
message: string;
code: number;
url: string;
}

56
kicc-ui/src/api/controller/sys/model/userModel.ts → kicc-ui/src/api/platform/core/entity/user.ts

@ -1,34 +1,25 @@ @@ -1,34 +1,25 @@
/**
* @description: Login interface parameters
* @program: kicc-ui
* @description:
*
* @author: entfrm开发团队-
* @create: 2022/4/8
*/
import { CommonEntity } from "/@/api/common/data/entity";
import { KiccUser } from "/@/api/common/base/entity";
/** 登录参数对象 */
export interface LoginParams {
username: string;
password: string;
realKey?: string;
code?: string;
}
export interface UserInfo {
accountNonExpired: boolean;
accountNonLocked: boolean;
authorities: string[];
credentialsNonExpired: boolean;
deptId: string;
enabled: boolean;
id: string;
password?: string;
phone: string;
tenantId: string;
username: string;
[key: string]: any;
}
/**
* @description: Login interface return value
*/
export interface LoginResultModel {
/** 令牌增强输出对象 */
export interface TokenEnhancer {
access_token: string;
clientId: string;
expires_in: number;
@ -36,13 +27,11 @@ export interface LoginResultModel { @@ -36,13 +27,11 @@ export interface LoginResultModel {
refresh_token: string;
scope: string;
token_type: string;
user_info: UserInfo;
user_info: KiccUser;
}
/**
* @description: Get user information return value
*/
export interface GetUserInfoModel {
/** 用户对象 */
export interface User extends CommonEntity {
// 用户id
id: string;
// 用户名
@ -63,16 +52,29 @@ export interface GetUserInfoModel { @@ -63,16 +52,29 @@ export interface GetUserInfoModel {
roleIds: string[];
// 手机号
phone: string;
// 用户密码
password: string;
// 用户性别
sex: string;
// 最后登陆IP
loginIp: string;
// 最后登陆时间
loginTime: string;
// 用户状态
status: string;
// 备注信息
remarks: string;
// 多租户ID
tenantId: string;
// 指定登录后首页跳转
homePath?: string;
[key: string]: any;
}
export interface GetCaptchaModel {
/** 验证码对象 */
export interface Captcha {
// 验证码地址
img: string;
// 一key
// redis拿取验证码唯一key
realKey: string;
}

2
kicc-ui/src/api/controller/system/client.ts → kicc-ui/src/api/platform/system/controller/client.ts

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
import { ClientParams, ClientListGetResultModel, ClientListItem } from './model/clientModel';
import { ClientParams, ClientListGetResultModel, ClientListItem } from '../entity/clientModel';
import { defHttp } from '/@/utils/http/axios';
enum Api {

2
kicc-ui/src/api/controller/system/config.ts → kicc-ui/src/api/platform/system/controller/config.ts

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
import { ConfigParams, Config, ConfigResult } from './model/configModel'
import { ConfigParams, Config, ConfigResult } from '../entity/configModel'
import { defHttp } from '/@/utils/http/axios';
import {isDef} from "/@/utils/is";

5
kicc-ui/src/api/controller/system/dept.ts → kicc-ui/src/api/platform/system/controller/dept.ts

@ -3,8 +3,7 @@ @@ -3,8 +3,7 @@
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved.
* author entfrm开发团队-
*/
import { DeptDto, Dept } from './model/deptModel';
import { DeptParams, Dept } from '/@/api/platform/system/entity/dept';
import { defHttp } from '/@/utils/http/axios';
enum Api {
@ -16,7 +15,7 @@ enum Api { @@ -16,7 +15,7 @@ enum Api {
}
// 查询部门列表
export const listDept = (params?: Partial<DeptDto>) => defHttp.get({ url: Api.list, params });
export const listDept = (params?: Partial<DeptParams>) => defHttp.get({ url: Api.list, params });
// 新增部门
export const addDept = (params: Partial<Dept>) => defHttp.post({ url: Api.add, data: params });

2
kicc-ui/src/api/controller/system/dict.ts → kicc-ui/src/api/platform/system/controller/dict.ts

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
import { DictParams, DictResult, Dict } from './model/dictModel';
import { DictParams, DictResult, Dict } from '../entity/dictModel';
import { defHttp } from '/@/utils/http/axios';
import {isDef} from "/@/utils/is";

2
kicc-ui/src/api/controller/system/dictdata.ts → kicc-ui/src/api/platform/system/controller/dictdata.ts

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
import {DictDataParams, DictDataResult, DictData} from './model/dictDataModel';
import {DictDataParams, DictDataResult, DictData} from '../entity/dictDataModel';
import {defHttp} from '/@/utils/http/axios';
import {isDef} from "/@/utils/is";

2
kicc-ui/src/api/controller/system/log.ts → kicc-ui/src/api/platform/system/controller/log.ts

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
import { LogParams, LogListGetResultModel } from './model/logModel';
import { LogParams, LogListGetResultModel } from '../entity/logModel';
import { defHttp } from '/@/utils/http/axios';
enum Api {

8
kicc-ui/src/api/controller/system/menu.ts → kicc-ui/src/api/platform/system/controller/menu.ts

@ -3,8 +3,8 @@ @@ -3,8 +3,8 @@
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved.
* author entfrm开发团队-
*/
import { MenuDto, Menu } from './model/menuModel';
import { ResultVo } from '../../model';
import { MenuParams, Menu } from '/@/api/platform/system/entity/menu';
import { ResultVo } from '/@/api/common/base/entity';
import { defHttp } from '/@/utils/http/axios';
enum Api {
@ -17,7 +17,7 @@ enum Api { @@ -17,7 +17,7 @@ enum Api {
}
/** 查询菜单列表 */
export const listMenu = (params?: Partial<MenuDto>) => defHttp.get({ url: Api.list, params });
export const listMenu = (params?: Partial<MenuParams>) => defHttp.get({ url: Api.list, params });
/** 新增菜单 */
export const addMenu = (params: Partial<Menu>) => defHttp.post({ url: Api.add, data: params });
@ -32,4 +32,4 @@ export const getMenu = (id: string) => defHttp.get<Menu>({ url: `${Api.get}/${id @@ -32,4 +32,4 @@ export const getMenu = (id: string) => defHttp.get<Menu>({ url: `${Api.get}/${id
export const delMenu = (id: string) => defHttp.delete({ url: `${Api.del}/${id}` });
/** 通过角色编号查询菜单编号 */
export const getRoleMenuIds = (roleId : string) => defHttp.get<ResultVo<any>>({ url: `${Api.roleMenuIds}/${roleId}`});
export const getRoleMenuIds = (roleId : string) => defHttp.get<ResultVo>({ url: `${Api.roleMenuIds}/${roleId}`});

4
kicc-ui/src/api/controller/system/role.ts → kicc-ui/src/api/platform/system/controller/role.ts

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved.
* author entfrm开发团队-
*/
import { Role, RoleDto, RoleVo } from './model/roleModel';
import { Role, RoleParams, RoleResult } from '/@/api/platform/system/entity/role';
import { defHttp } from '/@/utils/http/axios';
enum Api {
@ -16,7 +16,7 @@ enum Api { @@ -16,7 +16,7 @@ enum Api {
}
/** 查询角色列表 */
export const listRole = (params?: Partial<RoleDto>) => defHttp.get<RoleVo>({ url: Api.list, params }, { isReturnResultResponse: true });
export const listRole = (params?: Partial<RoleParams>) => defHttp.get<RoleResult>({ url: Api.list, params }, { isReturnResultResponse: true });
/** 新增角色 */
export const addRole = (params: Partial<Role>) => defHttp.post({ url: Api.add, data: params });

9
kicc-ui/src/api/controller/system/user.ts → kicc-ui/src/api/platform/system/controller/user.ts

@ -3,9 +3,10 @@ @@ -3,9 +3,10 @@
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved.
* author entfrm开发团队-
*/
import { User, UserDto, UserVo } from './model/userModel';
import { UserParams, UserResult } from '/@/api/platform/system/entity/user';
import { User } from "/@/api/platform/core/entity/user";
import { defHttp } from '/@/utils/http/axios';
import { ResultVo } from "/@/api/model";
import { ResultVo } from '/@/api/common/base/entity';
enum Api {
list = '/system_proxy/system/user/list',
@ -19,7 +20,7 @@ enum Api { @@ -19,7 +20,7 @@ enum Api {
}
/** 查询用户列表 */
export const listUser = (params?: Partial<UserDto>) => defHttp.get<UserVo>({ url: Api.list, params }, { isReturnResultResponse: true });
export const listUser = (params?: Partial<UserParams>) => defHttp.get<UserResult>({ url: Api.list, params }, { isReturnResultResponse: true });
/** 新增用户 */
export const addUser = (params: Partial<User>) => defHttp.post({ url: Api.add, data: params });
@ -28,7 +29,7 @@ export const addUser = (params: Partial<User>) => defHttp.post({ url: Api.add, d @@ -28,7 +29,7 @@ export const addUser = (params: Partial<User>) => defHttp.post({ url: Api.add, d
export const editUser = (params: Partial<User>) => defHttp.put({ url: Api.edit, data: params });
/** 查询用户详细 */
export const getUser = (id: string) => defHttp.get<ResultVo<any>>({ url: `${Api.get}/${id}` });
export const getUser = (id: string) => defHttp.get<ResultVo>({ url: `${Api.get}/${id}` });
/** 删除用户 */
export const delUser = (id: string) => defHttp.delete({ url: `${Api.del}/${id}` });

8
kicc-ui/src/api/controller/system/model/clientModel.ts → kicc-ui/src/api/platform/system/entity/clientModel.ts

@ -1,4 +1,10 @@ @@ -1,4 +1,10 @@
// 引入基础包
/**
* @program: kicc-ui
* @description:
*
* @author: entfrm开发团队-
* @create: 2022/4/8
*/
import { Page, R } from '/@/api/model';
// 定义查询参数

8
kicc-ui/src/api/controller/system/model/configModel.ts → kicc-ui/src/api/platform/system/entity/configModel.ts

@ -1,4 +1,10 @@ @@ -1,4 +1,10 @@
// 引入基础包
/**
* @program: kicc-ui
* @description:
*
* @author: entfrm开发团队-
* @create: 2022/4/8
*/
import { Page, R, CommonEntity } from '/@/api/model';
export type ConfigParams = {

30
kicc-ui/src/api/platform/system/entity/dept.ts

@ -0,0 +1,30 @@ @@ -0,0 +1,30 @@
/**
* @program: kicc-ui
* @description:
*
* @author: entfrm开发团队-
* @create: 2022/4/8
*/
import { R } from '/#/axios';
import { CommonEntity, Page } from '/@/api/common/data/entity';
/** 部门查询参数 */
export type DeptParams = Page & Dept;
/** 部门对象 */
export interface Dept extends CommonEntity {
deptId: string;
code: string;
name: string;
parentId: string;
sort: number;
contacts: string;
phone: string;
address: string;
email: string;
status: string;
[key: string]: any;
}
/** 部门响应对象 */
export type DeptResult = R<Dept[]>;

8
kicc-ui/src/api/controller/system/model/dictDataModel.ts → kicc-ui/src/api/platform/system/entity/dictDataModel.ts

@ -1,4 +1,10 @@ @@ -1,4 +1,10 @@
// 引入基础包
/**
* @program: kicc-ui
* @description:
*
* @author: entfrm开发团队-
* @create: 2022/4/8
*/
import {CommonEntity, Page, R} from '/@/api/model';
// 定义查询参数

8
kicc-ui/src/api/controller/system/model/dictModel.ts → kicc-ui/src/api/platform/system/entity/dictModel.ts

@ -1,4 +1,10 @@ @@ -1,4 +1,10 @@
// 引入基础包
/**
* @program: kicc-ui
* @description:
*
* @author: entfrm开发团队-
* @create: 2022/4/8
*/
import {CommonEntity, Page, R} from '/@/api/model';
// 定义查询参数

8
kicc-ui/src/api/controller/system/model/logModel.ts → kicc-ui/src/api/platform/system/entity/logModel.ts

@ -1,4 +1,10 @@ @@ -1,4 +1,10 @@
// 引入基础包
/**
* @program: kicc-ui
* @description:
*
* @author: entfrm开发团队-
* @create: 2022/4/8
*/
import { Page, R } from '/@/api/model';
// 定义查询参数

31
kicc-ui/src/api/platform/system/entity/menu.ts

@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
/**
* @program: kicc-ui
* @description:
*
* @author: entfrm开发团队-
* @create: 2022/4/8
*/
import { R } from '/#/axios';
import { CommonEntity, Page } from '/@/api/common/data/entity';
/** 菜单查询参数 */
export type MenuParams = Page & Menu;
/** 菜单对象 */
export interface Menu extends CommonEntity {
id: string;
name: string;
parentId: string;
type: string;
path: string;
component: string;
permission: string;
icon: string;
keepAlive: string;
hideMenu: string;
sort: string;
[key: string]: any;
}
/** 菜单响应对象 */
export type MenuResult = R<Menu[]>;

25
kicc-ui/src/api/platform/system/entity/role.ts

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
/**
* @program: kicc-ui
* @description:
*
* @author: entfrm开发团队-
* @create: 2022/4/8
*/
import { R } from '/#/axios';
import { CommonEntity, Page } from '/@/api/common/data/entity';
/** 角色查询参数 */
export type RoleParams = Page & Role;
/** 角色对象 */
export interface Role extends CommonEntity {
id: string;
name: string;
code: string;
sort: string;
status: string;
[key: string]: any;
}
/** 角色响应对象 */
export type RoleResult = R<Role[]>;

16
kicc-ui/src/api/platform/system/entity/user.ts

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
/**
* @program: kicc-ui
* @description:
*
* @author: entfrm开发团队-
* @create: 2022/4/8
*/
import { R } from '/#/axios';
import { Page } from '/@/api/common/data/entity';
import { User } from "/@/api/platform/core/entity/user";
/** 用户查询参数 */
export type UserParams = Page & User;
/** 用户响应对象 */
export type UserResult = R<User[]>;

4
kicc-ui/src/components/Upload/src/typing.ts

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
import { UploadApiResult } from '/@/api/controller/sys/model/uploadModel';
import { UploadResult } from '/@/api/platform/core/entity/upload';
export enum UploadResultStatus {
SUCCESS = 'success',
@ -14,7 +14,7 @@ export interface FileItem { @@ -14,7 +14,7 @@ export interface FileItem {
percent: number;
file: File;
status?: UploadResultStatus;
responseData?: UploadApiResult;
responseData?: UploadResult;
uuid: string;
}

4
kicc-ui/src/store/modules/permission.ts

@ -14,7 +14,7 @@ import { useUserStore } from './user'; @@ -14,7 +14,7 @@ import { useUserStore } from './user';
import { transformObjToRoute } from '/@/router/helper/routeHelper';
import { transformRouteToMenu } from '/@/router/helper/menuHelper';
import { filter } from '/@/utils/helper/treeHelper';
import { getMenuList } from '/@/api/controller/sys/menu';
import { listMenuRoute } from '/@/api/platform/core/controller/menu';
import { useMessage } from '/@/hooks/web/useMessage';
import { PageEnum } from '/@/enums/pageEnum';
@ -111,7 +111,7 @@ export const usePermissionStore = defineStore({ @@ -111,7 +111,7 @@ export const usePermissionStore = defineStore({
/** 构建菜单与路由 */
let routeList: AppRouteRecordRaw[] = [];
try {
routeList = (await getMenuList()) as AppRouteRecordRaw[];
routeList = await listMenuRoute();
transformObjToRoute(routeList);
const menuList = transformRouteToMenu(routeList);
this.setMenuList(menuList);

38
kicc-ui/src/store/modules/user.ts

@ -5,23 +5,22 @@ @@ -5,23 +5,22 @@
* @create: 2022/4/9
*/
import type {UserInfo} from '/#/store';
import {defineStore} from 'pinia';
import {store} from '/@/store';
import {PageEnum} from '/@/enums/pageEnum';
import {ACCESS_TOKEN_KEY, PERMISSIONS_KEY, REFRESH_TOKEN_KEY, ROLE_IDS_KEY, USER_INFO_KEY} from '/@/enums/cacheEnum';
import {getAuthCache, setAuthCache} from '/@/utils/auth';
import {GetUserInfoModel, LoginParams} from '/@/api/controller/sys/model/userModel';
import {logout, getUserInfo, login} from '/@/api/controller/sys/user';
import {useI18n} from '/@/hooks/web/useI18n';
import {useMessage} from '/@/hooks/web/useMessage';
import {router} from '/@/router';
import {usePermissionStore} from '/@/store/modules/permission';
import {RouteRecordRaw} from 'vue-router';
import { defineStore } from 'pinia';
import { store } from '/@/store';
import { PageEnum } from '/@/enums/pageEnum';
import { ACCESS_TOKEN_KEY, PERMISSIONS_KEY, REFRESH_TOKEN_KEY, ROLE_IDS_KEY, USER_INFO_KEY } from '/@/enums/cacheEnum';
import { getAuthCache, setAuthCache } from '/@/utils/auth';
import { User, LoginParams } from '/@/api/platform/core/entity/user';
import { logout, getUserInfo, login } from '/@/api/platform/core/controller/user';
import { useI18n } from '/@/hooks/web/useI18n';
import { useMessage } from '/@/hooks/web/useMessage';
import { router } from '/@/router';
import { usePermissionStore } from '/@/store/modules/permission';
import { RouteRecordRaw } from 'vue-router';
import defaultAvatar from '/@/assets/images/defaultAvatar.jpg';
interface UserState {
userInfo: Nullable<UserInfo>;
userInfo: Nullable<User>;
sessionTimeout: boolean;
roleIds: string[];
permissions: string[];
@ -33,7 +32,7 @@ export const useUserStore = defineStore({ @@ -33,7 +32,7 @@ export const useUserStore = defineStore({
id: 'app-user',
state: (): UserState => ({
// 用户信息
userInfo: getAuthCache<UserInfo>(USER_INFO_KEY),
userInfo: getAuthCache<User>(USER_INFO_KEY),
// 登录是否过期
sessionTimeout: false,
// 角色ID用于权限校验
@ -46,7 +45,7 @@ export const useUserStore = defineStore({ @@ -46,7 +45,7 @@ export const useUserStore = defineStore({
refresh_token: getAuthCache<string>(REFRESH_TOKEN_KEY),
}),
getters: {
getUserInfo(): UserInfo {
getUserInfo(): User {
return this.userInfo! || {};
},
getAccessToken(): string {
@ -82,7 +81,7 @@ export const useUserStore = defineStore({ @@ -82,7 +81,7 @@ export const useUserStore = defineStore({
this.refresh_token = refreshToken;
setAuthCache(REFRESH_TOKEN_KEY, refreshToken);
},
setUserInfo(userInfo: UserInfo) {
setUserInfo(userInfo: User) {
this.userInfo = userInfo;
setAuthCache(USER_INFO_KEY, userInfo);
},
@ -98,7 +97,7 @@ export const useUserStore = defineStore({ @@ -98,7 +97,7 @@ export const useUserStore = defineStore({
this.permissions = [];
},
/** 登录 */
async login(params: LoginParams & { goHome?: boolean; unLock?: boolean; }): Promise<GetUserInfoModel | null> {
async login(params: LoginParams): Promise<User | null> {
try {
const { goHome = true, unLock = false, ...loginParams } = params;
const data = await login(loginParams, unLock && {
@ -132,7 +131,8 @@ export const useUserStore = defineStore({ @@ -132,7 +131,8 @@ export const useUserStore = defineStore({
return Promise.reject(error);
}
},
async getUserInfoAction(): Promise<UserInfo> {
/** 获取用户信息 */
async getUserInfoAction(): Promise<User> {
const userInfo = await getUserInfo();
userInfo.avatar || (userInfo.avatar = defaultAvatar);
// 存储用户扩展信息,便于鉴权

5
kicc-ui/src/utils/cache/persistent.ts vendored

@ -7,7 +7,8 @@ @@ -7,7 +7,8 @@
* @create: 2022/4/9
*/
import type { LockInfo, UserInfo } from '/#/store';
import type { LockInfo } from '/#/store';
import type { User } from '/@/api/platform/core/entity/user';
import type { ProjectConfig } from '/#/config';
import type { RouteLocationNormalized } from 'vue-router';
import { createLocalStorage, createSessionStorage } from '/@/utils/cache';
@ -30,7 +31,7 @@ interface BasicStore { @@ -30,7 +31,7 @@ interface BasicStore {
[REFRESH_TOKEN_KEY]: string | number | null | undefined;
[ROLE_IDS_KEY]: string[];
[PERMISSIONS_KEY]: string[];
[USER_INFO_KEY]: UserInfo;
[USER_INFO_KEY]: User;
[LOCK_INFO_KEY]: LockInfo;
[PROJ_CFG_KEY]: ProjectConfig;
[MULTIPLE_TABS_KEY]: RouteLocationNormalized[];

2
kicc-ui/src/utils/cipher.ts

@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
* @create: 2022/4/8
*/
import { encrypt, decrypt } from 'crypto-js/aes';
import { LoginParams } from '/@/api/controller/sys/model/userModel';
import { LoginParams } from '/@/api/platform/core/entity/user';
import * as CryptoJS from "crypto-js";
import { encryptionLoginModel } from "/#/utils";

26
kicc-ui/src/utils/http/axios/Axios.ts

@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
*/
import type { AxiosRequestConfig, AxiosInstance, AxiosResponse } from 'axios';
import type { RequestOptions, Data, UploadFileParams } from '../../../../types/axios';
import type { RequestOptions, R, UploadFileParams } from '../../../../types/axios';
import type { CreateAxiosOptions } from './axiosTransform';
import axios from 'axios';
import qs from 'qs';
@ -28,9 +28,7 @@ export class VAxios { @@ -28,9 +28,7 @@ export class VAxios {
this.setupInterceptors();
}
/**
* axios
*/
/** 创建 axios 实例 */
private createAxios(config: CreateAxiosOptions): void {
this.axiosInstance = axios.create(config);
}
@ -44,9 +42,7 @@ export class VAxios { @@ -44,9 +42,7 @@ export class VAxios {
return this.axiosInstance;
}
/**
*
*/
/** 值得重新配置 */
configAxios(config: CreateAxiosOptions) {
if (!this.axiosInstance) {
return;
@ -54,9 +50,7 @@ export class VAxios { @@ -54,9 +50,7 @@ export class VAxios {
this.createAxios(config);
}
/**
* headers请求头
*/
/** 设置headers请求头 */
setHeader(headers: any): void {
if (!this.axiosInstance) {
return;
@ -64,9 +58,7 @@ export class VAxios { @@ -64,9 +58,7 @@ export class VAxios {
Object.assign(this.axiosInstance.defaults.headers, headers);
}
/**
*
*/
/** 拦截器配置 */
private setupInterceptors() {
const transform = this.getTransform();
if (!transform) {
@ -120,9 +112,7 @@ export class VAxios { @@ -120,9 +112,7 @@ export class VAxios {
this.axiosInstance.interceptors.response.use(undefined, responseInterceptorsCatch);
}
/**
*
*/
/** 上传文件 */
uploadFile<T = any>(config: AxiosRequestConfig, params: UploadFileParams) {
const formData = new window.FormData();
@ -210,8 +200,8 @@ export class VAxios { @@ -210,8 +200,8 @@ export class VAxios {
return new Promise((resolve, reject) => {
this.axiosInstance
.request<any, AxiosResponse<Data>>(conf)
.then((res: AxiosResponse<Data>) => {
.request<any, AxiosResponse<R>>(conf)
.then((res: AxiosResponse<R>) => {
if (transformRequestHook && isFunction(transformRequestHook)) {
try {
const ret = transformRequestHook(res, opt);

20
kicc-ui/src/utils/http/axios/axiosCancel.ts

@ -10,17 +10,14 @@ import type { AxiosRequestConfig, Canceler } from 'axios'; @@ -10,17 +10,14 @@ import type { AxiosRequestConfig, Canceler } from 'axios';
import axios from 'axios';
import { isFunction } from '/@/utils/is';
// 用于存储每个请求的识别和取消功能
/** 用于存储每个请求的识别和取消功能 */
let pendingMap = new Map<string, Canceler>();
export const getPendingUrl = (config: AxiosRequestConfig) => [config.method, config.url].join('&');
export class AxiosCanceler {
/**
*
* @param {Object} config
*/
/** 添加请求 */
addPending(config: AxiosRequestConfig) {
this.removePending(config);
const url = getPendingUrl(config);
@ -34,9 +31,7 @@ export class AxiosCanceler { @@ -34,9 +31,7 @@ export class AxiosCanceler {
});
}
/**
*
*/
/** 清除所有待处理 */
removeAllPending() {
pendingMap.forEach((cancel) => {
cancel && isFunction(cancel) && cancel();
@ -44,10 +39,7 @@ export class AxiosCanceler { @@ -44,10 +39,7 @@ export class AxiosCanceler {
pendingMap.clear();
}
/**
*
* @param {Object} config
*/
/** 删除请求 */
removePending(config: AxiosRequestConfig) {
const url = getPendingUrl(config);
@ -60,9 +52,7 @@ export class AxiosCanceler { @@ -60,9 +52,7 @@ export class AxiosCanceler {
}
}
/**
*
*/
/** 重置 */
reset(): void {
pendingMap = new Map<string, Canceler>();
}

33
kicc-ui/src/utils/http/axios/axiosTransform.ts

@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
*/
import type { AxiosRequestConfig, AxiosResponse } from 'axios';
import type { RequestOptions, Data } from '/#/axios';
import type { RequestOptions, R } from '/#/axios';
export interface CreateAxiosOptions extends AxiosRequestConfig {
authenticationScheme?: string;
@ -16,38 +16,25 @@ export interface CreateAxiosOptions extends AxiosRequestConfig { @@ -16,38 +16,25 @@ export interface CreateAxiosOptions extends AxiosRequestConfig {
}
export abstract class AxiosTransform {
/**
*
*/
/** 请求前的流程配置 */
beforeRequestHook?: (config: CreateAxiosOptions, options: RequestOptions) => CreateAxiosOptions;
/**
*
*/
transformRequestHook?: (res: AxiosResponse<Data>, options: RequestOptions) => any;
/** 请求成功处理 */
transformRequestHook?: (res: AxiosResponse<R>, options: RequestOptions) => any;
/**
*
*/
/** 请求失败处理 */
requestCatchHook?: (e: Error, options: RequestOptions) => Promise<any>;
/**
*
*/
/** 请求之前的拦截器 */
requestInterceptors?: (config: CreateAxiosOptions, options: CreateAxiosOptions) => CreateAxiosOptions;
/**
*
*/
/** 请求之后的拦截器 */
responseInterceptors?: (res: AxiosResponse) => AxiosResponse;
/**
*
*/
/** 请求之前的拦截器错误处理 */
requestInterceptorsCatch?: (error: Error) => void;
/**
*
*/
/** 请求之后的拦截器错误处理 */
responseInterceptorsCatch?: (error: Error) => void;
}

4
kicc-ui/src/utils/http/axios/helper.ts

@ -25,9 +25,7 @@ export function joinTimestamp(join: boolean, restful = false): string | object { @@ -25,9 +25,7 @@ export function joinTimestamp(join: boolean, restful = false): string | object {
return { _t: now };
}
/**
*
*/
/** 格式请求参数时间 */
export function formatRequestDate(params: Recordable) {
if (Object.prototype.toString.call(params) !== '[object Object]') {
return;

28
kicc-ui/src/utils/http/axios/index.ts

@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
*/
import type { AxiosResponse } from 'axios';
import type { RequestOptions, Data } from '/#/axios';
import type { RequestOptions, R } from '/#/axios';
import type { AxiosTransform, CreateAxiosOptions } from './axiosTransform';
import { VAxios } from './Axios';
import { checkStatus } from './checkStatus';
@ -24,14 +24,10 @@ const globSetting = useGlobSetting(); @@ -24,14 +24,10 @@ const globSetting = useGlobSetting();
const urlPrefix = globSetting.urlPrefix;
const { createMessage, createErrorModal } = useMessage();
/**
* 便
*/
/** 数据处理,方便区分多种处理方式 */
const transform: AxiosTransform = {
/**
*
*/
transformRequestHook: (res: AxiosResponse<Data>, options: RequestOptions) => {
/** 处理请求数据。如果数据不是预期格式,可直接抛出错误 */
transformRequestHook: (res: AxiosResponse<R>, options: RequestOptions) => {
const { isReturnNativeResponse, isReturnResultResponse } = options;
// 是否返回原生响应头 比如:需要获取响应头时使用该属性
@ -58,9 +54,7 @@ const transform: AxiosTransform = { @@ -58,9 +54,7 @@ const transform: AxiosTransform = {
},
/**
* config
*/
/** 请求之前处理config */
beforeRequestHook: (config, options) => {
const { apiUrl, joinPrefix, joinParamsToUrl, formatDate, joinTime = true } = options;
@ -109,9 +103,7 @@ const transform: AxiosTransform = { @@ -109,9 +103,7 @@ const transform: AxiosTransform = {
return config;
},
/**
*
*/
/** 请求拦截器处理 */
requestInterceptors: (config, options) => {
// 请求之前处理config
const token = getAccessToken();
@ -130,16 +122,12 @@ const transform: AxiosTransform = { @@ -130,16 +122,12 @@ const transform: AxiosTransform = {
return config;
},
/**
*
*/
/** 响应拦截器处理 */
responseInterceptors: (res: AxiosResponse<any>) => {
return res;
},
/**
*
*/
/** 响应错误处理 */
responseInterceptorsCatch: (error: any) => {
const { response, code, message, config } = error || {};
const errorMessageMode = config?.requestOptions?.errorMessageMode || 'none';

8
kicc-ui/src/views/sys/lock/LockPage.vue

@ -28,9 +28,9 @@ @@ -28,9 +28,9 @@
<div :class="`${prefixCls}-entry`" v-show="!showDate">
<div :class="`${prefixCls}-entry-content`">
<div :class="`${prefixCls}-entry__header enter-x`">
<img :src="userinfo.avatar" :class="`${prefixCls}-entry__header-img`"/>
<img :src="userInfo.avatar" :class="`${prefixCls}-entry__header-img`"/>
<p :class="`${prefixCls}-entry__header-name`">
{{ userinfo.nickName }}
{{ userInfo.nickName }}
</p>
</div>
<InputPassword v-model:value="password"
@ -82,7 +82,7 @@ @@ -82,7 +82,7 @@
import { useNow } from './useNow';
import { useDesign } from '/@/hooks/web/useDesign';
import { LockOutlined } from '@ant-design/icons-vue';
import { UserInfo } from "/#/store";
import { User } from "/@/api/platform/core/entity/user";
const InputPassword = Input.Password;
const password = ref('');
@ -94,7 +94,7 @@ @@ -94,7 +94,7 @@
const userStore = useUserStore();
const { hour, month, minute, meridiem, year, day, week } = useNow(true);
const { t } = useI18n();
const userinfo = computed<UserInfo>(() => {
const userInfo = computed<User>(() => {
return userStore.getUserInfo || {};
});

2
kicc-ui/src/views/sys/login/LoginForm.vue

@ -99,7 +99,7 @@ @@ -99,7 +99,7 @@
import { useUserStore } from '/@/store/modules/user';
import { LoginStateEnum, useLoginState, useFormRules, useFormValid } from './useLogin';
import { useDesign } from '/@/hooks/web/useDesign';
import { getCaptcha } from '/@/api/controller/sys/user';
import { getCaptcha } from '/@/api/platform/core/controller/user';
import captchaDefImg from '/@/assets/images/captcha.jpg';
const ACol = Col;

2
kicc-ui/src/views/system/client/ClientDrawer.vue

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
import { TreeItem } from '/@/components/Tree';
//import { getMenuList } from '/@/api/system/role';
import { set } from '/@/api/controller/system/client';
import { set } from '/@/api/platform/system/controller/client';
const emit = defineEmits(['success', 'register']);
const isUpdate = ref(true);

2
kicc-ui/src/views/system/client/index.vue

@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
//
import { columns, searchFormSchema } from './client.data';
// API
import { page, del } from '/@/api/controller/system/client';
import { page, del } from '/@/api/platform/system/controller/client';
import { useDrawer } from '/@/components/Drawer';
import ClientDrawer from './ClientDrawer.vue';
import { useMessage } from '/@/hooks/web/useMessage';

2
kicc-ui/src/views/system/config/ConfigModal.vue

@ -12,7 +12,7 @@ import { defineComponent, ref, unref } from 'vue'; @@ -12,7 +12,7 @@ import { defineComponent, ref, unref } from 'vue';
import {BasicModal, ModalProps, useModalInner} from '/@/components/Modal';
import { BasicForm, useForm } from '/@/components/Form/index';
import { formSchema } from './config.data';
import { set } from '/@/api/controller/system/config';
import { set } from '/@/api/platform/system/controller/config';
export default defineComponent({
name: 'ConfigModal',

2
kicc-ui/src/views/system/config/index.vue

@ -47,7 +47,7 @@ @@ -47,7 +47,7 @@
* author entfrm开发团队-王翔
*/
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { list, remove } from '/@/api/controller/system/config';
import { list, remove } from '/@/api/platform/system/controller/config';
import ConfigModal from './ConfigModal.vue';
import { columns, searchFormSchema } from './config.data';
import { useMessage } from '/@/hooks/web/useMessage';

2
kicc-ui/src/views/system/dept/DeptModal.vue

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
import { BasicForm, useForm } from '/@/components/Form/index';
import { formSchema } from './dept.data';
import { BasicModal, ModalProps, useModalInner } from '/@/components/Modal';
import { listDept, addDept, editDept, getDept } from '/@/api/controller/system/dept';
import { listDept, addDept, editDept, getDept } from '/@/api/platform/system/controller/dept';
import { listToTree } from "/@/utils/helper/treeHelper";
/** 通用变量统一声明区域 */

2
kicc-ui/src/views/system/dept/index.vue

@ -54,7 +54,7 @@ @@ -54,7 +54,7 @@
import { useModal } from '/@/components/Modal';
import DeptModal from './DeptModal.vue';
import { columns, searchFormSchema } from './dept.data';
import { delDept, listDept } from '/@/api/controller/system/dept';
import { delDept, listDept } from '/@/api/platform/system/controller/dept';
import { useMessage } from '/@/hooks/web/useMessage';
import { listToTree } from "/@/utils/helper/treeHelper";

2
kicc-ui/src/views/system/dict/DictDataModal.vue

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
import {ref, computed, unref} from 'vue';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from './dictdata.data';
import {set} from '/@/api/controller/system/dictdata';
import {set} from '/@/api/platform/system/controller/dictdata';
import {BasicModal, useModalInner} from "/@/components/Modal";
const emit = defineEmits(['success', 'register']);

2
kicc-ui/src/views/system/dict/DictDataTable.vue

@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
//
import { columns, searchFormSchema } from './dictdata.data';
// API
import { list, remove } from '/@/api/controller/system/dictdata';
import { list, remove } from '/@/api/platform/system/controller/dictdata';
import { useModal } from '/@/components/Modal';
import DictDataModal from './DictDataModal.vue';
import { useMessage } from '/@/hooks/web/useMessage';

2
kicc-ui/src/views/system/dict/DictModal.vue

@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
import { BasicForm, useForm } from '/@/components/Form/index';
import { formSchema } from './dict.data';
import { TreeItem } from '/@/components/Tree';
import { set } from '/@/api/controller/system/dict';
import { set } from '/@/api/platform/system/controller/dict';
import {BasicModal, useModalInner} from "/@/components/Modal";
const emit = defineEmits(['success', 'register']);

2
kicc-ui/src/views/system/dict/index.vue

@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
//
import { columns, searchFormSchema} from './dict.data';
// API
import { list, remove } from '/@/api/controller/system/dict';
import { list, remove } from '/@/api/platform/system/controller/dict';
import { useModal } from '/@/components/Modal';
import DictModal from './DictModal.vue';
import DictDataTable from './DictDataTable.vue';

2
kicc-ui/src/views/system/log/index.vue

@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
//
import { columns, searchFormSchema } from './log.data';
// API
import { getLogListByPage, logEmpty } from '/@/api/controller/system/log';
import { getLogListByPage, logEmpty } from '/@/api/platform/system/controller/log';
import { useDrawer } from '/@/components/Drawer';
import LogDrawer from './LogDrawer.vue';

2
kicc-ui/src/views/system/menu/MenuModal.vue

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
import { BasicForm, useForm } from '/@/components/Form/index';
import { formSchema } from './menu.data';
import { BasicModal, ModalProps, useModalInner } from '/@/components/Modal';
import { listMenu, addMenu, editMenu, getMenu } from '/@/api/controller/system/menu';
import { listMenu, addMenu, editMenu, getMenu } from '/@/api/platform/system/controller/menu';
import { listToTree } from '/@/utils/helper/treeHelper';
/** 通用变量统一声明区域 */

2
kicc-ui/src/views/system/menu/index.vue

@ -51,7 +51,7 @@ @@ -51,7 +51,7 @@
* author entfrm开发团队-王翔
*/
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { listMenu, delMenu } from '/@/api/controller/system/menu';
import { listMenu, delMenu } from '/@/api/platform/system/controller/menu';
import { useModal } from '/@/components/Modal';
import { listToTree } from '/@/utils/helper/treeHelper';
import { columns, searchFormSchema } from './menu.data';

4
kicc-ui/src/views/system/role/RoleDrawer.vue

@ -31,8 +31,8 @@ @@ -31,8 +31,8 @@
import { formSchema } from './role.data';
import { BasicDrawer, DrawerProps, useDrawerInner } from '/@/components/Drawer';
import { BasicTree, TreeItem } from '/@/components/Tree';
import { listMenu, getRoleMenuIds } from '/@/api/controller/system/menu';
import { addRole, editRole, getRole } from '/@/api/controller/system/role';
import { listMenu, getRoleMenuIds } from '/@/api/platform/system/controller/menu';
import { addRole, editRole, getRole } from '/@/api/platform/system/controller/role';
import { listToTree } from "/@/utils/helper/treeHelper";
/** 类型规范统一声明定义区域 */

2
kicc-ui/src/views/system/role/index.vue

@ -49,7 +49,7 @@ @@ -49,7 +49,7 @@
* author entfrm开发团队-王翔
*/
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { listRole, delRole } from '/@/api/controller/system/role';
import { listRole, delRole } from '/@/api/platform/system/controller/role';
import { useDrawer } from '/@/components/Drawer';
import RoleDrawer from './RoleDrawer.vue';
import { columns, searchFormSchema } from './role.data';

2
kicc-ui/src/views/system/role/role.data.ts

@ -9,7 +9,7 @@ import { BasicColumn } from '/@/components/Table'; @@ -9,7 +9,7 @@ import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { h } from 'vue';
import { Switch, Tag } from 'ant-design-vue';
import { changeStatus } from '/@/api/controller/system/role';
import { changeStatus } from '/@/api/platform/system/controller/role';
import { useMessage } from '/@/hooks/web/useMessage';
/** 通用变量统一声明区域 */

2
kicc-ui/src/views/system/user/DeptTree.vue

@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
*/
import { defineComponent, onMounted, ref } from 'vue';
import { BasicTree, TreeItem } from '/@/components/Tree';
import { listDept } from '/@/api/controller/system/dept';
import { listDept } from '/@/api/platform/system/controller/dept';
import { listToTree } from "/@/utils/helper/treeHelper";
export default defineComponent({

2
kicc-ui/src/views/system/user/ResetPwdModal.vue

@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
import { BasicModal, ModalProps, useModalInner } from '/@/components/Modal';
import { StrengthMeter } from '/@/components/StrengthMeter';
import { Form } from 'ant-design-vue';
import { resetPwd } from '/@/api/controller/system/user';
import { resetPwd } from '/@/api/platform/system/controller/user';
import { useMessage } from '/@/hooks/web/useMessage';
/** 类型规范统一声明定义区域 */

4
kicc-ui/src/views/system/user/UserModal.vue

@ -18,8 +18,8 @@ @@ -18,8 +18,8 @@
import { BasicModal, useModalInner } from '/@/components/Modal';
import { BasicForm, useForm } from '/@/components/Form/index';
import { userFormSchema } from './user.data';
import { listDept } from '/@/api/controller/system/dept';
import { addUser, editUser, getUser } from '/@/api/controller/system/user';
import { listDept } from '/@/api/platform/system/controller/dept';
import { addUser, editUser, getUser } from '/@/api/platform/system/controller/user';
import { listToTree } from "/@/utils/helper/treeHelper";
import { ModalProps } from "/@/components/Modal";
import { findListNameById } from '/@/utils';

2
kicc-ui/src/views/system/user/index.vue

@ -64,7 +64,7 @@ @@ -64,7 +64,7 @@
*/
import { defineComponent, reactive, toRaw } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { listUser, delUser } from '/@/api/controller/system/user';
import { listUser, delUser } from '/@/api/platform/system/controller/user';
import ResetPwdModal from './ResetPwdModal.vue';
import { PageWrapper } from '/@/components/Page';
import DeptTree from './DeptTree.vue';

4
kicc-ui/src/views/system/user/user.data.ts

@ -9,8 +9,8 @@ import { BasicColumn } from '/@/components/Table'; @@ -9,8 +9,8 @@ import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { h } from 'vue';
import { Switch } from 'ant-design-vue';
import { listRole } from '/@/api/controller/system/role';
import { changeStatus } from '/@/api/controller/system/user';
import { listRole } from '/@/api/platform/system/controller/role';
import { changeStatus } from '/@/api/platform/system/controller/user';
import { useMessage } from "/@/hooks/web/useMessage";
/** 通用变量统一声明区域 */

7
kicc-ui/types/axios.d.ts vendored

@ -16,7 +16,7 @@ export interface RequestOptions { @@ -16,7 +16,7 @@ export interface RequestOptions {
// 例如:当需要获取响应头时使用该属性
isReturnNativeResponse?: boolean;
// 是否返回后端原生结果集响应
isReturnResultResponse ?: boolean;
isReturnResultResponse?: boolean;
// 是否加入url
joinPrefix?: boolean;
// 接口地址,留空使用默认apiUrl
@ -34,10 +34,11 @@ export interface RequestOptions { @@ -34,10 +34,11 @@ export interface RequestOptions {
clientSecret?: string;
}
export interface Data<T = any> {
/** 响应信息主体 */
export interface R<T = any> {
code: number;
msg: string;
time: string;
total: number;
data: T;
}

31
kicc-ui/types/store.d.ts vendored

@ -15,36 +15,7 @@ export interface LockInfo { @@ -15,36 +15,7 @@ export interface LockInfo {
isLock?: boolean;
}
export interface UserInfo {
// 用户id
id: string;
// 用户名
userName: string;
// 真实名字
nickName: string;
// 头像
avatar: string;
// 所属部门ID
deptId: string;
// 所属部门名称
deptName: string;
// 邮箱
email: string;
// 菜单按钮权限
permissions: string[];
// 角色ID权限
roleIds: string[];
// 手机号
phone: string;
// 备注信息
remarks: string;
// 多租户ID
tenantId: string;
// 指定登录后首页跳转
homePath?: string;
[key: string]: any;
}
/** 当窗口收缩时,记住一些状态,在窗口恢复时恢复这些状态 */
export interface BeforeMiniState {
menuCollapsed?: boolean;
menuSplit?: boolean;

Loading…
Cancel
Save