base.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* tslint:disable */
  2. /* eslint-disable */
  3. /**
  4. * Admin.NET 通用权限开发平台
  5. * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
  6. *
  7. * OpenAPI spec version: 1.0.0
  8. *
  9. *
  10. * NOTE: This class is auto generated by the swagger code generator program.
  11. * https://github.com/swagger-api/swagger-codegen.git
  12. * Do not edit the class manually.
  13. */
  14. import { Configuration } from "./configuration";
  15. // Some imports not used depending on template conditions
  16. // @ts-ignore
  17. import globalAxios, { AxiosRequestConfig, AxiosInstance } from 'axios';
  18. export const BASE_PATH = "/".replace(/\/+$/, "");
  19. /**
  20. *
  21. * @export
  22. */
  23. export const COLLECTION_FORMATS = {
  24. csv: ",",
  25. ssv: " ",
  26. tsv: "\t",
  27. pipes: "|",
  28. };
  29. /**
  30. *
  31. * @export
  32. * @interface RequestArgs
  33. */
  34. export interface RequestArgs {
  35. url: string;
  36. options: AxiosRequestConfig;
  37. }
  38. /**
  39. *
  40. * @export
  41. * @class BaseAPI
  42. */
  43. export class BaseAPI {
  44. protected configuration: Configuration | undefined;
  45. constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
  46. if (configuration) {
  47. this.configuration = configuration;
  48. this.basePath = configuration.basePath || this.basePath;
  49. }
  50. }
  51. };
  52. /**
  53. *
  54. * @export
  55. * @class RequiredError
  56. * @extends {Error}
  57. */
  58. export class RequiredError extends Error {
  59. name: "RequiredError" = "RequiredError";
  60. constructor(public field: string, msg?: string) {
  61. super(msg);
  62. }
  63. }