From 2b771db5dd55ebda2b989030a24c146728315a6f Mon Sep 17 00:00:00 2001 From: ivamp Date: Wed, 25 Sep 2024 12:29:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/swagger.yaml | 157 +++++++++- src/api/api.ts | 520 +++++++++++++++++++++++++++++++++- src/layouts/DefaultLayout.vue | 46 +-- src/layouts/Header.vue | 101 ++++--- src/pages/Guest.vue | 147 ++++++++++ src/pages/guest/index.vue | 46 --- src/pages/index.vue | 10 +- src/plugins/api.ts | 7 +- src/typed-router.d.ts | 2 +- 9 files changed, 902 insertions(+), 134 deletions(-) create mode 100644 src/pages/Guest.vue delete mode 100644 src/pages/guest/index.vue diff --git a/api/swagger.yaml b/api/swagger.yaml index 526a97a..eee6bc4 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -263,6 +263,25 @@ definitions: user_id: type: string type: object + page.PagedResult-schema_AssistantPublic: + properties: + data: + items: + $ref: '#/definitions/schema.AssistantPublic' + type: array + page: + description: 当前页码 + type: integer + page_size: + description: 每页大小 + type: integer + total_count: + description: 数据总条数 + type: integer + total_pages: + description: 总页数 + type: integer + type: object schema.AddPublicChatMessageRequest: properties: assistant_key: @@ -325,6 +344,15 @@ definitions: required: - library_id type: object + schema.AssistantPublic: + properties: + description: + type: string + id: + type: integer + name: + type: string + type: object schema.AssistantUpdateRequest: properties: description: @@ -353,6 +381,11 @@ definitions: prompt: maxLength: 512 type: string + public: + enum: + - true + - false + type: boolean temperature: enum: - 0.1 @@ -590,6 +623,13 @@ definitions: success: type: boolean type: object + schema.SiteUsageResponse: + properties: + month_tokens: + type: integer + month_tool_calls: + type: integer + type: object schema.TokenUsage: properties: completion_tokens: @@ -1125,10 +1165,14 @@ paths: summary: 绑定 Tool tags: - assistant - /api/v1/assistants/public: + /api/v1/assistants/favorites: get: consumes: - application/json + parameters: + - in: query + name: page + type: integer produces: - application/json responses: @@ -1139,9 +1183,36 @@ paths: - $ref: '#/definitions/schema.ResponseBody' - properties: data: - items: - $ref: '#/definitions/entity.Assistant' - type: array + $ref: '#/definitions/page.PagedResult-schema_AssistantPublic' + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/schema.ResponseBody' + security: + - ApiKeyAuth: [] + summary: 收藏的助理列表 + tags: + - assistant + /api/v1/assistants/public: + get: + consumes: + - application/json + parameters: + - in: query + name: page + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/schema.ResponseBody' + - properties: + data: + $ref: '#/definitions/page.PagedResult-schema_AssistantPublic' type: object "400": description: Bad Request @@ -1152,6 +1223,65 @@ paths: summary: 获取公开的助理列表 tags: - assistant + /api/v1/assistants/public/{id}: + delete: + consumes: + - application/json + parameters: + - in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/schema.ResponseBody' + - properties: + data: + $ref: '#/definitions/schema.AssistantPublic' + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/schema.ResponseBody' + security: + - ApiKeyAuth: [] + summary: 取消收藏助理 + tags: + - assistant + post: + consumes: + - application/json + parameters: + - in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/schema.ResponseBody' + - properties: + data: + $ref: '#/definitions/schema.AssistantPublic' + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/schema.ResponseBody' + security: + - ApiKeyAuth: [] + summary: 收藏助理 + tags: + - assistant /api/v1/chat_public: get: consumes: @@ -2347,6 +2477,25 @@ paths: summary: 校验 Discovery 语法 tags: - tool + /api/v1/usage: + get: + consumes: + - application/json + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/schema.ResponseBody' + - properties: + data: + $ref: '#/definitions/schema.SiteUsageResponse' + type: object + summary: 获取站点 Usage + tags: + - usage securityDefinitions: ApiKeyAuth: in: header diff --git a/src/api/api.ts b/src/api/api.ts index 68c7f37..aeebb27 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -23,6 +23,37 @@ import type { RequestArgs } from './base'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base'; +/** + * + * @export + * @interface ApiV1AssistantsFavoritesGet200Response + */ +export interface ApiV1AssistantsFavoritesGet200Response { + /** + * + * @type {PagePagedResultSchemaAssistantPublic} + * @memberof ApiV1AssistantsFavoritesGet200Response + */ + 'data'?: PagePagedResultSchemaAssistantPublic; + /** + * + * @type {string} + * @memberof ApiV1AssistantsFavoritesGet200Response + */ + 'error'?: string; + /** + * + * @type {string} + * @memberof ApiV1AssistantsFavoritesGet200Response + */ + 'message'?: string; + /** + * + * @type {boolean} + * @memberof ApiV1AssistantsFavoritesGet200Response + */ + 'success'?: boolean; +} /** * * @export @@ -209,6 +240,37 @@ export interface ApiV1AssistantsPost200Response { */ 'success'?: boolean; } +/** + * + * @export + * @interface ApiV1AssistantsPublicIdPost200Response + */ +export interface ApiV1AssistantsPublicIdPost200Response { + /** + * + * @type {SchemaAssistantPublic} + * @memberof ApiV1AssistantsPublicIdPost200Response + */ + 'data'?: SchemaAssistantPublic; + /** + * + * @type {string} + * @memberof ApiV1AssistantsPublicIdPost200Response + */ + 'error'?: string; + /** + * + * @type {string} + * @memberof ApiV1AssistantsPublicIdPost200Response + */ + 'message'?: string; + /** + * + * @type {boolean} + * @memberof ApiV1AssistantsPublicIdPost200Response + */ + 'success'?: boolean; +} /** * * @export @@ -631,6 +693,37 @@ export interface ApiV1ToolsPost200Response { */ 'success'?: boolean; } +/** + * + * @export + * @interface ApiV1UsageGet200Response + */ +export interface ApiV1UsageGet200Response { + /** + * + * @type {SchemaSiteUsageResponse} + * @memberof ApiV1UsageGet200Response + */ + 'data'?: SchemaSiteUsageResponse; + /** + * + * @type {string} + * @memberof ApiV1UsageGet200Response + */ + 'error'?: string; + /** + * + * @type {string} + * @memberof ApiV1UsageGet200Response + */ + 'message'?: string; + /** + * + * @type {boolean} + * @memberof ApiV1UsageGet200Response + */ + 'success'?: boolean; +} /** * * @export @@ -1333,6 +1426,43 @@ export interface EntityTool { */ 'user_id'?: string; } +/** + * + * @export + * @interface PagePagedResultSchemaAssistantPublic + */ +export interface PagePagedResultSchemaAssistantPublic { + /** + * + * @type {Array} + * @memberof PagePagedResultSchemaAssistantPublic + */ + 'data'?: Array; + /** + * 当前页码 + * @type {number} + * @memberof PagePagedResultSchemaAssistantPublic + */ + 'page'?: number; + /** + * 每页大小 + * @type {number} + * @memberof PagePagedResultSchemaAssistantPublic + */ + 'page_size'?: number; + /** + * 数据总条数 + * @type {number} + * @memberof PagePagedResultSchemaAssistantPublic + */ + 'total_count'?: number; + /** + * 总页数 + * @type {number} + * @memberof PagePagedResultSchemaAssistantPublic + */ + 'total_pages'?: number; +} /** * * @export @@ -1425,6 +1555,31 @@ export interface SchemaAssistantLibraryRequest { */ 'library_id': number; } +/** + * + * @export + * @interface SchemaAssistantPublic + */ +export interface SchemaAssistantPublic { + /** + * + * @type {string} + * @memberof SchemaAssistantPublic + */ + 'description'?: string; + /** + * + * @type {number} + * @memberof SchemaAssistantPublic + */ + 'id'?: number; + /** + * + * @type {string} + * @memberof SchemaAssistantPublic + */ + 'name'?: string; +} /** * * @export @@ -1473,6 +1628,12 @@ export interface SchemaAssistantUpdateRequest { * @memberof SchemaAssistantUpdateRequest */ 'prompt'?: string; + /** + * + * @type {boolean} + * @memberof SchemaAssistantUpdateRequest + */ + 'public'?: boolean; /** * * @type {number} @@ -1973,6 +2134,25 @@ export interface SchemaResponseBody { */ 'success'?: boolean; } +/** + * + * @export + * @interface SchemaSiteUsageResponse + */ +export interface SchemaSiteUsageResponse { + /** + * + * @type {number} + * @memberof SchemaSiteUsageResponse + */ + 'month_tokens'?: number; + /** + * + * @type {number} + * @memberof SchemaSiteUsageResponse + */ + 'month_tool_calls'?: number; +} /** * * @export @@ -2179,6 +2359,44 @@ export interface SchemaToolDiscoveryOutputFunctions { */ export const AssistantApiAxiosParamCreator = function (configuration?: Configuration) { return { + /** + * + * @summary 收藏的助理列表 + * @param {number} [page] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiV1AssistantsFavoritesGet: async (page?: number, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/v1/assistants/favorites`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyAuth required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + if (page !== undefined) { + localVarQueryParameter['page'] = page; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * * @summary 获取 Assistant 列表 @@ -2685,10 +2903,11 @@ export const AssistantApiAxiosParamCreator = function (configuration?: Configura /** * * @summary 获取公开的助理列表 + * @param {number} [page] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - apiV1AssistantsPublicGet: async (options: RawAxiosRequestConfig = {}): Promise => { + apiV1AssistantsPublicGet: async (page?: number, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/assistants/public`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -2704,6 +2923,84 @@ export const AssistantApiAxiosParamCreator = function (configuration?: Configura // authentication ApiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + if (page !== undefined) { + localVarQueryParameter['page'] = page; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary 取消收藏助理 + * @param {number} id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiV1AssistantsPublicIdDelete: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('apiV1AssistantsPublicIdDelete', 'id', id) + const localVarPath = `/api/v1/assistants/public/{id}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyAuth required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary 收藏助理 + * @param {number} id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiV1AssistantsPublicIdPost: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('apiV1AssistantsPublicIdPost', 'id', id) + const localVarPath = `/api/v1/assistants/public/{id}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyAuth required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + setSearchParams(localVarUrlObj, localVarQueryParameter); @@ -2725,6 +3022,19 @@ export const AssistantApiAxiosParamCreator = function (configuration?: Configura export const AssistantApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = AssistantApiAxiosParamCreator(configuration) return { + /** + * + * @summary 收藏的助理列表 + * @param {number} [page] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiV1AssistantsFavoritesGet(page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.apiV1AssistantsFavoritesGet(page, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['AssistantApi.apiV1AssistantsFavoritesGet']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, /** * * @summary 获取 Assistant 列表 @@ -2901,15 +3211,42 @@ export const AssistantApiFp = function(configuration?: Configuration) { /** * * @summary 获取公开的助理列表 + * @param {number} [page] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiV1AssistantsPublicGet(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.apiV1AssistantsPublicGet(options); + async apiV1AssistantsPublicGet(page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.apiV1AssistantsPublicGet(page, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['AssistantApi.apiV1AssistantsPublicGet']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, + /** + * + * @summary 取消收藏助理 + * @param {number} id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiV1AssistantsPublicIdDelete(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.apiV1AssistantsPublicIdDelete(id, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['AssistantApi.apiV1AssistantsPublicIdDelete']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary 收藏助理 + * @param {number} id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiV1AssistantsPublicIdPost(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.apiV1AssistantsPublicIdPost(id, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['AssistantApi.apiV1AssistantsPublicIdPost']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, } }; @@ -2920,6 +3257,16 @@ export const AssistantApiFp = function(configuration?: Configuration) { export const AssistantApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = AssistantApiFp(configuration) return { + /** + * + * @summary 收藏的助理列表 + * @param {number} [page] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiV1AssistantsFavoritesGet(page?: number, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.apiV1AssistantsFavoritesGet(page, options).then((request) => request(axios, basePath)); + }, /** * * @summary 获取 Assistant 列表 @@ -3057,11 +3404,32 @@ export const AssistantApiFactory = function (configuration?: Configuration, base /** * * @summary 获取公开的助理列表 + * @param {number} [page] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - apiV1AssistantsPublicGet(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.apiV1AssistantsPublicGet(options).then((request) => request(axios, basePath)); + apiV1AssistantsPublicGet(page?: number, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.apiV1AssistantsPublicGet(page, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary 取消收藏助理 + * @param {number} id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiV1AssistantsPublicIdDelete(id: number, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.apiV1AssistantsPublicIdDelete(id, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary 收藏助理 + * @param {number} id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiV1AssistantsPublicIdPost(id: number, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.apiV1AssistantsPublicIdPost(id, options).then((request) => request(axios, basePath)); }, }; }; @@ -3073,6 +3441,18 @@ export const AssistantApiFactory = function (configuration?: Configuration, base * @extends {BaseAPI} */ export class AssistantApi extends BaseAPI { + /** + * + * @summary 收藏的助理列表 + * @param {number} [page] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AssistantApi + */ + public apiV1AssistantsFavoritesGet(page?: number, options?: RawAxiosRequestConfig) { + return AssistantApiFp(this.configuration).apiV1AssistantsFavoritesGet(page, options).then((request) => request(this.axios, this.basePath)); + } + /** * * @summary 获取 Assistant 列表 @@ -3236,12 +3616,37 @@ export class AssistantApi extends BaseAPI { /** * * @summary 获取公开的助理列表 + * @param {number} [page] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AssistantApi */ - public apiV1AssistantsPublicGet(options?: RawAxiosRequestConfig) { - return AssistantApiFp(this.configuration).apiV1AssistantsPublicGet(options).then((request) => request(this.axios, this.basePath)); + public apiV1AssistantsPublicGet(page?: number, options?: RawAxiosRequestConfig) { + return AssistantApiFp(this.configuration).apiV1AssistantsPublicGet(page, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary 取消收藏助理 + * @param {number} id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AssistantApi + */ + public apiV1AssistantsPublicIdDelete(id: number, options?: RawAxiosRequestConfig) { + return AssistantApiFp(this.configuration).apiV1AssistantsPublicIdDelete(id, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary 收藏助理 + * @param {number} id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AssistantApi + */ + public apiV1AssistantsPublicIdPost(id: number, options?: RawAxiosRequestConfig) { + return AssistantApiFp(this.configuration).apiV1AssistantsPublicIdPost(id, options).then((request) => request(this.axios, this.basePath)); } } @@ -6226,3 +6631,104 @@ export class ToolApi extends BaseAPI { +/** + * UsageApi - axios parameter creator + * @export + */ +export const UsageApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary 获取站点 Usage + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiV1UsageGet: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/v1/usage`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * UsageApi - functional programming interface + * @export + */ +export const UsageApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = UsageApiAxiosParamCreator(configuration) + return { + /** + * + * @summary 获取站点 Usage + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiV1UsageGet(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.apiV1UsageGet(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['UsageApi.apiV1UsageGet']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * UsageApi - factory interface + * @export + */ +export const UsageApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = UsageApiFp(configuration) + return { + /** + * + * @summary 获取站点 Usage + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiV1UsageGet(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.apiV1UsageGet(options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * UsageApi - object-oriented interface + * @export + * @class UsageApi + * @extends {BaseAPI} + */ +export class UsageApi extends BaseAPI { + /** + * + * @summary 获取站点 Usage + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UsageApi + */ + public apiV1UsageGet(options?: RawAxiosRequestConfig) { + return UsageApiFp(this.configuration).apiV1UsageGet(options).then((request) => request(this.axios, this.basePath)); + } +} + + + diff --git a/src/layouts/DefaultLayout.vue b/src/layouts/DefaultLayout.vue index b4d1ee3..97555ef 100644 --- a/src/layouts/DefaultLayout.vue +++ b/src/layouts/DefaultLayout.vue @@ -44,7 +44,6 @@ const onScroll = (e: Event) => { diff --git a/src/layouts/Header.vue b/src/layouts/Header.vue index 0b3c329..f05a3b3 100644 --- a/src/layouts/Header.vue +++ b/src/layouts/Header.vue @@ -30,7 +30,10 @@ closable :native-scrollbar="false" > - + +
+ 要使用 Amberlet,请先登录。 +
- - - - 新对话 - - - - - - - - - - - +
+ + + + 新对话 + + + + + + + + + + + + +
+ +
+ 登录 +
@@ -165,4 +178,10 @@ if (isMobile.value) { const backToHome = () => { router.push("/"); }; + + +const gotoLogin = () => { + router.push("/auth/login"); +}; + diff --git a/src/pages/Guest.vue b/src/pages/Guest.vue new file mode 100644 index 0000000..202c344 --- /dev/null +++ b/src/pages/Guest.vue @@ -0,0 +1,147 @@ +