refactor(api): update JD cookie management and related components
This commit refactors the JD cookie management API and associated components to improve maintainability and consistency. Key changes include: - Updated API client to include `CkApi` for JD cookie operations. - Added new models and updated existing ones for JD cookie management. - Refactored components to use the updated API and models. - Removed unused code and streamlined the logic for adding, updating, and deleting JD cookies.
This commit is contained in:
@@ -206,7 +206,9 @@ models/kami-api-card-redeem-jd-v1-account-get-req.ts
|
||||
models/kami-api-card-redeem-jd-v1-account-get-res.ts
|
||||
models/kami-api-card-redeem-jd-v1-account-list-req.ts
|
||||
models/kami-api-card-redeem-jd-v1-account-list-res.ts
|
||||
models/kami-api-card-redeem-jd-v1-account-status-req.ts
|
||||
models/kami-api-card-redeem-jd-v1-account-update-req.ts
|
||||
models/kami-api-card-redeem-jd-v1-cookie-info.ts
|
||||
models/kami-api-channel-v2-entrance-create-req.ts
|
||||
models/kami-api-channel-v2-entrance-delete-req.ts
|
||||
models/kami-api-channel-v2-entrance-list-req.ts
|
||||
@@ -314,7 +316,6 @@ models/kami-internal-model-entity-v1-card-apple-history-info.ts
|
||||
models/kami-internal-model-entity-v1-card-apple-recharge-info.ts
|
||||
models/kami-internal-model-entity-v1-card-redeem-account-group.ts
|
||||
models/kami-internal-model-entity-v1-card-redeem-account-history.ts
|
||||
models/kami-internal-model-entity-v1-card-redeem-cookie-info.ts
|
||||
models/kami-internal-model-entity-v1-card-redeem-order-history.ts
|
||||
models/kami-internal-model-entity-v1-card-redeem-order-info.ts
|
||||
models/kami-internal-model-entity-v1-merchant-hidden-record.ts
|
||||
|
||||
@@ -45,6 +45,8 @@ import type { KamiApiCardRedeemJdV1AccountGetRes } from '../models';
|
||||
// @ts-ignore
|
||||
import type { KamiApiCardRedeemJdV1AccountListRes } from '../models';
|
||||
// @ts-ignore
|
||||
import type { KamiApiCardRedeemJdV1AccountStatusReq } from '../models';
|
||||
// @ts-ignore
|
||||
import type { KamiApiCardRedeemJdV1AccountUpdateReq } from '../models';
|
||||
/**
|
||||
* CkApi - axios parameter creator
|
||||
@@ -52,53 +54,6 @@ import type { KamiApiCardRedeemJdV1AccountUpdateReq } from '../models';
|
||||
*/
|
||||
export const CkApiAxiosParamCreator = function (configuration?: Configuration) {
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @summary 获取京东ck
|
||||
* @param {number} id
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiCookieInfoIdAccountGetGet: async (
|
||||
id: number,
|
||||
options: RawAxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
// verify required parameter 'id' is not null or undefined
|
||||
assertParamExists('apiCookieInfoIdAccountGetGet', 'id', id);
|
||||
const localVarPath = `/api/cookieInfo/id/account/get`;
|
||||
// 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;
|
||||
|
||||
if (id !== undefined) {
|
||||
localVarQueryParameter['id'] = id;
|
||||
}
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers
|
||||
};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 添加京东ck
|
||||
@@ -194,6 +149,53 @@ export const CkApiAxiosParamCreator = function (configuration?: Configuration) {
|
||||
options: localVarRequestOptions
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取京东ck
|
||||
* @param {number} id
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiCookieInfoJdAccountGetGet: async (
|
||||
id: number,
|
||||
options: RawAxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
// verify required parameter 'id' is not null or undefined
|
||||
assertParamExists('apiCookieInfoJdAccountGetGet', 'id', id);
|
||||
const localVarPath = `/api/cookieInfo/jd/account/get`;
|
||||
// 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;
|
||||
|
||||
if (id !== undefined) {
|
||||
localVarQueryParameter['id'] = id;
|
||||
}
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers
|
||||
};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取京东ck列表
|
||||
@@ -249,6 +251,54 @@ export const CkApiAxiosParamCreator = function (configuration?: Configuration) {
|
||||
options: localVarRequestOptions
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 修改京东ck状态
|
||||
* @param {KamiApiCardRedeemJdV1AccountStatusReq} [kamiApiCardRedeemJdV1AccountStatusReq]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiCookieInfoJdAccountStatusPut: async (
|
||||
kamiApiCardRedeemJdV1AccountStatusReq?: KamiApiCardRedeemJdV1AccountStatusReq,
|
||||
options: RawAxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
const localVarPath = `/api/cookieInfo/jd/account/status`;
|
||||
// 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: 'PUT',
|
||||
...baseOptions,
|
||||
...options
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
localVarHeaderParameter['Content-Type'] = 'application/json';
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers
|
||||
};
|
||||
localVarRequestOptions.data = serializeDataIfNeeded(
|
||||
kamiApiCardRedeemJdV1AccountStatusReq,
|
||||
localVarRequestOptions,
|
||||
configuration
|
||||
);
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 更新京东ck
|
||||
@@ -307,40 +357,6 @@ export const CkApiAxiosParamCreator = function (configuration?: Configuration) {
|
||||
export const CkApiFp = function (configuration?: Configuration) {
|
||||
const localVarAxiosParamCreator = CkApiAxiosParamCreator(configuration);
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @summary 获取京东ck
|
||||
* @param {number} id
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiCookieInfoIdAccountGetGet(
|
||||
id: number,
|
||||
options?: RawAxiosRequestConfig
|
||||
): Promise<
|
||||
(
|
||||
axios?: AxiosInstance,
|
||||
basePath?: string
|
||||
) => AxiosPromise<KamiApiCardRedeemJdV1AccountGetRes>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.apiCookieInfoIdAccountGetGet(
|
||||
id,
|
||||
options
|
||||
);
|
||||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||
const localVarOperationServerBasePath =
|
||||
operationServerMap['CkApi.apiCookieInfoIdAccountGetGet']?.[
|
||||
localVarOperationServerIndex
|
||||
]?.url;
|
||||
return (axios, basePath) =>
|
||||
createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 添加京东ck
|
||||
@@ -403,6 +419,40 @@ export const CkApiFp = function (configuration?: Configuration) {
|
||||
configuration
|
||||
)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取京东ck
|
||||
* @param {number} id
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiCookieInfoJdAccountGetGet(
|
||||
id: number,
|
||||
options?: RawAxiosRequestConfig
|
||||
): Promise<
|
||||
(
|
||||
axios?: AxiosInstance,
|
||||
basePath?: string
|
||||
) => AxiosPromise<KamiApiCardRedeemJdV1AccountGetRes>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.apiCookieInfoJdAccountGetGet(
|
||||
id,
|
||||
options
|
||||
);
|
||||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||
const localVarOperationServerBasePath =
|
||||
operationServerMap['CkApi.apiCookieInfoJdAccountGetGet']?.[
|
||||
localVarOperationServerIndex
|
||||
]?.url;
|
||||
return (axios, basePath) =>
|
||||
createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取京东ck列表
|
||||
@@ -440,6 +490,37 @@ export const CkApiFp = function (configuration?: Configuration) {
|
||||
configuration
|
||||
)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 修改京东ck状态
|
||||
* @param {KamiApiCardRedeemJdV1AccountStatusReq} [kamiApiCardRedeemJdV1AccountStatusReq]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiCookieInfoJdAccountStatusPut(
|
||||
kamiApiCardRedeemJdV1AccountStatusReq?: KamiApiCardRedeemJdV1AccountStatusReq,
|
||||
options?: RawAxiosRequestConfig
|
||||
): Promise<
|
||||
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.apiCookieInfoJdAccountStatusPut(
|
||||
kamiApiCardRedeemJdV1AccountStatusReq,
|
||||
options
|
||||
);
|
||||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||
const localVarOperationServerBasePath =
|
||||
operationServerMap['CkApi.apiCookieInfoJdAccountStatusPut']?.[
|
||||
localVarOperationServerIndex
|
||||
]?.url;
|
||||
return (axios, basePath) =>
|
||||
createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 更新京东ck
|
||||
@@ -485,21 +566,6 @@ export const CkApiFactory = function (
|
||||
) {
|
||||
const localVarFp = CkApiFp(configuration);
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @summary 获取京东ck
|
||||
* @param {number} id
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiCookieInfoIdAccountGetGet(
|
||||
id: number,
|
||||
options?: RawAxiosRequestConfig
|
||||
): AxiosPromise<KamiApiCardRedeemJdV1AccountGetRes> {
|
||||
return localVarFp
|
||||
.apiCookieInfoIdAccountGetGet(id, options)
|
||||
.then(request => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 添加京东ck
|
||||
@@ -533,6 +599,21 @@ export const CkApiFactory = function (
|
||||
.apiCookieInfoJdAccountDeleteDelete(id, options)
|
||||
.then(request => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取京东ck
|
||||
* @param {number} id
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiCookieInfoJdAccountGetGet(
|
||||
id: number,
|
||||
options?: RawAxiosRequestConfig
|
||||
): AxiosPromise<KamiApiCardRedeemJdV1AccountGetRes> {
|
||||
return localVarFp
|
||||
.apiCookieInfoJdAccountGetGet(id, options)
|
||||
.then(request => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取京东ck列表
|
||||
@@ -550,6 +631,24 @@ export const CkApiFactory = function (
|
||||
.apiCookieInfoJdAccountListGet(current, pageSize, options)
|
||||
.then(request => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 修改京东ck状态
|
||||
* @param {KamiApiCardRedeemJdV1AccountStatusReq} [kamiApiCardRedeemJdV1AccountStatusReq]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiCookieInfoJdAccountStatusPut(
|
||||
kamiApiCardRedeemJdV1AccountStatusReq?: KamiApiCardRedeemJdV1AccountStatusReq,
|
||||
options?: RawAxiosRequestConfig
|
||||
): AxiosPromise<object> {
|
||||
return localVarFp
|
||||
.apiCookieInfoJdAccountStatusPut(
|
||||
kamiApiCardRedeemJdV1AccountStatusReq,
|
||||
options
|
||||
)
|
||||
.then(request => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 更新京东ck
|
||||
@@ -578,23 +677,6 @@ export const CkApiFactory = function (
|
||||
* @extends {BaseAPI}
|
||||
*/
|
||||
export class CkApi extends BaseAPI {
|
||||
/**
|
||||
*
|
||||
* @summary 获取京东ck
|
||||
* @param {number} id
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof CkApi
|
||||
*/
|
||||
public apiCookieInfoIdAccountGetGet(
|
||||
id: number,
|
||||
options?: RawAxiosRequestConfig
|
||||
) {
|
||||
return CkApiFp(this.configuration)
|
||||
.apiCookieInfoIdAccountGetGet(id, options)
|
||||
.then(request => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary 添加京东ck
|
||||
@@ -632,6 +714,23 @@ export class CkApi extends BaseAPI {
|
||||
.then(request => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary 获取京东ck
|
||||
* @param {number} id
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof CkApi
|
||||
*/
|
||||
public apiCookieInfoJdAccountGetGet(
|
||||
id: number,
|
||||
options?: RawAxiosRequestConfig
|
||||
) {
|
||||
return CkApiFp(this.configuration)
|
||||
.apiCookieInfoJdAccountGetGet(id, options)
|
||||
.then(request => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary 获取京东ck列表
|
||||
@@ -651,6 +750,26 @@ export class CkApi extends BaseAPI {
|
||||
.then(request => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary 修改京东ck状态
|
||||
* @param {KamiApiCardRedeemJdV1AccountStatusReq} [kamiApiCardRedeemJdV1AccountStatusReq]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof CkApi
|
||||
*/
|
||||
public apiCookieInfoJdAccountStatusPut(
|
||||
kamiApiCardRedeemJdV1AccountStatusReq?: KamiApiCardRedeemJdV1AccountStatusReq,
|
||||
options?: RawAxiosRequestConfig
|
||||
) {
|
||||
return CkApiFp(this.configuration)
|
||||
.apiCookieInfoJdAccountStatusPut(
|
||||
kamiApiCardRedeemJdV1AccountStatusReq,
|
||||
options
|
||||
)
|
||||
.then(request => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary 更新京东ck
|
||||
|
||||
@@ -194,7 +194,9 @@ export * from './kami-api-card-redeem-jd-v1-account-get-req';
|
||||
export * from './kami-api-card-redeem-jd-v1-account-get-res';
|
||||
export * from './kami-api-card-redeem-jd-v1-account-list-req';
|
||||
export * from './kami-api-card-redeem-jd-v1-account-list-res';
|
||||
export * from './kami-api-card-redeem-jd-v1-account-status-req';
|
||||
export * from './kami-api-card-redeem-jd-v1-account-update-req';
|
||||
export * from './kami-api-card-redeem-jd-v1-cookie-info';
|
||||
export * from './kami-api-channel-v2-entrance-create-req';
|
||||
export * from './kami-api-channel-v2-entrance-delete-req';
|
||||
export * from './kami-api-channel-v2-entrance-list-req';
|
||||
@@ -302,7 +304,6 @@ export * from './kami-internal-model-entity-v1-card-apple-history-info';
|
||||
export * from './kami-internal-model-entity-v1-card-apple-recharge-info';
|
||||
export * from './kami-internal-model-entity-v1-card-redeem-account-group';
|
||||
export * from './kami-internal-model-entity-v1-card-redeem-account-history';
|
||||
export * from './kami-internal-model-entity-v1-card-redeem-cookie-info';
|
||||
export * from './kami-internal-model-entity-v1-card-redeem-order-history';
|
||||
export * from './kami-internal-model-entity-v1-card-redeem-order-info';
|
||||
export * from './kami-internal-model-entity-v1-merchant-hidden-record';
|
||||
|
||||
@@ -36,10 +36,17 @@ export interface KamiApiCardRedeemJdV1AccountAddReq {
|
||||
* @memberof KamiApiCardRedeemJdV1AccountAddReq
|
||||
*/
|
||||
status: KamiApiCardRedeemJdV1AccountAddReqStatusEnum;
|
||||
/**
|
||||
* 备注
|
||||
* @type {string}
|
||||
* @memberof KamiApiCardRedeemJdV1AccountAddReq
|
||||
*/
|
||||
notes?: string;
|
||||
}
|
||||
|
||||
export const KamiApiCardRedeemJdV1AccountAddReqStatusEnum = {
|
||||
Jd: 'jd'
|
||||
Disable: 'disable',
|
||||
Normal: 'normal'
|
||||
} as const;
|
||||
|
||||
export type KamiApiCardRedeemJdV1AccountAddReqStatusEnum =
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* tslint:disable */
|
||||
|
||||
/* eslint-disable */
|
||||
/**
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
@@ -43,11 +43,11 @@ export interface KamiApiCardRedeemJdV1AccountGetRes {
|
||||
*/
|
||||
notes?: string;
|
||||
/**
|
||||
*
|
||||
* 状态
|
||||
* @type {string}
|
||||
* @memberof KamiApiCardRedeemJdV1AccountGetRes
|
||||
*/
|
||||
status?: string;
|
||||
status?: KamiApiCardRedeemJdV1AccountGetResStatusEnum;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
@@ -73,3 +73,11 @@ export interface KamiApiCardRedeemJdV1AccountGetRes {
|
||||
*/
|
||||
deletedAt?: string;
|
||||
}
|
||||
|
||||
export const KamiApiCardRedeemJdV1AccountGetResStatusEnum = {
|
||||
Disable: 'disable',
|
||||
Normal: 'normal'
|
||||
} as const;
|
||||
|
||||
export type KamiApiCardRedeemJdV1AccountGetResStatusEnum =
|
||||
(typeof KamiApiCardRedeemJdV1AccountGetResStatusEnum)[keyof typeof KamiApiCardRedeemJdV1AccountGetResStatusEnum];
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { KamiInternalModelEntityV1CardRedeemCookieInfo } from './kami-internal-model-entity-v1-card-redeem-cookie-info';
|
||||
import type { KamiApiCardRedeemJdV1CookieInfo } from './kami-api-card-redeem-jd-v1-cookie-info';
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -30,8 +30,8 @@ export interface KamiApiCardRedeemJdV1AccountListRes {
|
||||
total?: number;
|
||||
/**
|
||||
*
|
||||
* @type {Array<KamiInternalModelEntityV1CardRedeemCookieInfo>}
|
||||
* @type {Array<KamiApiCardRedeemJdV1CookieInfo>}
|
||||
* @memberof KamiApiCardRedeemJdV1AccountListRes
|
||||
*/
|
||||
list?: Array<KamiInternalModelEntityV1CardRedeemCookieInfo>;
|
||||
list?: Array<KamiApiCardRedeemJdV1CookieInfo>;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-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 KamiApiCardRedeemJdV1AccountStatusReq
|
||||
*/
|
||||
export interface KamiApiCardRedeemJdV1AccountStatusReq {
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof KamiApiCardRedeemJdV1AccountStatusReq
|
||||
*/
|
||||
id: number;
|
||||
/**
|
||||
* 状态
|
||||
* @type {string}
|
||||
* @memberof KamiApiCardRedeemJdV1AccountStatusReq
|
||||
*/
|
||||
status: KamiApiCardRedeemJdV1AccountStatusReqStatusEnum;
|
||||
}
|
||||
|
||||
export const KamiApiCardRedeemJdV1AccountStatusReqStatusEnum = {
|
||||
Disable: 'disable',
|
||||
Normal: 'normal'
|
||||
} as const;
|
||||
|
||||
export type KamiApiCardRedeemJdV1AccountStatusReqStatusEnum =
|
||||
(typeof KamiApiCardRedeemJdV1AccountStatusReqStatusEnum)[keyof typeof KamiApiCardRedeemJdV1AccountStatusReqStatusEnum];
|
||||
@@ -36,6 +36,12 @@ export interface KamiApiCardRedeemJdV1AccountUpdateReq {
|
||||
* @memberof KamiApiCardRedeemJdV1AccountUpdateReq
|
||||
*/
|
||||
status: KamiApiCardRedeemJdV1AccountUpdateReqStatusEnum;
|
||||
/**
|
||||
* 备注
|
||||
* @type {string}
|
||||
* @memberof KamiApiCardRedeemJdV1AccountUpdateReq
|
||||
*/
|
||||
notes?: string;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
@@ -45,7 +51,8 @@ export interface KamiApiCardRedeemJdV1AccountUpdateReq {
|
||||
}
|
||||
|
||||
export const KamiApiCardRedeemJdV1AccountUpdateReqStatusEnum = {
|
||||
Jd: 'jd'
|
||||
Disable: 'disable',
|
||||
Normal: 'normal'
|
||||
} as const;
|
||||
|
||||
export type KamiApiCardRedeemJdV1AccountUpdateReqStatusEnum =
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-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 KamiApiCardRedeemJdV1CookieInfo
|
||||
*/
|
||||
export interface KamiApiCardRedeemJdV1CookieInfo {
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof KamiApiCardRedeemJdV1CookieInfo
|
||||
*/
|
||||
id?: number;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof KamiApiCardRedeemJdV1CookieInfo
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof KamiApiCardRedeemJdV1CookieInfo
|
||||
*/
|
||||
cookie?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof KamiApiCardRedeemJdV1CookieInfo
|
||||
*/
|
||||
notes?: string;
|
||||
/**
|
||||
* 状态
|
||||
* @type {string}
|
||||
* @memberof KamiApiCardRedeemJdV1CookieInfo
|
||||
*/
|
||||
status?: KamiApiCardRedeemJdV1CookieInfoStatusEnum;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof KamiApiCardRedeemJdV1CookieInfo
|
||||
*/
|
||||
category?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof KamiApiCardRedeemJdV1CookieInfo
|
||||
*/
|
||||
createdAt?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof KamiApiCardRedeemJdV1CookieInfo
|
||||
*/
|
||||
updatedAt?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof KamiApiCardRedeemJdV1CookieInfo
|
||||
*/
|
||||
deletedAt?: string;
|
||||
}
|
||||
|
||||
export const KamiApiCardRedeemJdV1CookieInfoStatusEnum = {
|
||||
Disable: 'disable',
|
||||
Normal: 'normal'
|
||||
} as const;
|
||||
|
||||
export type KamiApiCardRedeemJdV1CookieInfoStatusEnum =
|
||||
(typeof KamiApiCardRedeemJdV1CookieInfoStatusEnum)[keyof typeof KamiApiCardRedeemJdV1CookieInfoStatusEnum];
|
||||
@@ -1,4 +1,6 @@
|
||||
import axios from 'axios';
|
||||
import { Configuration, DefaultApi } from './generated';
|
||||
import { Configuration, DefaultApi, CkApi } from './generated';
|
||||
|
||||
export const apiClient = new DefaultApi(new Configuration(), '', axios);
|
||||
|
||||
export const apiCkClient = new CkApi(new Configuration(), '', axios);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
draggable
|
||||
@cancel="handleCancel"
|
||||
>
|
||||
<template #title>{{ props.id === '' ? '新增' : '编辑' }}Cookie</template>
|
||||
<template #title>{{ isNaN(props.id) ? '新增' : '编辑' }}Cookie</template>
|
||||
<a-form ref="formDataRef" :model="formData">
|
||||
<a-form-item field="name" label="名称" required>
|
||||
<a-input v-model="formData.name" />
|
||||
@@ -22,76 +22,25 @@
|
||||
/>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
field="maxAmountLimit"
|
||||
label="充值限制(金额)"
|
||||
tooltip="0表示没有限制"
|
||||
required
|
||||
>
|
||||
<a-input-number v-model="formData.maxAmountLimit" />
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
field="maxCountLimit"
|
||||
label="充值限制(次数)"
|
||||
tooltip="0表示没有限制"
|
||||
required
|
||||
>
|
||||
<a-input-number v-model="formData.maxCountLimit" />
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
field="status"
|
||||
label="状态"
|
||||
:disabled="![0, 1].includes(formData.status)"
|
||||
>
|
||||
<a-form-item field="status" label="状态">
|
||||
<a-switch
|
||||
v-model="formData.status"
|
||||
:checked-value="1"
|
||||
:unchecked-value="0"
|
||||
:checked-value="KamiApiCardRedeemJdV1AccountAddReqStatusEnum.Normal"
|
||||
:unchecked-value="
|
||||
KamiApiCardRedeemJdV1AccountAddReqStatusEnum.Disable
|
||||
"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item field="groupId" label="分组">
|
||||
<a-select
|
||||
v-model="formData.groupId"
|
||||
placeholder="请选择分组"
|
||||
:showSearch="true"
|
||||
:filter-option="false"
|
||||
:allowClear="true"
|
||||
>
|
||||
<a-option
|
||||
v-for="(item, index) in groupList"
|
||||
:key="index"
|
||||
:value="item.id"
|
||||
:label="item.name"
|
||||
/>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item field="remark" label="备注">
|
||||
<a-textarea v-model="formData.remark" />
|
||||
<a-form-item field="notes" label="备注">
|
||||
<a-textarea v-model="formData.notes" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
<template #footer>
|
||||
<!-- <a-button
|
||||
v-if="props.id === ''"
|
||||
type="secondary"
|
||||
status="warning"
|
||||
:loading="renderData.loading"
|
||||
@click="checkCookie"
|
||||
>
|
||||
检测Cookie
|
||||
</a-button> -->
|
||||
<a-space>
|
||||
<a-button @click="handleCancel">取消</a-button>
|
||||
<a-button type="primary" :loading="loading" @click="handleOk">
|
||||
确定
|
||||
</a-button>
|
||||
<!-- <a-button
|
||||
type="primary"
|
||||
:loading="loading"
|
||||
:disabled="!renderData.cookieStatus && props.id === ''"
|
||||
@click="handleOk"
|
||||
>
|
||||
确定
|
||||
</a-button> -->
|
||||
</a-space>
|
||||
</template>
|
||||
</a-modal>
|
||||
@@ -102,18 +51,13 @@ import useLoading from '@/hooks/loading';
|
||||
import { FormInstance } from '@arco-design/web-vue';
|
||||
import { ref, PropType, watch, reactive } from 'vue';
|
||||
import { isNull } from '@/utils/is.ts';
|
||||
import { apiClient } from '@/api/index.ts';
|
||||
import {
|
||||
addWalmartCard,
|
||||
detectCookie,
|
||||
updateWalmartCard
|
||||
} from '@/api/card-walmart-account';
|
||||
import { notification } from './component.tsx';
|
||||
import {
|
||||
KamiApiCardInfoWalmartV1AccountCreateReq,
|
||||
KamiApiCardInfoWalmartV1AccountListRecord
|
||||
import { apiCkClient } from '@/api/index.ts';
|
||||
import { KamiApiCardRedeemJdV1AccountAddReqStatusEnum } from '@/api/generated/index.ts';
|
||||
import type {
|
||||
KamiApiCardRedeemJdV1AccountAddReq,
|
||||
KamiApiCardRedeemJdV1CookieInfo
|
||||
} from '@/api/generated/index.ts';
|
||||
import type { KamiInternalModelEntityV1CardRedeemAccountGroup } from '@/api/generated/index.ts';
|
||||
import { isNaN } from 'lodash';
|
||||
|
||||
const props = defineProps({
|
||||
visible: {
|
||||
@@ -121,29 +65,24 @@ const props = defineProps({
|
||||
default: false
|
||||
},
|
||||
id: {
|
||||
type: String,
|
||||
default: ''
|
||||
type: Number,
|
||||
default: null
|
||||
},
|
||||
account: {
|
||||
type: Object as PropType<
|
||||
Required<KamiApiCardInfoWalmartV1AccountListRecord>
|
||||
>,
|
||||
type: Object as PropType<Required<KamiApiCardRedeemJdV1CookieInfo>>,
|
||||
default: null
|
||||
}
|
||||
});
|
||||
|
||||
const generateFormData = () => {
|
||||
return {
|
||||
status: 1,
|
||||
maxAmountLimit: 0,
|
||||
maxCountLimit: 0,
|
||||
name: '',
|
||||
cookie: '',
|
||||
remark: '',
|
||||
name: ''
|
||||
notes: '',
|
||||
status: KamiApiCardRedeemJdV1AccountAddReqStatusEnum.Normal
|
||||
};
|
||||
};
|
||||
const formData =
|
||||
ref<KamiApiCardInfoWalmartV1AccountCreateReq>(generateFormData());
|
||||
const formData = ref<KamiApiCardRedeemJdV1AccountAddReq>(generateFormData());
|
||||
const formDataRef = ref<FormInstance>();
|
||||
|
||||
const { loading, setLoading } = useLoading(false);
|
||||
@@ -153,7 +92,6 @@ const renderData = reactive<{ cookieStatus: boolean; loading: boolean }>({
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:visible']);
|
||||
const groupList = ref<KamiInternalModelEntityV1CardRedeemAccountGroup[]>([]);
|
||||
|
||||
const handleOk = () => {
|
||||
if (formData.value) {
|
||||
@@ -161,10 +99,13 @@ const handleOk = () => {
|
||||
if (res) return;
|
||||
setLoading(true);
|
||||
try {
|
||||
if (props.id === '') {
|
||||
await addWalmartCard(formData.value);
|
||||
if (isNull(props.id)) {
|
||||
await apiCkClient.apiCookieInfoJdAccountAddPost(formData.value);
|
||||
} else {
|
||||
await updateWalmartCard({ id: props.id, ...formData.value });
|
||||
await apiCkClient.apiCookieInfoJdAccountUpdatePut({
|
||||
id: props.id,
|
||||
...formData.value
|
||||
});
|
||||
}
|
||||
emit('update:visible', false);
|
||||
formData.value = generateFormData();
|
||||
@@ -194,38 +135,6 @@ watch(
|
||||
renderData.cookieStatus = false;
|
||||
}
|
||||
);
|
||||
|
||||
const checkCookie = async () => {
|
||||
renderData.loading = false;
|
||||
try {
|
||||
const cookieResp = await detectCookie({
|
||||
cookie: formData.value.cookie.trim()
|
||||
});
|
||||
if (cookieResp.data.isAvailable) {
|
||||
notification(
|
||||
true,
|
||||
cookieResp.data.nickname,
|
||||
cookieResp.data.balance,
|
||||
cookieResp.data.isExist
|
||||
);
|
||||
renderData.cookieStatus = true;
|
||||
if (props.id === '') {
|
||||
renderData.cookieStatus = !cookieResp.data.isExist;
|
||||
}
|
||||
} else {
|
||||
notification(false);
|
||||
}
|
||||
} finally {
|
||||
renderData.loading = false;
|
||||
}
|
||||
};
|
||||
|
||||
const getAllGroupList = () => {
|
||||
apiClient.apiCardInfoWalmartGroupAllListGet().then(res => {
|
||||
groupList.value = res.data.list;
|
||||
});
|
||||
};
|
||||
getAllGroupList();
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { batchAdd, downloadWalmartCardData } from '@/api/card-walmart-account';
|
||||
import type { KamiApiCardInfoWalmartV1AccountCookieCheckRes } from '@/api/generated';
|
||||
import type { KamiApiCardRedeemJdV1CookieInfo } from '@/api/generated';
|
||||
import { getAPIBaseUrl } from '@/api/utils';
|
||||
import useLoading from '@/hooks/loading';
|
||||
import { getToken, getTokenFrom } from '@/utils/auth';
|
||||
@@ -153,7 +152,7 @@ export const batchImportModel = defineComponent({
|
||||
visible: false
|
||||
});
|
||||
const { loading, setLoading } = useLoading(false);
|
||||
const tableData = ref<KamiApiCardInfoWalmartV1AccountCookieCheckRes[]>([]);
|
||||
const tableData = ref<KamiApiCardRedeemJdV1CookieInfo[]>([]);
|
||||
|
||||
return () => (
|
||||
<>
|
||||
@@ -170,7 +169,7 @@ export const batchImportModel = defineComponent({
|
||||
v-model:visible={state.visible}
|
||||
onBeforeOk={async (done: (closed: boolean) => void) => {
|
||||
try {
|
||||
await batchAdd({ list: tableData.value });
|
||||
// await batchAdd({ list: tableData.value });
|
||||
emit('close');
|
||||
Message.success('上传成功');
|
||||
done(true);
|
||||
@@ -186,7 +185,7 @@ export const batchImportModel = defineComponent({
|
||||
<Button
|
||||
long
|
||||
status='warning'
|
||||
onClick={() => downloadWalmartCardData()}
|
||||
// onClick={() => downloadWalmartCardData()}
|
||||
>
|
||||
下载模板
|
||||
</Button>
|
||||
|
||||
@@ -28,14 +28,6 @@
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item field="nickname" label="沃尔玛昵称">
|
||||
<a-input
|
||||
v-model="formModel.nickname"
|
||||
placeholder="请输入账户昵称"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-col>
|
||||
@@ -64,35 +56,21 @@
|
||||
v-if="checkTokenFromLogin()"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="showAddModel({ id: '', ...generateFormModel() })"
|
||||
@click="showAddModel({ ...generateFormModel() })"
|
||||
>
|
||||
<template #icon>
|
||||
<icon-plus />
|
||||
</template>
|
||||
添加
|
||||
</a-button>
|
||||
<a-button @click="download">
|
||||
<!-- <a-button @click="download">
|
||||
<template #icon>
|
||||
<icon-download />
|
||||
</template>
|
||||
导出
|
||||
</a-button>
|
||||
</a-button> -->
|
||||
<batchImportModel @close="() => search()" />
|
||||
</a-space>
|
||||
<a-tabs
|
||||
default-active-key=""
|
||||
type="capsule"
|
||||
:onChange="onChangeRadio"
|
||||
animation
|
||||
>
|
||||
<a-tab-pane key="" title="全部" />
|
||||
<a-tab-pane
|
||||
v-for="item in groupList"
|
||||
:key="item.id"
|
||||
:title="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</a-tabs>
|
||||
</a-row>
|
||||
<a-table
|
||||
:loading="loading"
|
||||
@@ -118,7 +96,11 @@
|
||||
:checked-value="1"
|
||||
:unchecked-value="0"
|
||||
:beforeChange="
|
||||
newValue => updateCurrentStatus(record, newValue)
|
||||
newValue =>
|
||||
updateCurrentStatus(
|
||||
record,
|
||||
newValue as KamiApiCardRedeemJdV1AccountAddReqStatusEnum
|
||||
)
|
||||
"
|
||||
/>
|
||||
<a-tag
|
||||
@@ -150,23 +132,6 @@
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-popconfirm
|
||||
type="warning"
|
||||
content="确认刷新账号状态嘛?"
|
||||
@ok="refreshButton(record)"
|
||||
>
|
||||
<a-tooltip content="刷新">
|
||||
<a-button
|
||||
v-if="record.status === 3"
|
||||
size="small"
|
||||
status="success"
|
||||
>
|
||||
<template #icon>
|
||||
<icon-refresh />
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
</a-popconfirm>
|
||||
<a-tooltip content="删除">
|
||||
<a-button
|
||||
size="small"
|
||||
@@ -203,20 +168,14 @@ import { checkTokenFromLogin } from '@/utils/auth';
|
||||
import { onMounted, reactive, ref, watchEffect } from 'vue';
|
||||
import { Notification, TableColumnData } from '@arco-design/web-vue';
|
||||
import AddModal from './components/add-modal.vue';
|
||||
import summaryCard from './summary.tsx';
|
||||
import {
|
||||
deleteWalmartCard,
|
||||
downloadDataList,
|
||||
refreshWalmartCardStatus,
|
||||
updateWalmartCardStatus,
|
||||
WalmartCardParams,
|
||||
walmartCardUpdateRecord
|
||||
} from '@/api/card-walmart-account';
|
||||
import { batchImportModel } from './components/component.tsx';
|
||||
import {
|
||||
KamiApiCardInfoWalmartV1AccountListRecord,
|
||||
ApiCookieInfoJdAccountListGetPageSizeEnum,
|
||||
KamiApiCardRedeemJdV1AccountAddReqStatusEnum,
|
||||
KamiApiCardRedeemJdV1CookieInfo,
|
||||
KamiInternalModelEntityV1CardRedeemAccountGroup
|
||||
} from '@/api/generated/index.ts';
|
||||
import { apiCkClient } from '@/api/index.ts';
|
||||
|
||||
const basePagination: Pagination = {
|
||||
current: 1,
|
||||
@@ -281,91 +240,70 @@ const columns: TableColumnData[] = [
|
||||
width: 220
|
||||
}
|
||||
];
|
||||
const generateFormModel = () => {
|
||||
const generateFormModel = (): KamiApiCardRedeemJdV1CookieInfo => {
|
||||
return {
|
||||
remark: '',
|
||||
name: '',
|
||||
cookie: '',
|
||||
nickname: '',
|
||||
maxAmountLimit: 0,
|
||||
status: 1,
|
||||
createdUserName: '',
|
||||
groupId: null
|
||||
cookie: ''
|
||||
};
|
||||
};
|
||||
const { loading, setLoading } = useLoading(false);
|
||||
const renderData = ref<KamiApiCardInfoWalmartV1AccountListRecord[]>([]);
|
||||
const renderData = ref<KamiApiCardRedeemJdV1CookieInfo[]>([]);
|
||||
const formModel = ref(generateFormModel());
|
||||
const state = reactive({
|
||||
addModalVisible: false,
|
||||
deployModalVisible: false,
|
||||
accountDetailVisible: false,
|
||||
accountId: '',
|
||||
accountId: null,
|
||||
account: null
|
||||
});
|
||||
|
||||
const groupList = ref<KamiInternalModelEntityV1CardRedeemAccountGroup[]>([]);
|
||||
|
||||
const fetchData = async (
|
||||
params: WalmartCardParams = { current: 1, pageSize: 50 }
|
||||
) => {
|
||||
// setLoading(true);
|
||||
// try {
|
||||
// const res = await apiClient.apiCardInfoWalmartAccountGetListGet(
|
||||
// params.current,
|
||||
// params.pageSize as ApiCardInfoWalmartAccountGetListGetPageSizeEnum,
|
||||
// formModel.value.name,
|
||||
// formModel.value.nickname,
|
||||
// formModel.value.cookie,
|
||||
// formModel.value.createdUserName,
|
||||
// formModel.value.groupId
|
||||
// );
|
||||
// renderData.value = res.data.list;
|
||||
// pagination.current = params.current;
|
||||
// pagination.pageSize = params.pageSize;
|
||||
// pagination.total = res.data.total;
|
||||
// } catch (err) {
|
||||
// } finally {
|
||||
// setLoading(false);
|
||||
// }
|
||||
const fetchData = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const res = await apiCkClient.apiCookieInfoJdAccountListGet(
|
||||
pagination.current,
|
||||
pagination.pageSize as ApiCookieInfoJdAccountListGetPageSizeEnum
|
||||
);
|
||||
renderData.value = res.data.list;
|
||||
pagination.total = res.data.total;
|
||||
} catch (err) {
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
const onPageChange = (current: number) => {
|
||||
fetchData({ ...pagination, current });
|
||||
pagination.current = current;
|
||||
fetchData();
|
||||
};
|
||||
const onPageSizeChange = (pageSize: number) => {
|
||||
fetchData({ ...pagination, pageSize });
|
||||
pagination.pageSize = pageSize;
|
||||
fetchData();
|
||||
};
|
||||
const search = () => {
|
||||
fetchData({
|
||||
...basePagination,
|
||||
...formModel.value
|
||||
} as unknown as WalmartCardParams);
|
||||
fetchData();
|
||||
};
|
||||
|
||||
const reset = () => {
|
||||
formModel.value = generateFormModel();
|
||||
};
|
||||
|
||||
const getAllGroupList = () => {
|
||||
// apiClient.apiCardInfoWalmartGroupAllListGet().then(res => {
|
||||
// groupList.value = res.data.list;
|
||||
// });
|
||||
};
|
||||
|
||||
const deleteOne = async (id: string) => {
|
||||
const deleteOne = async (id: number) => {
|
||||
try {
|
||||
await deleteWalmartCard({ id });
|
||||
await apiCkClient.apiCookieInfoJdAccountDeleteDelete(id);
|
||||
} catch {
|
||||
Notification.error({
|
||||
id: 'walmartAccountNotice',
|
||||
content: '删除沃尔玛卡失败',
|
||||
content: '删除京东ck失败',
|
||||
closable: true
|
||||
});
|
||||
} finally {
|
||||
fetchData({ ...pagination });
|
||||
fetchData();
|
||||
}
|
||||
};
|
||||
|
||||
const showAddModel = (record: walmartCardUpdateRecord) => {
|
||||
const showAddModel = (record: KamiApiCardRedeemJdV1CookieInfo) => {
|
||||
state.addModalVisible = true;
|
||||
state.accountId = record.id;
|
||||
state.account = record;
|
||||
@@ -373,7 +311,7 @@ const showAddModel = (record: walmartCardUpdateRecord) => {
|
||||
state.account.groupId = null;
|
||||
}
|
||||
};
|
||||
const showDetailModel = (record: walmartCardUpdateRecord) => {
|
||||
const showDetailModel = (record: KamiApiCardRedeemJdV1CookieInfo) => {
|
||||
state.accountDetailVisible = true;
|
||||
state.accountId = record.id;
|
||||
};
|
||||
@@ -384,52 +322,28 @@ watchEffect(() => {
|
||||
}
|
||||
});
|
||||
const updateCurrentStatus = async (
|
||||
record: walmartCardUpdateRecord,
|
||||
newValue: string | number | boolean
|
||||
record: KamiApiCardRedeemJdV1CookieInfo,
|
||||
newValue: KamiApiCardRedeemJdV1AccountAddReqStatusEnum
|
||||
) => {
|
||||
await updateWalmartCardStatus({ id: record.id, status: newValue as number });
|
||||
record.status = newValue as number;
|
||||
await apiCkClient.apiCookieInfoJdAccountStatusPut({
|
||||
id: record.id,
|
||||
status: newValue
|
||||
});
|
||||
};
|
||||
|
||||
const statusMapper = (status: number): { text: string; color: string } => {
|
||||
const statusMapper = (
|
||||
status: KamiApiCardRedeemJdV1AccountAddReqStatusEnum
|
||||
): { text: string; color: string } => {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return { text: '失效', color: 'red' };
|
||||
case 1:
|
||||
case KamiApiCardRedeemJdV1AccountAddReqStatusEnum.Normal:
|
||||
return { text: '正常', color: 'green' };
|
||||
case 2:
|
||||
return { text: '充值过快', color: 'orange' };
|
||||
case 3:
|
||||
return { text: '充值限制(用户设置)', color: 'red' };
|
||||
case 4:
|
||||
return { text: '充值限制(其他)', color: 'red' };
|
||||
case 5:
|
||||
return { text: '充值限制(低额)', color: 'red' };
|
||||
case 6:
|
||||
return { text: '充值限制(安全原因)', color: 'red' };
|
||||
case 7:
|
||||
return { text: '充值限制(暂时限制)', color: 'red' };
|
||||
case 8:
|
||||
return { text: '充值限制(平台原因)', color: 'red' };
|
||||
case KamiApiCardRedeemJdV1AccountAddReqStatusEnum.Disable:
|
||||
return { text: '禁用', color: 'red' };
|
||||
default:
|
||||
return { text: '未知', color: 'gray' };
|
||||
}
|
||||
};
|
||||
const refreshButton = (record: walmartCardUpdateRecord) => {
|
||||
refreshWalmartCardStatus({ id: record.id }).then(() => {
|
||||
fetchData();
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
getAllGroupList();
|
||||
});
|
||||
|
||||
const onChangeRadio = (value: string | number | boolean) => {
|
||||
formModel.value.groupId = value as number;
|
||||
// fetchData();
|
||||
};
|
||||
const download = () => {
|
||||
downloadDataList();
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user