sys-oauth-api.ts 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. /* tslint:disable */
  2. /* eslint-disable */
  3. /**
  4. * Admin.NET 通用权限开发平台
  5. * 让 .NET 开发更简单、更通用、更流行。前后端分离架构(.NET6/Vue3),开箱即用紧随前沿技术。<br/><a href='https://gitee.com/zuohuaijun/Admin.NET/'>https://gitee.com/zuohuaijun/Admin.NET</a>
  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 globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
  15. import { Configuration } from '../configuration';
  16. // Some imports not used depending on template conditions
  17. // @ts-ignore
  18. import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
  19. import { AdminResultIActionResult } from '../models';
  20. /**
  21. * SysOAuthApi - axios parameter creator
  22. * @export
  23. */
  24. export const SysOAuthApiAxiosParamCreator = function (configuration?: Configuration) {
  25. return {
  26. /**
  27. *
  28. * @summary 授权回调
  29. * @param {string} [provider]
  30. * @param {string} [redirectUrl]
  31. * @param {*} [options] Override http request option.
  32. * @throws {RequiredError}
  33. */
  34. apiSysOAuthSignInCallbackGet: async (provider?: string, redirectUrl?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
  35. const localVarPath = `/api/sysOAuth/signInCallback`;
  36. // use dummy base URL string because the URL constructor only accepts absolute URLs.
  37. const localVarUrlObj = new URL(localVarPath, 'https://example.com');
  38. let baseOptions;
  39. if (configuration) {
  40. baseOptions = configuration.baseOptions;
  41. }
  42. const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
  43. const localVarHeaderParameter = {} as any;
  44. const localVarQueryParameter = {} as any;
  45. // authentication Bearer required
  46. // http bearer authentication required
  47. if (configuration && configuration.accessToken) {
  48. const accessToken = typeof configuration.accessToken === 'function'
  49. ? await configuration.accessToken()
  50. : await configuration.accessToken;
  51. localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
  52. }
  53. if (provider !== undefined) {
  54. localVarQueryParameter['provider'] = provider;
  55. }
  56. if (redirectUrl !== undefined) {
  57. localVarQueryParameter['redirectUrl'] = redirectUrl;
  58. }
  59. const query = new URLSearchParams(localVarUrlObj.search);
  60. for (const key in localVarQueryParameter) {
  61. query.set(key, localVarQueryParameter[key]);
  62. }
  63. for (const key in options.params) {
  64. query.set(key, options.params[key]);
  65. }
  66. localVarUrlObj.search = (new URLSearchParams(query)).toString();
  67. let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
  68. localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
  69. return {
  70. url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
  71. options: localVarRequestOptions,
  72. };
  73. },
  74. /**
  75. *
  76. * @summary 第三方登录
  77. * @param {string} [provider]
  78. * @param {string} [redirectUrl]
  79. * @param {*} [options] Override http request option.
  80. * @throws {RequiredError}
  81. */
  82. apiSysOAuthSignInGet: async (provider?: string, redirectUrl?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
  83. const localVarPath = `/api/sysOAuth/signIn`;
  84. // use dummy base URL string because the URL constructor only accepts absolute URLs.
  85. const localVarUrlObj = new URL(localVarPath, 'https://example.com');
  86. let baseOptions;
  87. if (configuration) {
  88. baseOptions = configuration.baseOptions;
  89. }
  90. const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
  91. const localVarHeaderParameter = {} as any;
  92. const localVarQueryParameter = {} as any;
  93. // authentication Bearer required
  94. // http bearer authentication required
  95. if (configuration && configuration.accessToken) {
  96. const accessToken = typeof configuration.accessToken === 'function'
  97. ? await configuration.accessToken()
  98. : await configuration.accessToken;
  99. localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
  100. }
  101. if (provider !== undefined) {
  102. localVarQueryParameter['provider'] = provider;
  103. }
  104. if (redirectUrl !== undefined) {
  105. localVarQueryParameter['redirectUrl'] = redirectUrl;
  106. }
  107. const query = new URLSearchParams(localVarUrlObj.search);
  108. for (const key in localVarQueryParameter) {
  109. query.set(key, localVarQueryParameter[key]);
  110. }
  111. for (const key in options.params) {
  112. query.set(key, options.params[key]);
  113. }
  114. localVarUrlObj.search = (new URLSearchParams(query)).toString();
  115. let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
  116. localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
  117. return {
  118. url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
  119. options: localVarRequestOptions,
  120. };
  121. },
  122. }
  123. };
  124. /**
  125. * SysOAuthApi - functional programming interface
  126. * @export
  127. */
  128. export const SysOAuthApiFp = function(configuration?: Configuration) {
  129. return {
  130. /**
  131. *
  132. * @summary 授权回调
  133. * @param {string} [provider]
  134. * @param {string} [redirectUrl]
  135. * @param {*} [options] Override http request option.
  136. * @throws {RequiredError}
  137. */
  138. async apiSysOAuthSignInCallbackGet(provider?: string, redirectUrl?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultIActionResult>>> {
  139. const localVarAxiosArgs = await SysOAuthApiAxiosParamCreator(configuration).apiSysOAuthSignInCallbackGet(provider, redirectUrl, options);
  140. return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
  141. const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
  142. return axios.request(axiosRequestArgs);
  143. };
  144. },
  145. /**
  146. *
  147. * @summary 第三方登录
  148. * @param {string} [provider]
  149. * @param {string} [redirectUrl]
  150. * @param {*} [options] Override http request option.
  151. * @throws {RequiredError}
  152. */
  153. async apiSysOAuthSignInGet(provider?: string, redirectUrl?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultIActionResult>>> {
  154. const localVarAxiosArgs = await SysOAuthApiAxiosParamCreator(configuration).apiSysOAuthSignInGet(provider, redirectUrl, options);
  155. return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
  156. const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
  157. return axios.request(axiosRequestArgs);
  158. };
  159. },
  160. }
  161. };
  162. /**
  163. * SysOAuthApi - factory interface
  164. * @export
  165. */
  166. export const SysOAuthApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
  167. return {
  168. /**
  169. *
  170. * @summary 授权回调
  171. * @param {string} [provider]
  172. * @param {string} [redirectUrl]
  173. * @param {*} [options] Override http request option.
  174. * @throws {RequiredError}
  175. */
  176. async apiSysOAuthSignInCallbackGet(provider?: string, redirectUrl?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultIActionResult>> {
  177. return SysOAuthApiFp(configuration).apiSysOAuthSignInCallbackGet(provider, redirectUrl, options).then((request) => request(axios, basePath));
  178. },
  179. /**
  180. *
  181. * @summary 第三方登录
  182. * @param {string} [provider]
  183. * @param {string} [redirectUrl]
  184. * @param {*} [options] Override http request option.
  185. * @throws {RequiredError}
  186. */
  187. async apiSysOAuthSignInGet(provider?: string, redirectUrl?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultIActionResult>> {
  188. return SysOAuthApiFp(configuration).apiSysOAuthSignInGet(provider, redirectUrl, options).then((request) => request(axios, basePath));
  189. },
  190. };
  191. };
  192. /**
  193. * SysOAuthApi - object-oriented interface
  194. * @export
  195. * @class SysOAuthApi
  196. * @extends {BaseAPI}
  197. */
  198. export class SysOAuthApi extends BaseAPI {
  199. /**
  200. *
  201. * @summary 授权回调
  202. * @param {string} [provider]
  203. * @param {string} [redirectUrl]
  204. * @param {*} [options] Override http request option.
  205. * @throws {RequiredError}
  206. * @memberof SysOAuthApi
  207. */
  208. public async apiSysOAuthSignInCallbackGet(provider?: string, redirectUrl?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultIActionResult>> {
  209. return SysOAuthApiFp(this.configuration).apiSysOAuthSignInCallbackGet(provider, redirectUrl, options).then((request) => request(this.axios, this.basePath));
  210. }
  211. /**
  212. *
  213. * @summary 第三方登录
  214. * @param {string} [provider]
  215. * @param {string} [redirectUrl]
  216. * @param {*} [options] Override http request option.
  217. * @throws {RequiredError}
  218. * @memberof SysOAuthApi
  219. */
  220. public async apiSysOAuthSignInGet(provider?: string, redirectUrl?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultIActionResult>> {
  221. return SysOAuthApiFp(this.configuration).apiSysOAuthSignInGet(provider, redirectUrl, options).then((request) => request(this.axios, this.basePath));
  222. }
  223. }