zhengyiming
6 天以前 732ddea9dbac6192a081fe407d21e8075ea0d32e
feat: 更新框架
9个文件已修改
520 ■■■■ 已修改文件
src/constants/apiEnum.ts 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/hooks/useAccess.ts 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/services/api/auth.ts 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/services/api/dictionary.ts 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/services/api/enterprise.ts 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/services/api/index.ts 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/services/api/typings.d.ts 290 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/modules/permission.ts 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
types/api.d.ts 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/constants/apiEnum.ts
@@ -41,6 +41,14 @@
  Desc = 1,
}
/** 实名通道 */
export enum EnumRealAccess {
  /**上上签 */
  BestSign = 10,
  /**支付宝信任签 */
  AlipaySign = 20,
}
/** 资源控制器 */
export enum EnumResourceController {
  /**数据字典 */
@@ -87,6 +95,12 @@
  All = 999,
}
/** 短信通道 */
export enum EnumSmsAccess {
  /**阿里云短信 */
  AliyunSms = 10,
}
/** 用户信息状态 */
export enum EnumUserInfoStatus {
  /**正常 */
src/hooks/useAccess.ts
@@ -8,7 +8,7 @@
} from '@bole-core/components';
import type { Ref, ComputedRef } from 'vue';
import { myClient } from '@/constants/query';
import * as menuServices from '@/services/api/menu';
import * as authServices from '@/services/api/auth';
type UseAccessOptions = {
  operationBtnMap?: Record<string, OperationBtnType>;
@@ -33,7 +33,7 @@
  return useBoleAccess({
    queryKey: ['baseModuleServices/getCurrentSubModuleList', { moduleId }],
    service: async () => {
      const res = await menuServices.getMenu(
      const res = await authServices.getCurrentLogierMenu(
        { id: moduleId },
        {
          showLoading: false,
src/services/api/auth.ts
@@ -19,6 +19,21 @@
  });
}
/** 获取当前登录用户菜单详情 GET /api/user/auth/getCurrentLogierMenu */
export async function getCurrentLogierMenu(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIgetCurrentLogierMenuParams,
  options?: API.RequestConfig
) {
  return request<API.GetMenuQueryResult>('/api/user/auth/getCurrentLogierMenu', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
/** 获取当前登录用户菜单 GET /api/user/auth/getCurrentLogierMenus */
export async function getCurrentLogierMenus(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
src/services/api/dictionary.ts
@@ -2,7 +2,7 @@
// @ts-ignore
import { request } from '@/utils/request';
/** 删除字典类别 DELETE /api/main/dictionary/deleteDictionaryCategory */
/** 删除数据字典类别 DELETE /api/main/dictionary/deleteDictionaryCategory */
export async function deleteDictionaryCategory(
  body: API.DeleteDictionaryCategoryCommand,
  options?: API.RequestConfig
@@ -17,7 +17,7 @@
  });
}
/** 查询字典类别分页列表数据 POST /api/main/dictionary/getDictionaryCategories */
/** 获取数据字典类别分页列表数据 POST /api/main/dictionary/getDictionaryCategories */
export async function getDictionaryCategories(
  body: API.GetDictionaryCategoriesQuery,
  options?: API.RequestConfig
@@ -35,7 +35,27 @@
  );
}
/** 获取字典数据分页列表 POST /api/main/dictionary/getDictionaryDatas */
/** 查询数据字典类别选择器数据 GET /api/main/dictionary/getDictionaryCategorySelect */
export async function getDictionaryCategorySelect(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIgetDictionaryCategorySelectParams,
  options?: API.RequestConfig
) {
  return request<API.SelectQueryResultOptionGuidGetDictionaryCategorySelectQueryOption[]>(
    '/api/main/dictionary/getDictionaryCategorySelect',
    {
      method: 'GET',
      params: {
        ...params,
        request: undefined,
        ...params['request'],
      },
      ...(options || {}),
    }
  );
}
/** 获取数据字典分页列表数据 POST /api/main/dictionary/getDictionaryDatas */
export async function getDictionaryDatas(
  body: API.GetDictionaryDatasQuery,
  options?: API.RequestConfig
@@ -53,7 +73,25 @@
  );
}
/** 保存字典类别 POST /api/main/dictionary/saveDictionaryCategory */
/** 查询数据字典选择器 GET /api/main/dictionary/getDictionaryDataSelect */
export async function getDictionaryDataSelect(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIgetDictionaryDataSelectParams,
  options?: API.RequestConfig
) {
  return request<API.SelectQueryResultOptionGuidGetDictionaryDataSelectQueryResultOption[]>(
    '/api/main/dictionary/getDictionaryDataSelect',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}
/** 保存数据字典类别 POST /api/main/dictionary/saveDictionaryCategory */
export async function saveDictionaryCategory(
  body: API.SaveDictionaryCategoryCommand,
  options?: API.RequestConfig
@@ -68,7 +106,7 @@
  });
}
/** 保存字典数据 POST /api/main/dictionary/saveDictionaryData */
/** 保存数据字典 POST /api/main/dictionary/saveDictionaryData */
export async function saveDictionaryData(
  body: API.SaveDictionaryDataCommand,
  options?: API.RequestConfig
@@ -83,7 +121,7 @@
  });
}
/** 设置字典数据是否禁用 PUT /api/main/dictionary/setDictionaryDataIsDisabled */
/** 设置数据字典是否禁用 PUT /api/main/dictionary/setDictionaryDataIsDisabled */
export async function setDictionaryDataIsDisabled(
  body: API.SetDictionaryDataIsDisabledCommand,
  options?: API.RequestConfig
src/services/api/enterprise.ts
@@ -2,6 +2,39 @@
// @ts-ignore
import { request } from '@/utils/request';
/** 查询企业详情 GET /api/user/enterprise/getEnterprise */
export async function getEnterprise(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIgetEnterpriseParams,
  options?: API.RequestConfig
) {
  return request<API.GetEnterpriseQueryResult>('/api/user/enterprise/getEnterprise', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
/** 查询企业电子签配置 GET /api/user/enterprise/getEnterpriseElectronSignSetting */
export async function getEnterpriseElectronSignSetting(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIgetEnterpriseElectronSignSettingParams,
  options?: API.RequestConfig
) {
  return request<API.GetEnterpriseElectronSignSettingQueryResult>(
    '/api/user/enterprise/getEnterpriseElectronSignSetting',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}
/** 查询企业信息分页列表数据 POST /api/user/enterprise/getEnterprises */
export async function getEnterprises(body: API.GetEnterprisesQuery, options?: API.RequestConfig) {
  return request<API.PagedListQueryResultGetEnterprisesQueryResultItem>(
@@ -16,3 +49,63 @@
    }
  );
}
/** 查询企业短信配置 GET /api/user/enterprise/getEnterpriseSmsSetting */
export async function getEnterpriseSmsSetting(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIgetEnterpriseSmsSettingParams,
  options?: API.RequestConfig
) {
  return request<API.GetEnterpriseSmsSettingQueryResult>(
    '/api/user/enterprise/getEnterpriseSmsSetting',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}
/** 保存企业 POST /api/user/enterprise/saveEnterprise */
export async function saveEnterprise(body: API.SaveEnterpriseCommand, options?: API.RequestConfig) {
  return request<string>('/api/user/enterprise/saveEnterprise', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 设置企业电子签配置 PUT /api/user/enterprise/setEnterpriseElectronSignSetting */
export async function setEnterpriseElectronSignSetting(
  body: API.SetEnterpriseElectronSignSettingCommand,
  options?: API.RequestConfig
) {
  return request<string>('/api/user/enterprise/setEnterpriseElectronSignSetting', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 设置企业短信配置 PUT /api/user/enterprise/setEnterpriseSmsSetting */
export async function setEnterpriseSmsSetting(
  body: API.SetEnterpriseSmsSettingCommand,
  options?: API.RequestConfig
) {
  return request<string>('/api/user/enterprise/setEnterpriseSmsSetting', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}
src/services/api/index.ts
@@ -2,19 +2,19 @@
/* eslint-disable */
// API 更新时间:
// API 唯一标识:
import * as dictionary from './dictionary';
import * as auth from './auth';
import * as enterprise from './enterprise';
import * as menu from './menu';
import * as dictionary from './dictionary';
import * as resource from './resource';
import * as role from './role';
import * as userInfo from './userInfo';
import * as enterprise from './enterprise';
export default {
  dictionary,
  auth,
  enterprise,
  menu,
  dictionary,
  resource,
  role,
  userInfo,
  enterprise,
};
src/services/api/typings.d.ts
@@ -8,9 +8,43 @@
    request?: GetAliyunOSSAcsQuery;
  }
  interface APIgetCurrentLogierMenuParams {
    /** Id */
    id?: string;
  }
  interface APIgetCurrentLogierMenusParams {
    /** 获取当前登录用户菜单 */
    request?: GetCurrentLogierMenusQuery;
  }
  interface APIgetDictionaryCategorySelectParams {
    /** 查询数据字典类别选择器数据 */
    request?: GetDictionaryCategorySelectQuery;
  }
  interface APIgetDictionaryDataSelectParams {
    /** 类别Id(Id/编号二选一) */
    categoryId?: string;
    /** 类别编号(Id/编号二选一) */
    categoryCode?: string;
    /** 上级Id */
    parentId?: string;
  }
  interface APIgetEnterpriseElectronSignSettingParams {
    /** Id */
    id?: string;
  }
  interface APIgetEnterpriseParams {
    /** Id */
    id?: string;
  }
  interface APIgetEnterpriseSmsSettingParams {
    /** Id */
    id?: string;
  }
  interface APIgetMenuParams {
@@ -108,6 +142,13 @@
    Desc = 1,
  }
  enum EnumRealAccess {
    /**上上签 */
    BestSign = 10,
    /**支付宝信任签 */
    AlipaySign = 20,
  }
  enum EnumResourceController {
    /**数据字典 */
    Dictionary = 0,
@@ -151,6 +192,11 @@
    All = 999,
  }
  enum EnumSmsAccess {
    /**阿里云短信 */
    AliyunSms = 10,
  }
  enum EnumUserInfoStatus {
    /**正常 */
    Normal = 10,
@@ -175,6 +221,60 @@
    /** 错误码 */
    errorCode?: string;
    data?: GetAliyunOSSAcsQueryResult;
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultGetEnterpriseElectronSignSettingQueryResult {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    data?: GetEnterpriseElectronSignSettingQueryResult;
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultGetEnterpriseQueryResult {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    data?: GetEnterpriseQueryResult;
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultGetEnterpriseSmsSettingQueryResult {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    data?: GetEnterpriseSmsSettingQueryResult;
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
@@ -354,6 +454,44 @@
    timestamp?: number;
  }
  interface FriendlyResultListSelectQueryResultOptionGuidGetDictionaryCategorySelectQueryOption {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    /** 数据 */
    data?: SelectQueryResultOptionGuidGetDictionaryCategorySelectQueryOption[];
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultListSelectQueryResultOptionGuidGetDictionaryDataSelectQueryResultOption {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    /** 数据 */
    data?: SelectQueryResultOptionGuidGetDictionaryDataSelectQueryResultOption[];
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultPagedListQueryResultGetDictionaryCategoriesQueryResultItem {
    /** 跟踪Id */
    traceId?: string;
@@ -493,10 +631,14 @@
    sort?: number;
  }
  type GetDictionaryCategorySelectQuery = Record<string, any>;
  interface GetDictionaryDatasQuery {
    pageModel?: PagedListQueryPageModel;
    /** 类别Id */
    /** 类别Id(Id/编号二选一) */
    categoryId?: string;
    /** 类别编号(Id/编号二选一) */
    categoryCode?: string;
    /** 关键字 */
    keywords?: string;
  }
@@ -506,6 +648,10 @@
    id?: string;
    /** 类别Id */
    categoryId?: string;
    /** 类别编号 */
    categoryCode?: string;
    /** 类别名称 */
    categoryName?: string;
    /** 上级Id */
    parentId?: string;
    /** 编号 */
@@ -528,6 +674,55 @@
    isDisabled?: boolean;
  }
  interface GetEnterpriseElectronSignSettingQueryResult {
    /** Id */
    id?: string;
    realAccess?: EnumRealAccess;
    /** 实名费用 */
    realVerifyCost?: number;
    /** 签约费用 */
    signCost?: number;
    /** 一口价 */
    mergeSignCost?: number;
  }
  interface GetEnterpriseQueryResult {
    /** Id */
    id?: string;
    /** 企业全称 */
    enterpriseName?: string;
    /** 统一社会信用代码 */
    societyCreditCode?: string;
    /** 法人姓名 */
    legalPerson?: string;
    /** 法人身份证号 */
    legalIdentity?: string;
    /** 所在省份 */
    provinceContent?: string;
    /** 所在城市 */
    cityContent?: string;
    /** 所属行业 */
    industryTypeContent?: string;
    /** 主营业务 */
    mainBusiness?: string;
    /** 联系人 */
    contacts?: string;
    /** 联系电话 */
    contactPhoneNumber?: string;
    /** 联系邮箱 */
    contactEmail?: string;
    /** 账号 */
    userName?: string;
  }
  interface GetEnterpriseSmsSettingQueryResult {
    /** Id */
    id?: string;
    smsAccess?: EnumSmsAccess;
    /** 短信费用 */
    smsCost?: number;
  }
  interface GetEnterprisesQuery {
    pageModel?: PagedListQueryPageModel;
    /** 关键字 */
@@ -545,10 +740,20 @@
    legalPerson?: string;
    /** 统一社会信用代码 */
    societyCreditCode?: string;
    /** 是否实名 */
    isReal?: boolean;
    /** 联系人 */
    contacts?: string;
    /** 联系电话 */
    contactNumber?: string;
    contactPhoneNumber?: string;
    /** 所在省份 */
    provinceContent?: string;
    /** 所在城市 */
    cityContent?: string;
    /** 所属行业 */
    industryTypeContent?: string;
    /** 是否已配置 */
    isConfigured?: boolean;
  }
  interface GetMenuQueryResult {
@@ -690,8 +895,6 @@
  }
  interface GetOperationUserInfosQueryResultItemRole {
    /** 用户Id */
    userInfoId?: string;
    /** 角色Id */
    id?: string;
    /** 名称 */
@@ -877,6 +1080,7 @@
  }
  interface SaveDictionaryCategoryCommand {
    /** Id */
    id?: string;
    /** 编号 */
    code: string;
@@ -889,6 +1093,7 @@
  }
  interface SaveDictionaryDataCommand {
    /** Id */
    id?: string;
    /** 类别Id */
    categoryId?: string;
@@ -912,6 +1117,37 @@
    sort?: number;
    /** 是否禁用 */
    isDisabled?: boolean;
  }
  interface SaveEnterpriseCommand {
    /** Id */
    id?: string;
    /** 企业全称 */
    enterpriseName: string;
    /** 统一社会信用代码 */
    societyCreditCode: string;
    /** 法人姓名 */
    legalPerson?: string;
    /** 法人身份证号 */
    legalIdentity?: string;
    /** 所在省份Id */
    provinceId?: string;
    /** 所在城市Id */
    cityId?: string;
    /** 所属行业Id */
    industryTypeId?: string;
    /** 主营业务 */
    mainBusiness?: string;
    /** 联系人 */
    contacts?: string;
    /** 联系电话 */
    contactPhoneNumber?: string;
    /** 联系邮箱 */
    contactEmail?: string;
    /** 账号 */
    userName?: string;
    /** 密码 */
    password?: string;
  }
  interface SaveMenuButtonCommand {
@@ -1055,11 +1291,48 @@
    resources?: GetRoleQueryResultResource[];
  }
  interface SelectQueryResultOptionGuidGetDictionaryCategorySelectQueryOption {
    /** 值 */
    value?: string;
    /** 标签 */
    label?: string;
    /** 数据 */
    data?: any;
  }
  interface SelectQueryResultOptionGuidGetDictionaryDataSelectQueryResultOption {
    /** 值 */
    value?: string;
    /** 标签 */
    label?: string;
    /** 数据 */
    data?: any;
  }
  interface SetDictionaryDataIsDisabledCommand {
    /** Id */
    ids?: string[];
    /** 是否禁用 */
    /** 是否已禁用 */
    isDisabled?: boolean;
  }
  interface SetEnterpriseElectronSignSettingCommand {
    /** Id */
    id?: string;
    realAccess?: EnumRealAccess;
    /** 实名费用 */
    realVerifyCost?: number;
    /** 签约费用 */
    signCost?: number;
    /** 一口价 */
    mergeSignCost?: number;
  }
  interface SetEnterpriseSmsSettingCommand {
    /** Id */
    id?: string;
    smsAccess?: EnumSmsAccess;
    /** 短信费用 */
    smsCost?: number;
  }
  interface SetMenuSwitchCommand {
@@ -1073,9 +1346,8 @@
  }
  interface SetRoleIsDisabledCommand {
    /** Id */
    ids: string[];
    /** 是否禁用 */
    ids?: string[];
    /** 是否已禁用 */
    isDisabled?: boolean;
  }
src/store/modules/permission.ts
@@ -3,7 +3,7 @@
// import { RouteConfigs } from "@/layout/types";
import { constantRoutes, Route } from '@/router';
import { addAsyncRoutes, ascending } from '@/router/utils';
import * as menuServices from '@/services/api/menu';
import * as authServices from '@/services/api/auth';
import { myClient } from '@/constants/query';
export interface PermissonState {
@@ -28,14 +28,11 @@
    getModuleList() {
      return new Promise<Route[]>(async (resolve, reject) => {
        try {
          const params: API.APIgetMenusParams = {
            userType: AppLocalConfig.userType,
            clientType: AppLocalConfig.clientType,
          };
          const params: API.APIgetCurrentLogierMenusParams = {};
          const res = await myClient.fetchQuery({
            queryKey: ['menuServices/getMenus', params],
            queryKey: ['authServices/getCurrentLogierMenus', params],
            queryFn: () => {
              return menuServices.getMenus(params, {
              return authServices.getCurrentLogierMenus(params, {
                showLoading: false,
              });
            },
types/api.d.ts
@@ -13,39 +13,4 @@
    mock?: boolean;
    customErrorHandler?: (error: any) => boolean;
  }
  interface ModuleButtonDto {
    isEdit?: boolean;
  }
  interface ModuleColumnDto {
    isEdit?: boolean;
    fixed?: boolean | 'left' | 'right';
    needTips?: boolean;
  }
  interface CustomModuleColumnDto extends ModuleColumnDto {
    id: string;
    enCode: string;
    name: string;
  }
  interface DepartmentTree {
    leaf?: boolean;
  }
  interface StationTree {
    leaf?: boolean;
  }
  interface RoleList {
    //是否是客户端
    isClient?: boolean;
  }
  interface AreaTreeNode extends AreaDto {
    children?: AreaTreeNode[];
  }
  interface GetSearchSettingList {
    children?: GetSearchSettingList[];
  }
}