This commit is contained in:
Archer
2023-10-22 23:54:04 +08:00
committed by GitHub
parent 3091a90df6
commit a3534407bf
365 changed files with 7266 additions and 6055 deletions

View File

@@ -1,6 +1,6 @@
import { GET, POST, DELETE } from '@/web/common/api/request';
import type { EditApiKeyProps, GetApiKeyProps } from '@/global/support/api/openapiReq.d';
import type { OpenApiSchema } from '@fastgpt/support/openapi/type.d';
import type { OpenApiSchema } from '@fastgpt/global/support/openapi/type';
/**
* crete a api key

View File

@@ -1,6 +1,6 @@
import { GET, POST, DELETE } from '@/web/common/api/request';
import type { InitShareChatResponse } from '@/global/support/api/outLinkRes.d';
import type { OutLinkEditType, OutLinkSchema } from '@fastgpt/support/outLink/type.d';
import type { OutLinkEditType, OutLinkSchema } from '@fastgpt/global/support/outLink/type.d';
/**
*

View File

@@ -1,5 +1,5 @@
import { GET, POST, PUT } from '@/web/common/api/request';
import { hashStr } from '@fastgpt/common/tools/str';
import { hashStr } from '@fastgpt/global/common/string/tools';
import type { ResLogin, PromotionRecordType } from '@/global/support/api/userRes.d';
import { UserAuthTypeEnum } from '@/constants/common';
import { UserType, UserUpdateParams } from '@/types/user';

View File

@@ -0,0 +1,18 @@
import { loginOut } from '@/web/support/user/api';
const tokenKey = 'token';
export const clearToken = () => {
try {
loginOut();
localStorage.removeItem(tokenKey);
} catch (error) {
error;
}
};
export const setToken = (token: string) => {
localStorage.setItem(tokenKey, token);
};
export const getToken = () => {
return localStorage.getItem(tokenKey) || '';
};

View File

@@ -1,9 +1,9 @@
import { useState, useMemo, useCallback } from 'react';
import { sendAuthCode } from '@/web/support/api/user';
import { sendAuthCode } from '@/web/support/user/api';
import { UserAuthTypeEnum } from '@/constants/common';
import { useToast } from '@/web/common/hooks/useToast';
import { feConfigs } from '@/web/common/store/static';
import { getErrText } from '@/utils/tools';
import { feConfigs } from '@/web/common/system/staticData';
import { getErrText } from '@fastgpt/global/common/error/utils';
let timer: any;

View File

@@ -2,9 +2,9 @@ import { create } from 'zustand';
import { devtools, persist } from 'zustand/middleware';
import { immer } from 'zustand/middleware/immer';
import type { UserType, UserUpdateParams } from '@/types/user';
import { getMyModels, getModelById, putAppById } from '@/web/core/api/app';
import { formatPrice } from '@fastgpt/common/bill/index';
import { getTokenLogin, putUserInfo } from '@/web/support/api/user';
import { getMyModels, getModelById, putAppById } from '@/web/core/app/api';
import { formatPrice } from '@fastgpt/global/common/bill/tools';
import { getTokenLogin, putUserInfo } from '@/web/support/user/api';
import { defaultApp } from '@/constants/model';
import { AppListItemType, AppUpdateParams } from '@/types/app';