## 概要 [Task: 1361](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/OMDSDictation/_sprints/taskboard/OMDSDictation%20%E3%83%81%E3%83%BC%E3%83%A0/OMDSDictation/%E3%82%B9%E3%83%97%E3%83%AA%E3%83%B3%E3%83%88%203-2?workitem=1361) - B2Cログイン後、IDトークンを引数にログインAPIを呼ぶ - ログインAPIレスポンスのアクセストークン・リフレッシュトークンをlocalStorage/storeにセット - ログインAPIが成否でページ遷移先を変更する ## レビューポイント - IDトークンの取得方法は下記リンクを参考にした - https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-react/FAQ.md#how-do-i-handle-the-redirect-flow-in-a-react-app ## UIの変更 - https://ndstokyo.sharepoint.com/:f:/r/sites/Piranha/Shared%20Documents/General/OMDS/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88/Task1361?csf=1&web=1&e=Fo5NQZ ## 動作確認状況 - ローカルで動作確認 ## 補足 - WIPです。 - 以下の実装は行っていません。 - アクセストークンの更新処理 - トークンの期限が切れていた場合、Topページにリダイレクトする処理
73 lines
1.6 KiB
TypeScript
73 lines
1.6 KiB
TypeScript
/* tslint:disable */
|
|
/* eslint-disable */
|
|
/**
|
|
* ODMSOpenAPI
|
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
*
|
|
* The version of the OpenAPI document: 1.0.0
|
|
*
|
|
*
|
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
* https://openapi-generator.tech
|
|
* Do not edit the class manually.
|
|
*/
|
|
|
|
|
|
import type { Configuration } from './configuration';
|
|
// Some imports not used depending on template conditions
|
|
// @ts-ignore
|
|
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
import globalAxios from 'axios';
|
|
|
|
export const BASE_PATH = "http://localhost".replace(/\/+$/, "");
|
|
|
|
/**
|
|
*
|
|
* @export
|
|
*/
|
|
export const COLLECTION_FORMATS = {
|
|
csv: ",",
|
|
ssv: " ",
|
|
tsv: "\t",
|
|
pipes: "|",
|
|
};
|
|
|
|
/**
|
|
*
|
|
* @export
|
|
* @interface RequestArgs
|
|
*/
|
|
export interface RequestArgs {
|
|
url: string;
|
|
options: AxiosRequestConfig;
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @export
|
|
* @class BaseAPI
|
|
*/
|
|
export class BaseAPI {
|
|
protected configuration: Configuration | undefined;
|
|
|
|
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
|
|
if (configuration) {
|
|
this.configuration = configuration;
|
|
this.basePath = configuration.basePath || this.basePath;
|
|
}
|
|
}
|
|
};
|
|
|
|
/**
|
|
*
|
|
* @export
|
|
* @class RequiredError
|
|
* @extends {Error}
|
|
*/
|
|
export class RequiredError extends Error {
|
|
constructor(public field: string, msg?: string) {
|
|
super(msg);
|
|
this.name = "RequiredError"
|
|
}
|
|
}
|