feat(jd-order): add functionality to delete all invalid cookies and update related API and documentation
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
java openjdk-21.0.2
|
||||
java openjdk-23
|
||||
nodejs 22.21.0
|
||||
|
||||
73
CLAUDE.md
73
CLAUDE.md
@@ -32,29 +32,29 @@ This is a Vue 3 frontend application built with Arco Design Pro, TypeScript, and
|
||||
|
||||
```bash
|
||||
# Development server
|
||||
pnpm dev
|
||||
pnpm dev # Start Vite dev server with development config
|
||||
|
||||
# Build for production
|
||||
pnpm build # Runs type check then builds
|
||||
pnpm build # TypeScript compilation + Vite build with production config
|
||||
|
||||
# Type checking
|
||||
pnpm type:check # TypeScript and Vue type checking
|
||||
pnpm type:check # TypeScript + Vue type checking without emitting files
|
||||
|
||||
# Linting and formatting
|
||||
pnpm lint # Run all linting checks (ESLint + Stylelint + Prettier)
|
||||
pnpm lint:fix # Fix all linting issues automatically
|
||||
pnpm eslint # ESLint only
|
||||
pnpm eslint:fix # Fix ESLint issues
|
||||
pnpm lint # Run all linting (ESLint + Stylelint + Prettier)
|
||||
pnpm lint:fix # Auto-fix all linting issues
|
||||
pnpm eslint # ESLint only (targets src,mock,config directories)
|
||||
pnpm eslint:fix # Fix ESLint issues only
|
||||
pnpm prettier # Check Prettier formatting
|
||||
pnpm prettier:fix # Fix Prettier formatting
|
||||
pnpm stylelint # Stylelint only
|
||||
pnpm stylelint # Stylelint only (processes **/*.{html,vue,css,less})
|
||||
pnpm stylelint:fix # Fix Stylelint issues
|
||||
|
||||
# API generation
|
||||
pnpm generate:api # Generate TypeScript API client from OpenAPI spec
|
||||
pnpm generate:api # Generate TypeScript API client from OpenAPI spec at http://127.0.0.1:12401/api.json
|
||||
|
||||
# Cache and dependencies
|
||||
pnpm clean:cache # Clear ESLint cache and reinstall dependencies
|
||||
pnpm clean:cache # Clear .eslintcache and reinstall dependencies
|
||||
pnpm lint-staged # Run lint-staged (used by pre-commit hooks)
|
||||
```
|
||||
|
||||
@@ -154,13 +154,11 @@ Uses Pinia with modular stores:
|
||||
|
||||
### API Generation
|
||||
|
||||
The project uses OpenAPI Generator to create TypeScript clients:
|
||||
Uses OpenAPI Generator CLI to create TypeScript clients from `http://127.0.0.1:12401/api.json`. Generated client structure:
|
||||
|
||||
```bash
|
||||
pnpm generate:api
|
||||
```
|
||||
|
||||
This generates clients from `http://127.0.0.1:12401/api.json`
|
||||
- Separate models and APIs packages with tag-based grouping
|
||||
- TypeScript/axios generation with square brackets in array names
|
||||
- Single request parameter and string enums enabled
|
||||
|
||||
### Component Registration
|
||||
|
||||
@@ -168,7 +166,7 @@ Global components are auto-registered via `src/components/index.ts`
|
||||
|
||||
### Path Aliases
|
||||
|
||||
Configured in Vite config (`config/vite.config.base.mts`):
|
||||
Configured in `config/vite.config.base.mts`:
|
||||
|
||||
- `@/*` maps to `src/*`
|
||||
- `assets` maps to `src/assets`
|
||||
@@ -176,24 +174,34 @@ Configured in Vite config (`config/vite.config.base.mts`):
|
||||
|
||||
### Environment Configuration
|
||||
|
||||
Development settings in `.env.development`, production in `.env.production`
|
||||
- Development: `http://127.0.0.1:12401` (configured in `.env.development`)
|
||||
- Production: Uses `VITE_API_BASE_URL` from `.env.production` (currently empty)
|
||||
|
||||
### Code Quality
|
||||
|
||||
- ESLint for JavaScript/TypeScript linting (targets `src,mock,config` directories)
|
||||
- Stylelint for CSS/Less linting (processes `**/*.{html,vue,css,less}`)
|
||||
- Prettier for code formatting (processes `src/**/*.{js,ts,json,tsx,css,scss,vue,html,md}`)
|
||||
- Husky for Git hooks
|
||||
- Lint-staged for pre-commit checks (configured with file-specific linting rules)
|
||||
- Commitlint for conventional commits
|
||||
**Linting Tools**:
|
||||
|
||||
**Note**: All linting tools are configured to run automatically via lint-staged on pre-commit hooks.
|
||||
- ESLint: JavaScript/TypeScript linting (`src,mock,config` directories)
|
||||
- Stylelint: CSS/Less linting (`**/*.{html,vue,css,less}`)
|
||||
- Prettier: Code formatting (`src/**/*.{js,ts,json,tsx,css,scss,vue,html,md}`)
|
||||
|
||||
**Git Integration**:
|
||||
|
||||
- Husky for Git hooks
|
||||
- Lint-staged for pre-commit checks with file-specific rules
|
||||
- Commitlint for conventional commits
|
||||
- All linting runs automatically on pre-commit
|
||||
|
||||
**Engine Requirements**:
|
||||
|
||||
- Node.js: `^18.0.0 || >=20.0.0`
|
||||
- pnpm: `>=8.11.0` (package manager set to `pnpm@10.11.0`)
|
||||
|
||||
## Development Patterns
|
||||
|
||||
### API Calls
|
||||
|
||||
Use generated API clients or manual definitions from `src/api/`. All calls go through axios interceptors for auth handling.
|
||||
Use generated API clients from `src/api/generated/` or manual definitions from `src/api/*.ts`. All API calls go through axios interceptors for authentication handling.
|
||||
|
||||
### Component Structure
|
||||
|
||||
@@ -201,14 +209,15 @@ Follow Vue 3 Composition API patterns with `<script setup>` syntax. Use Arco Des
|
||||
|
||||
### State Management
|
||||
|
||||
Create Pinia stores for feature-level state that needs to be shared across components. Use TanStack Query for server state management.
|
||||
- Pinia stores for shared application state (modules: app, user, tab-bar)
|
||||
- TanStack Query for server state management and caching
|
||||
|
||||
### Build Configuration
|
||||
|
||||
The project uses Vite with multiple configuration files:
|
||||
Multi-environment Vite setup:
|
||||
|
||||
- `config/vite.config.base.mts` - Base configuration shared across environments
|
||||
- `config/vite.config.dev.mts` - Development configuration
|
||||
- `config/vite.config.prod.mts` - Production configuration
|
||||
- `config/vite.config.base.mts` - Shared base configuration
|
||||
- `config/vite.config.dev.mts` - Development server configuration
|
||||
- `config/vite.config.prod.mts` - Production build configuration
|
||||
|
||||
Build process includes TypeScript compilation (`vue-tsc --noEmit`) before Vite build.
|
||||
Build pipeline: TypeScript compilation (`vue-tsc --noEmit`) → Vite bundling
|
||||
|
||||
@@ -230,6 +230,7 @@ docs/KamiApiJdCookieV1CheckJdOrderPaymentReq.md
|
||||
docs/KamiApiJdCookieV1CheckJdOrderPaymentRes.md
|
||||
docs/KamiApiJdCookieV1CookieAccountInfo.md
|
||||
docs/KamiApiJdCookieV1CookieCheckResult.md
|
||||
docs/KamiApiJdCookieV1CookieDeleteResult.md
|
||||
docs/KamiApiJdCookieV1CookieHistoryInfo.md
|
||||
docs/KamiApiJdCookieV1CookieHistoryReq.md
|
||||
docs/KamiApiJdCookieV1CookieHistoryRes.md
|
||||
@@ -238,6 +239,7 @@ docs/KamiApiJdCookieV1CreateAccountRes.md
|
||||
docs/KamiApiJdCookieV1CreateOrderReq.md
|
||||
docs/KamiApiJdCookieV1CreateOrderRes.md
|
||||
docs/KamiApiJdCookieV1DeleteAccountReq.md
|
||||
docs/KamiApiJdCookieV1DeleteInvalidRes.md
|
||||
docs/KamiApiJdCookieV1ExportJdOrderReq.md
|
||||
docs/KamiApiJdCookieV1GetAccountReq.md
|
||||
docs/KamiApiJdCookieV1GetAccountRes.md
|
||||
@@ -609,6 +611,7 @@ models/kami-api-jd-cookie-v1-check-jd-order-payment-req.ts
|
||||
models/kami-api-jd-cookie-v1-check-jd-order-payment-res.ts
|
||||
models/kami-api-jd-cookie-v1-cookie-account-info.ts
|
||||
models/kami-api-jd-cookie-v1-cookie-check-result.ts
|
||||
models/kami-api-jd-cookie-v1-cookie-delete-result.ts
|
||||
models/kami-api-jd-cookie-v1-cookie-history-info.ts
|
||||
models/kami-api-jd-cookie-v1-cookie-history-req.ts
|
||||
models/kami-api-jd-cookie-v1-cookie-history-res.ts
|
||||
@@ -617,6 +620,7 @@ models/kami-api-jd-cookie-v1-create-account-res.ts
|
||||
models/kami-api-jd-cookie-v1-create-order-req.ts
|
||||
models/kami-api-jd-cookie-v1-create-order-res.ts
|
||||
models/kami-api-jd-cookie-v1-delete-account-req.ts
|
||||
models/kami-api-jd-cookie-v1-delete-invalid-res.ts
|
||||
models/kami-api-jd-cookie-v1-export-jd-order-req.ts
|
||||
models/kami-api-jd-cookie-v1-get-account-req.ts
|
||||
models/kami-api-jd-cookie-v1-get-account-res.ts
|
||||
|
||||
@@ -51,6 +51,8 @@ import type { KamiApiJdCookieV1CreateAccountReq } from '../models';
|
||||
// @ts-ignore
|
||||
import type { KamiApiJdCookieV1CreateAccountRes } from '../models';
|
||||
// @ts-ignore
|
||||
import type { KamiApiJdCookieV1DeleteInvalidRes } from '../models';
|
||||
// @ts-ignore
|
||||
import type { KamiApiJdCookieV1GetAccountRes } from '../models';
|
||||
// @ts-ignore
|
||||
import type { KamiApiJdCookieV1ListAccountRes } from '../models';
|
||||
@@ -254,6 +256,45 @@ export const JDCookieManagementApiAxiosParamCreator = function (
|
||||
options: localVarRequestOptions
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Delete All Invalid Cookies
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiJdCookieAccountDeleteInvalidDelete: async (
|
||||
options: RawAxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
const localVarPath = `/api/jd-cookie/account/delete-invalid`;
|
||||
// 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;
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers
|
||||
};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Get Single Cookie Account
|
||||
@@ -557,6 +598,37 @@ export const JDCookieManagementApiFp = function (
|
||||
configuration
|
||||
)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Delete All Invalid Cookies
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiJdCookieAccountDeleteInvalidDelete(
|
||||
options?: RawAxiosRequestConfig
|
||||
): Promise<
|
||||
(
|
||||
axios?: AxiosInstance,
|
||||
basePath?: string
|
||||
) => AxiosPromise<KamiApiJdCookieV1DeleteInvalidRes>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.apiJdCookieAccountDeleteInvalidDelete(
|
||||
options
|
||||
);
|
||||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||
const localVarOperationServerBasePath =
|
||||
operationServerMap[
|
||||
'JDCookieManagementApi.apiJdCookieAccountDeleteInvalidDelete'
|
||||
]?.[localVarOperationServerIndex]?.url;
|
||||
return (axios, basePath) =>
|
||||
createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Get Single Cookie Account
|
||||
@@ -747,6 +819,19 @@ export const JDCookieManagementApiFactory = function (
|
||||
.apiJdCookieAccountDeleteDelete(requestParameters.cookieId, options)
|
||||
.then(request => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Delete All Invalid Cookies
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiJdCookieAccountDeleteInvalidDelete(
|
||||
options?: RawAxiosRequestConfig
|
||||
): AxiosPromise<KamiApiJdCookieV1DeleteInvalidRes> {
|
||||
return localVarFp
|
||||
.apiJdCookieAccountDeleteInvalidDelete(options)
|
||||
.then(request => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Get Single Cookie Account
|
||||
@@ -856,6 +941,16 @@ export interface JDCookieManagementApiInterface {
|
||||
options?: RawAxiosRequestConfig
|
||||
): AxiosPromise<object>;
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary Delete All Invalid Cookies
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiJdCookieAccountDeleteInvalidDelete(
|
||||
options?: RawAxiosRequestConfig
|
||||
): AxiosPromise<KamiApiJdCookieV1DeleteInvalidRes>;
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary Get Single Cookie Account
|
||||
@@ -1046,6 +1141,20 @@ export class JDCookieManagementApi
|
||||
.then(request => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary Delete All Invalid Cookies
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
public apiJdCookieAccountDeleteInvalidDelete(
|
||||
options?: RawAxiosRequestConfig
|
||||
) {
|
||||
return JDCookieManagementApiFp(this.configuration)
|
||||
.apiJdCookieAccountDeleteInvalidDelete(options)
|
||||
.then(request => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary Get Single Cookie Account
|
||||
|
||||
@@ -446,6 +446,7 @@ export class JDHistoryApi extends BaseAPI implements JDHistoryApiInterface {
|
||||
}
|
||||
|
||||
export enum ApiJdCookieHistoryCookieGetChangeTypeEnum {
|
||||
BatchDelete = 'batch delete',
|
||||
Create = 'create',
|
||||
Delete = 'delete',
|
||||
Fail = 'fail',
|
||||
|
||||
@@ -2,15 +2,16 @@
|
||||
|
||||
All URIs are relative to _http://localhost_
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
| --------------------------------------------------------------------------- | -------------------------------------------- | ---------------------------- |
|
||||
| [**apiJdCookieAccountBatchCheckPost**](#apijdcookieaccountbatchcheckpost) | **POST** /api/jd-cookie/account/batch-check | Batch Check Cookie Status |
|
||||
| [**apiJdCookieAccountBatchCreatePost**](#apijdcookieaccountbatchcreatepost) | **POST** /api/jd-cookie/account/batch-create | Batch Create Cookie Accounts |
|
||||
| [**apiJdCookieAccountCreatePost**](#apijdcookieaccountcreatepost) | **POST** /api/jd-cookie/account/create | Create Cookie Account |
|
||||
| [**apiJdCookieAccountDeleteDelete**](#apijdcookieaccountdeletedelete) | **DELETE** /api/jd-cookie/account/delete | Delete Cookie Account |
|
||||
| [**apiJdCookieAccountGetGet**](#apijdcookieaccountgetget) | **GET** /api/jd-cookie/account/get | Get Single Cookie Account |
|
||||
| [**apiJdCookieAccountListGet**](#apijdcookieaccountlistget) | **GET** /api/jd-cookie/account/list | Query Cookie Account List |
|
||||
| [**apiJdCookieAccountUpdatePut**](#apijdcookieaccountupdateput) | **PUT** /api/jd-cookie/account/update | Update Cookie Account |
|
||||
| Method | HTTP request | Description |
|
||||
| ----------------------------------------------------------------------------------- | ------------------------------------------------ | ---------------------------- |
|
||||
| [**apiJdCookieAccountBatchCheckPost**](#apijdcookieaccountbatchcheckpost) | **POST** /api/jd-cookie/account/batch-check | Batch Check Cookie Status |
|
||||
| [**apiJdCookieAccountBatchCreatePost**](#apijdcookieaccountbatchcreatepost) | **POST** /api/jd-cookie/account/batch-create | Batch Create Cookie Accounts |
|
||||
| [**apiJdCookieAccountCreatePost**](#apijdcookieaccountcreatepost) | **POST** /api/jd-cookie/account/create | Create Cookie Account |
|
||||
| [**apiJdCookieAccountDeleteDelete**](#apijdcookieaccountdeletedelete) | **DELETE** /api/jd-cookie/account/delete | Delete Cookie Account |
|
||||
| [**apiJdCookieAccountDeleteInvalidDelete**](#apijdcookieaccountdeleteinvaliddelete) | **DELETE** /api/jd-cookie/account/delete-invalid | Delete All Invalid Cookies |
|
||||
| [**apiJdCookieAccountGetGet**](#apijdcookieaccountgetget) | **GET** /api/jd-cookie/account/get | Get Single Cookie Account |
|
||||
| [**apiJdCookieAccountListGet**](#apijdcookieaccountlistget) | **GET** /api/jd-cookie/account/list | Query Cookie Account List |
|
||||
| [**apiJdCookieAccountUpdatePut**](#apijdcookieaccountupdateput) | **PUT** /api/jd-cookie/account/update | Update Cookie Account |
|
||||
|
||||
# **apiJdCookieAccountBatchCheckPost**
|
||||
|
||||
@@ -207,6 +208,47 @@ No authorization required
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **apiJdCookieAccountDeleteInvalidDelete**
|
||||
|
||||
> KamiApiJdCookieV1DeleteInvalidRes apiJdCookieAccountDeleteInvalidDelete()
|
||||
|
||||
### Example
|
||||
|
||||
```typescript
|
||||
import { JDCookieManagementApi, Configuration } from './api';
|
||||
|
||||
const configuration = new Configuration();
|
||||
const apiInstance = new JDCookieManagementApi(configuration);
|
||||
|
||||
const { status, data } =
|
||||
await apiInstance.apiJdCookieAccountDeleteInvalidDelete();
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not have any parameters.
|
||||
|
||||
### Return type
|
||||
|
||||
**KamiApiJdCookieV1DeleteInvalidRes**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
|
||||
| Status code | Description | Response headers |
|
||||
| ----------- | ----------- | ---------------- |
|
||||
| **200** | | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **apiJdCookieAccountGetGet**
|
||||
|
||||
> KamiApiJdCookieV1GetAccountRes apiJdCookieAccountGetGet()
|
||||
|
||||
@@ -23,6 +23,7 @@ let cookieId: string; //Cookie ID (default to undefined)
|
||||
let page: number; //页码 (optional) (default to 1)
|
||||
let size: number; //每页大小 (optional) (default to 20)
|
||||
let changeType:
|
||||
| 'batch delete'
|
||||
| 'create'
|
||||
| 'delete'
|
||||
| 'fail'
|
||||
@@ -43,12 +44,12 @@ const { status, data } = await apiInstance.apiJdCookieHistoryCookieGet(
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| -------------- | --------------------- | ---------------- | ------------------------- | ---------------------- | ------------------ | ---------------- | ----------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | -------------------------------- |
|
||||
| **cookieId** | [**string**] | Cookie ID | defaults to undefined |
|
||||
| **page** | [**number**] | 页码 | (optional) defaults to 1 |
|
||||
| **size** | [**number**] | 每页大小 | (optional) defaults to 20 |
|
||||
| **changeType** | [\*\*'create' | 'delete' | 'fail' | 'refresh fail' | 'replaced' | 'resume' | 'suspend' | 'update' | 'use'**]**Array<'create' | 'delete' | 'fail' | 'refresh fail' | 'replaced' | 'resume' | 'suspend' | 'update' | 'use'>\*\* | 变更类型筛选 | (optional) defaults to undefined |
|
||||
| Name | Type | Description | Notes |
|
||||
| -------------- | --------------------------- | ---------------- | ------------------------- | -------------- | ---------------------- | ------------------ | ---------------- | ----------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | -------------------------------- |
|
||||
| **cookieId** | [**string**] | Cookie ID | defaults to undefined |
|
||||
| **page** | [**number**] | 页码 | (optional) defaults to 1 |
|
||||
| **size** | [**number**] | 每页大小 | (optional) defaults to 20 |
|
||||
| **changeType** | [\*\*'batch delete' | 'create' | 'delete' | 'fail' | 'refresh fail' | 'replaced' | 'resume' | 'suspend' | 'update' | 'use'**]**Array<'batch delete' | 'create' | 'delete' | 'fail' | 'refresh fail' | 'replaced' | 'resume' | 'suspend' | 'update' | 'use'>\*\* | 变更类型筛选 | (optional) defaults to undefined |
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
# KamiApiJdCookieV1CookieDeleteResult
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------ | ----------- | ------------ | --------------------------------- |
|
||||
| **cookieId** | **string** | Cookie ID | [optional] [default to undefined] |
|
||||
| **success** | **boolean** | 是否删除成功 | [optional] [default to undefined] |
|
||||
| **message** | **string** | 删除结果信息 | [optional] [default to undefined] |
|
||||
|
||||
## Example
|
||||
|
||||
```typescript
|
||||
import { KamiApiJdCookieV1CookieDeleteResult } from './api';
|
||||
|
||||
const instance: KamiApiJdCookieV1CookieDeleteResult = {
|
||||
cookieId,
|
||||
success,
|
||||
message
|
||||
};
|
||||
```
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
25
src/api/generated/docs/KamiApiJdCookieV1DeleteInvalidRes.md
Normal file
25
src/api/generated/docs/KamiApiJdCookieV1DeleteInvalidRes.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# KamiApiJdCookieV1DeleteInvalidRes
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---------------- | ---------------------------------------------------------------------------------------------- | ----------------------- | --------------------------------- |
|
||||
| **deletedCount** | **number** | 删除的Cookie数量 | [optional] [default to undefined] |
|
||||
| **successIds** | **Array<string>** | 成功删除的Cookie ID列表 | [optional] [default to undefined] |
|
||||
| **failedCount** | **number** | 删除失败的数量 | [optional] [default to undefined] |
|
||||
| **results** | [**Array<KamiApiJdCookieV1CookieDeleteResult>**](KamiApiJdCookieV1CookieDeleteResult.md) | 删除结果详情 | [optional] [default to undefined] |
|
||||
|
||||
## Example
|
||||
|
||||
```typescript
|
||||
import { KamiApiJdCookieV1DeleteInvalidRes } from './api';
|
||||
|
||||
const instance: KamiApiJdCookieV1DeleteInvalidRes = {
|
||||
deletedCount,
|
||||
successIds,
|
||||
failedCount,
|
||||
results
|
||||
};
|
||||
```
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
@@ -215,6 +215,7 @@ export * from './kami-api-jd-cookie-v1-check-jd-order-payment-req';
|
||||
export * from './kami-api-jd-cookie-v1-check-jd-order-payment-res';
|
||||
export * from './kami-api-jd-cookie-v1-cookie-account-info';
|
||||
export * from './kami-api-jd-cookie-v1-cookie-check-result';
|
||||
export * from './kami-api-jd-cookie-v1-cookie-delete-result';
|
||||
export * from './kami-api-jd-cookie-v1-cookie-history-info';
|
||||
export * from './kami-api-jd-cookie-v1-cookie-history-req';
|
||||
export * from './kami-api-jd-cookie-v1-cookie-history-res';
|
||||
@@ -223,6 +224,7 @@ export * from './kami-api-jd-cookie-v1-create-account-res';
|
||||
export * from './kami-api-jd-cookie-v1-create-order-req';
|
||||
export * from './kami-api-jd-cookie-v1-create-order-res';
|
||||
export * from './kami-api-jd-cookie-v1-delete-account-req';
|
||||
export * from './kami-api-jd-cookie-v1-delete-invalid-res';
|
||||
export * from './kami-api-jd-cookie-v1-export-jd-order-req';
|
||||
export * from './kami-api-jd-cookie-v1-get-account-req';
|
||||
export * from './kami-api-jd-cookie-v1-get-account-res';
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
/* tslint:disable */
|
||||
|
||||
/**
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document:
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface KamiApiJdCookieV1CookieDeleteResult {
|
||||
/**
|
||||
* Cookie ID
|
||||
*/
|
||||
cookieId?: string;
|
||||
/**
|
||||
* 是否删除成功
|
||||
*/
|
||||
success?: boolean;
|
||||
/**
|
||||
* 删除结果信息
|
||||
*/
|
||||
message?: string;
|
||||
}
|
||||
@@ -56,6 +56,7 @@ export interface KamiApiJdCookieV1CookieHistoryInfo {
|
||||
}
|
||||
|
||||
export enum KamiApiJdCookieV1CookieHistoryInfoChangeTypeEnum {
|
||||
BatchDelete = 'batch delete',
|
||||
Create = 'create',
|
||||
Delete = 'delete',
|
||||
Fail = 'fail',
|
||||
|
||||
@@ -32,6 +32,7 @@ export interface KamiApiJdCookieV1CookieHistoryReq {
|
||||
}
|
||||
|
||||
export enum KamiApiJdCookieV1CookieHistoryReqChangeTypeEnum {
|
||||
BatchDelete = 'batch delete',
|
||||
Create = 'create',
|
||||
Delete = 'delete',
|
||||
Fail = 'fail',
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/* tslint:disable */
|
||||
|
||||
/**
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document:
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { KamiApiJdCookieV1CookieDeleteResult } from './kami-api-jd-cookie-v1-cookie-delete-result';
|
||||
|
||||
export interface KamiApiJdCookieV1DeleteInvalidRes {
|
||||
/**
|
||||
* 删除的Cookie数量
|
||||
*/
|
||||
deletedCount?: number;
|
||||
/**
|
||||
* 成功删除的Cookie ID列表
|
||||
*/
|
||||
successIds?: Array<string>;
|
||||
/**
|
||||
* 删除失败的数量
|
||||
*/
|
||||
failedCount?: number;
|
||||
/**
|
||||
* 删除结果详情
|
||||
*/
|
||||
results?: Array<KamiApiJdCookieV1CookieDeleteResult>;
|
||||
}
|
||||
@@ -45,6 +45,7 @@ export interface KamiApiJdCookieV1JdOrderHistoryInfo {
|
||||
|
||||
export enum KamiApiJdCookieV1JdOrderHistoryInfoChangeTypeEnum {
|
||||
Bind = 'bind',
|
||||
Callback = 'callback',
|
||||
Create = 'create',
|
||||
Expire = 'expire',
|
||||
Invalid = 'invalid',
|
||||
|
||||
@@ -45,6 +45,7 @@ export interface KamiApiJdCookieV1OrderHistoryInfo {
|
||||
|
||||
export enum KamiApiJdCookieV1OrderHistoryInfoChangeTypeEnum {
|
||||
Bind = 'bind',
|
||||
Callback = 'callback',
|
||||
CkFailed = 'ck_failed',
|
||||
Create = 'create',
|
||||
Expire = 'expire',
|
||||
|
||||
@@ -69,6 +69,18 @@
|
||||
</template>
|
||||
批量添加Cookie
|
||||
</a-button>
|
||||
<a-button
|
||||
type="outline"
|
||||
status="danger"
|
||||
size="small"
|
||||
:loading="deleteInvalidLoading"
|
||||
@click="handleDeleteInvalidCookies"
|
||||
>
|
||||
<template #icon>
|
||||
<icon-delete />
|
||||
</template>
|
||||
删除所有失效Cookie
|
||||
</a-button>
|
||||
</a-space>
|
||||
</a-row>
|
||||
<a-table
|
||||
@@ -167,18 +179,22 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
import { Message, Modal } from '@arco-design/web-vue';
|
||||
import type { TableColumnData } from '@arco-design/web-vue';
|
||||
import useLoading from '@/hooks/loading';
|
||||
import { Pagination } from '@/types/global';
|
||||
import { jdCookieClient } from '@/api';
|
||||
import type { KamiApiJdCookieV1CookieAccountInfo } from '@/api/generated';
|
||||
import type {
|
||||
KamiApiJdCookieV1CookieAccountInfo,
|
||||
KamiApiJdCookieV1DeleteInvalidRes
|
||||
} from '@/api/generated';
|
||||
import CookieModal from './components/cookie-modal.vue';
|
||||
import CookieDetail from './components/cookie-detail.vue';
|
||||
import CookieHistoryDrawer from './components/cookie-history-drawer.vue';
|
||||
import BatchImportModal from './components/batch-import-modal.vue';
|
||||
|
||||
const { loading, setLoading } = useLoading(true);
|
||||
const deleteInvalidLoading = ref(false);
|
||||
|
||||
// 分页配置
|
||||
const basePagination: Pagination = {
|
||||
@@ -385,6 +401,70 @@ const handleBatchAddSuccess = (): void => {
|
||||
search();
|
||||
};
|
||||
|
||||
// 删除所有失效Cookie
|
||||
const handleDeleteInvalidCookies = async (): Promise<void> => {
|
||||
// 显示确认对话框
|
||||
const confirmed = await new Promise<boolean>(resolve => {
|
||||
const modal = Modal.confirm({
|
||||
title: '确认删除',
|
||||
content: '确认要删除所有失效的Cookie吗?此操作不可恢复。',
|
||||
okText: '确认删除',
|
||||
cancelText: '取消',
|
||||
okButtonProps: {
|
||||
status: 'danger'
|
||||
},
|
||||
onOk: () => {
|
||||
resolve(true);
|
||||
return new Promise(okResolve => {
|
||||
setTimeout(() => okResolve(true), 0);
|
||||
});
|
||||
},
|
||||
onCancel: () => {
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if (!confirmed) {
|
||||
return;
|
||||
}
|
||||
|
||||
deleteInvalidLoading.value = true;
|
||||
try {
|
||||
const response =
|
||||
await jdCookieClient.apiJdCookieAccountDeleteInvalidDelete();
|
||||
const result = response.data;
|
||||
|
||||
// 显示详细的成功信息
|
||||
if (result.deletedCount && result.deletedCount > 0) {
|
||||
Message.success(
|
||||
`成功删除 ${result.deletedCount} 个失效Cookie${result.failedCount ? `,${result.failedCount} 个删除失败` : ''}`
|
||||
);
|
||||
|
||||
// 如果有删除失败的详情,可以在控制台查看
|
||||
if (result.failedCount && result.results) {
|
||||
console.group('删除失效Cookie详情:');
|
||||
result.results.forEach((item, index) => {
|
||||
if (!item.success) {
|
||||
console.warn(`${index + 1}. ${item.cookieId}: ${item.message}`);
|
||||
}
|
||||
});
|
||||
console.groupEnd();
|
||||
}
|
||||
} else {
|
||||
Message.info('没有找到失效的Cookie');
|
||||
}
|
||||
|
||||
// 刷新列表
|
||||
search();
|
||||
} catch (error) {
|
||||
console.error('删除失效Cookie失败:', error);
|
||||
Message.error('删除失效Cookie失败,请稍后重试');
|
||||
} finally {
|
||||
deleteInvalidLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
search();
|
||||
});
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
placeholder="请选择状态"
|
||||
allow-clear
|
||||
>
|
||||
<a-option :value="0">初始化</a-option>
|
||||
<a-option :value="1">待支付</a-option>
|
||||
<a-option :value="2">已支付</a-option>
|
||||
<a-option :value="3">已过期</a-option>
|
||||
@@ -83,7 +84,8 @@
|
||||
@page-size-change="onPageSizeChange"
|
||||
>
|
||||
<template #status="{ record }">
|
||||
<a-tag v-if="record.status === 1" color="orange">待支付</a-tag>
|
||||
<a-tag v-if="record.status === 0" color="blue">初始化</a-tag>
|
||||
<a-tag v-else-if="record.status === 1" color="orange">待支付</a-tag>
|
||||
<a-tag v-else-if="record.status === 2" color="green">已支付</a-tag>
|
||||
<a-tag v-else-if="record.status === 3" color="red">已过期</a-tag>
|
||||
<a-tag v-else-if="record.status === 4" color="gray">已取消</a-tag>
|
||||
|
||||
Reference in New Issue
Block a user