base.ts 1.8 KB

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