• トークンを取り扱うロジックを生成します。

    Returns {
        getFixToken: () => string;
        getToken: () => string;
        getTokenHeader: (
            param?: { config?: AxiosRequestConfig<any>; useFixed?: boolean },
        ) => AxiosRequestConfig<any>;
        setFixToken: (fixToken: string) => void;
        setToken: (token: string) => void;
    }

    • getFixToken: () => string
    • getToken: () => string
    • getTokenHeader: (
          param?: { config?: AxiosRequestConfig<any>; useFixed?: boolean },
      ) => AxiosRequestConfig<any>
    • setFixToken: (fixToken: string) => void
    • setToken: (token: string) => void
    const { post } = Mdc.useWebApiAdapter();
    const { getTokenHeader } = Mdc.useToken();

    const requestConfig = getTokenHeader({ useFixed: false });
    post({
    webApiName: "mdc/test",
    data: {},
    option: {
    axiosConfig: requestConfig
    }
    })