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-get-res.ts
|
||||||
models/kami-api-card-redeem-jd-v1-account-list-req.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-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-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-create-req.ts
|
||||||
models/kami-api-channel-v2-entrance-delete-req.ts
|
models/kami-api-channel-v2-entrance-delete-req.ts
|
||||||
models/kami-api-channel-v2-entrance-list-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-apple-recharge-info.ts
|
||||||
models/kami-internal-model-entity-v1-card-redeem-account-group.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-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-history.ts
|
||||||
models/kami-internal-model-entity-v1-card-redeem-order-info.ts
|
models/kami-internal-model-entity-v1-card-redeem-order-info.ts
|
||||||
models/kami-internal-model-entity-v1-merchant-hidden-record.ts
|
models/kami-internal-model-entity-v1-merchant-hidden-record.ts
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ import type { KamiApiCardRedeemJdV1AccountGetRes } from '../models';
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import type { KamiApiCardRedeemJdV1AccountListRes } from '../models';
|
import type { KamiApiCardRedeemJdV1AccountListRes } from '../models';
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
import type { KamiApiCardRedeemJdV1AccountStatusReq } from '../models';
|
||||||
|
// @ts-ignore
|
||||||
import type { KamiApiCardRedeemJdV1AccountUpdateReq } from '../models';
|
import type { KamiApiCardRedeemJdV1AccountUpdateReq } from '../models';
|
||||||
/**
|
/**
|
||||||
* CkApi - axios parameter creator
|
* CkApi - axios parameter creator
|
||||||
@@ -52,53 +54,6 @@ import type { KamiApiCardRedeemJdV1AccountUpdateReq } from '../models';
|
|||||||
*/
|
*/
|
||||||
export const CkApiAxiosParamCreator = function (configuration?: Configuration) {
|
export const CkApiAxiosParamCreator = function (configuration?: Configuration) {
|
||||||
return {
|
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
|
* @summary 添加京东ck
|
||||||
@@ -194,6 +149,53 @@ export const CkApiAxiosParamCreator = function (configuration?: Configuration) {
|
|||||||
options: localVarRequestOptions
|
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列表
|
* @summary 获取京东ck列表
|
||||||
@@ -249,6 +251,54 @@ export const CkApiAxiosParamCreator = function (configuration?: Configuration) {
|
|||||||
options: localVarRequestOptions
|
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
|
* @summary 更新京东ck
|
||||||
@@ -307,40 +357,6 @@ export const CkApiAxiosParamCreator = function (configuration?: Configuration) {
|
|||||||
export const CkApiFp = function (configuration?: Configuration) {
|
export const CkApiFp = function (configuration?: Configuration) {
|
||||||
const localVarAxiosParamCreator = CkApiAxiosParamCreator(configuration);
|
const localVarAxiosParamCreator = CkApiAxiosParamCreator(configuration);
|
||||||
return {
|
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
|
* @summary 添加京东ck
|
||||||
@@ -403,6 +419,40 @@ export const CkApiFp = function (configuration?: Configuration) {
|
|||||||
configuration
|
configuration
|
||||||
)(axios, localVarOperationServerBasePath || basePath);
|
)(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列表
|
* @summary 获取京东ck列表
|
||||||
@@ -440,6 +490,37 @@ export const CkApiFp = function (configuration?: Configuration) {
|
|||||||
configuration
|
configuration
|
||||||
)(axios, localVarOperationServerBasePath || basePath);
|
)(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
|
* @summary 更新京东ck
|
||||||
@@ -485,21 +566,6 @@ export const CkApiFactory = function (
|
|||||||
) {
|
) {
|
||||||
const localVarFp = CkApiFp(configuration);
|
const localVarFp = CkApiFp(configuration);
|
||||||
return {
|
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
|
* @summary 添加京东ck
|
||||||
@@ -533,6 +599,21 @@ export const CkApiFactory = function (
|
|||||||
.apiCookieInfoJdAccountDeleteDelete(id, options)
|
.apiCookieInfoJdAccountDeleteDelete(id, options)
|
||||||
.then(request => request(axios, basePath));
|
.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列表
|
* @summary 获取京东ck列表
|
||||||
@@ -550,6 +631,24 @@ export const CkApiFactory = function (
|
|||||||
.apiCookieInfoJdAccountListGet(current, pageSize, options)
|
.apiCookieInfoJdAccountListGet(current, pageSize, options)
|
||||||
.then(request => request(axios, basePath));
|
.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
|
* @summary 更新京东ck
|
||||||
@@ -578,23 +677,6 @@ export const CkApiFactory = function (
|
|||||||
* @extends {BaseAPI}
|
* @extends {BaseAPI}
|
||||||
*/
|
*/
|
||||||
export class CkApi 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
|
* @summary 添加京东ck
|
||||||
@@ -632,6 +714,23 @@ export class CkApi extends BaseAPI {
|
|||||||
.then(request => request(this.axios, this.basePath));
|
.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列表
|
* @summary 获取京东ck列表
|
||||||
@@ -651,6 +750,26 @@ export class CkApi extends BaseAPI {
|
|||||||
.then(request => request(this.axios, this.basePath));
|
.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
|
* @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-get-res';
|
||||||
export * from './kami-api-card-redeem-jd-v1-account-list-req';
|
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-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-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-create-req';
|
||||||
export * from './kami-api-channel-v2-entrance-delete-req';
|
export * from './kami-api-channel-v2-entrance-delete-req';
|
||||||
export * from './kami-api-channel-v2-entrance-list-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-apple-recharge-info';
|
||||||
export * from './kami-internal-model-entity-v1-card-redeem-account-group';
|
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-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-history';
|
||||||
export * from './kami-internal-model-entity-v1-card-redeem-order-info';
|
export * from './kami-internal-model-entity-v1-card-redeem-order-info';
|
||||||
export * from './kami-internal-model-entity-v1-merchant-hidden-record';
|
export * from './kami-internal-model-entity-v1-merchant-hidden-record';
|
||||||
|
|||||||
@@ -36,10 +36,17 @@ export interface KamiApiCardRedeemJdV1AccountAddReq {
|
|||||||
* @memberof KamiApiCardRedeemJdV1AccountAddReq
|
* @memberof KamiApiCardRedeemJdV1AccountAddReq
|
||||||
*/
|
*/
|
||||||
status: KamiApiCardRedeemJdV1AccountAddReqStatusEnum;
|
status: KamiApiCardRedeemJdV1AccountAddReqStatusEnum;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
* @type {string}
|
||||||
|
* @memberof KamiApiCardRedeemJdV1AccountAddReq
|
||||||
|
*/
|
||||||
|
notes?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const KamiApiCardRedeemJdV1AccountAddReqStatusEnum = {
|
export const KamiApiCardRedeemJdV1AccountAddReqStatusEnum = {
|
||||||
Jd: 'jd'
|
Disable: 'disable',
|
||||||
|
Normal: 'normal'
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type KamiApiCardRedeemJdV1AccountAddReqStatusEnum =
|
export type KamiApiCardRedeemJdV1AccountAddReqStatusEnum =
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
@@ -43,11 +43,11 @@ export interface KamiApiCardRedeemJdV1AccountGetRes {
|
|||||||
*/
|
*/
|
||||||
notes?: string;
|
notes?: string;
|
||||||
/**
|
/**
|
||||||
*
|
* 状态
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof KamiApiCardRedeemJdV1AccountGetRes
|
* @memberof KamiApiCardRedeemJdV1AccountGetRes
|
||||||
*/
|
*/
|
||||||
status?: string;
|
status?: KamiApiCardRedeemJdV1AccountGetResStatusEnum;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
@@ -73,3 +73,11 @@ export interface KamiApiCardRedeemJdV1AccountGetRes {
|
|||||||
*/
|
*/
|
||||||
deletedAt?: string;
|
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
|
// May contain unused imports in some cases
|
||||||
// @ts-ignore
|
// @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;
|
total?: number;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @type {Array<KamiInternalModelEntityV1CardRedeemCookieInfo>}
|
* @type {Array<KamiApiCardRedeemJdV1CookieInfo>}
|
||||||
* @memberof KamiApiCardRedeemJdV1AccountListRes
|
* @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
|
* @memberof KamiApiCardRedeemJdV1AccountUpdateReq
|
||||||
*/
|
*/
|
||||||
status: KamiApiCardRedeemJdV1AccountUpdateReqStatusEnum;
|
status: KamiApiCardRedeemJdV1AccountUpdateReqStatusEnum;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
* @type {string}
|
||||||
|
* @memberof KamiApiCardRedeemJdV1AccountUpdateReq
|
||||||
|
*/
|
||||||
|
notes?: string;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {number}
|
||||||
@@ -45,7 +51,8 @@ export interface KamiApiCardRedeemJdV1AccountUpdateReq {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const KamiApiCardRedeemJdV1AccountUpdateReqStatusEnum = {
|
export const KamiApiCardRedeemJdV1AccountUpdateReqStatusEnum = {
|
||||||
Jd: 'jd'
|
Disable: 'disable',
|
||||||
|
Normal: 'normal'
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type KamiApiCardRedeemJdV1AccountUpdateReqStatusEnum =
|
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 axios from 'axios';
|
||||||
import { Configuration, DefaultApi } from './generated';
|
import { Configuration, DefaultApi, CkApi } from './generated';
|
||||||
|
|
||||||
export const apiClient = new DefaultApi(new Configuration(), '', axios);
|
export const apiClient = new DefaultApi(new Configuration(), '', axios);
|
||||||
|
|
||||||
|
export const apiCkClient = new CkApi(new Configuration(), '', axios);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
draggable
|
draggable
|
||||||
@cancel="handleCancel"
|
@cancel="handleCancel"
|
||||||
>
|
>
|
||||||
<template #title>{{ props.id === '' ? '新增' : '编辑' }}Cookie</template>
|
<template #title>{{ isNaN(props.id) ? '新增' : '编辑' }}Cookie</template>
|
||||||
<a-form ref="formDataRef" :model="formData">
|
<a-form ref="formDataRef" :model="formData">
|
||||||
<a-form-item field="name" label="名称" required>
|
<a-form-item field="name" label="名称" required>
|
||||||
<a-input v-model="formData.name" />
|
<a-input v-model="formData.name" />
|
||||||
@@ -22,76 +22,25 @@
|
|||||||
/>
|
/>
|
||||||
</a-space>
|
</a-space>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item
|
<a-form-item field="status" label="状态">
|
||||||
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-switch
|
<a-switch
|
||||||
v-model="formData.status"
|
v-model="formData.status"
|
||||||
:checked-value="1"
|
:checked-value="KamiApiCardRedeemJdV1AccountAddReqStatusEnum.Normal"
|
||||||
:unchecked-value="0"
|
:unchecked-value="
|
||||||
|
KamiApiCardRedeemJdV1AccountAddReqStatusEnum.Disable
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item field="groupId" label="分组">
|
<a-form-item field="notes" label="备注">
|
||||||
<a-select
|
<a-textarea v-model="formData.notes" />
|
||||||
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>
|
</a-form-item>
|
||||||
</a-form>
|
</a-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<!-- <a-button
|
|
||||||
v-if="props.id === ''"
|
|
||||||
type="secondary"
|
|
||||||
status="warning"
|
|
||||||
:loading="renderData.loading"
|
|
||||||
@click="checkCookie"
|
|
||||||
>
|
|
||||||
检测Cookie
|
|
||||||
</a-button> -->
|
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-button @click="handleCancel">取消</a-button>
|
<a-button @click="handleCancel">取消</a-button>
|
||||||
<a-button type="primary" :loading="loading" @click="handleOk">
|
<a-button type="primary" :loading="loading" @click="handleOk">
|
||||||
确定
|
确定
|
||||||
</a-button>
|
</a-button>
|
||||||
<!-- <a-button
|
|
||||||
type="primary"
|
|
||||||
:loading="loading"
|
|
||||||
:disabled="!renderData.cookieStatus && props.id === ''"
|
|
||||||
@click="handleOk"
|
|
||||||
>
|
|
||||||
确定
|
|
||||||
</a-button> -->
|
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
@@ -102,18 +51,13 @@ import useLoading from '@/hooks/loading';
|
|||||||
import { FormInstance } from '@arco-design/web-vue';
|
import { FormInstance } from '@arco-design/web-vue';
|
||||||
import { ref, PropType, watch, reactive } from 'vue';
|
import { ref, PropType, watch, reactive } from 'vue';
|
||||||
import { isNull } from '@/utils/is.ts';
|
import { isNull } from '@/utils/is.ts';
|
||||||
import { apiClient } from '@/api/index.ts';
|
import { apiCkClient } from '@/api/index.ts';
|
||||||
import {
|
import { KamiApiCardRedeemJdV1AccountAddReqStatusEnum } from '@/api/generated/index.ts';
|
||||||
addWalmartCard,
|
import type {
|
||||||
detectCookie,
|
KamiApiCardRedeemJdV1AccountAddReq,
|
||||||
updateWalmartCard
|
KamiApiCardRedeemJdV1CookieInfo
|
||||||
} from '@/api/card-walmart-account';
|
|
||||||
import { notification } from './component.tsx';
|
|
||||||
import {
|
|
||||||
KamiApiCardInfoWalmartV1AccountCreateReq,
|
|
||||||
KamiApiCardInfoWalmartV1AccountListRecord
|
|
||||||
} from '@/api/generated/index.ts';
|
} from '@/api/generated/index.ts';
|
||||||
import type { KamiInternalModelEntityV1CardRedeemAccountGroup } from '@/api/generated/index.ts';
|
import { isNaN } from 'lodash';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
visible: {
|
visible: {
|
||||||
@@ -121,29 +65,24 @@ const props = defineProps({
|
|||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
id: {
|
id: {
|
||||||
type: String,
|
type: Number,
|
||||||
default: ''
|
default: null
|
||||||
},
|
},
|
||||||
account: {
|
account: {
|
||||||
type: Object as PropType<
|
type: Object as PropType<Required<KamiApiCardRedeemJdV1CookieInfo>>,
|
||||||
Required<KamiApiCardInfoWalmartV1AccountListRecord>
|
|
||||||
>,
|
|
||||||
default: null
|
default: null
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const generateFormData = () => {
|
const generateFormData = () => {
|
||||||
return {
|
return {
|
||||||
status: 1,
|
name: '',
|
||||||
maxAmountLimit: 0,
|
|
||||||
maxCountLimit: 0,
|
|
||||||
cookie: '',
|
cookie: '',
|
||||||
remark: '',
|
notes: '',
|
||||||
name: ''
|
status: KamiApiCardRedeemJdV1AccountAddReqStatusEnum.Normal
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
const formData =
|
const formData = ref<KamiApiCardRedeemJdV1AccountAddReq>(generateFormData());
|
||||||
ref<KamiApiCardInfoWalmartV1AccountCreateReq>(generateFormData());
|
|
||||||
const formDataRef = ref<FormInstance>();
|
const formDataRef = ref<FormInstance>();
|
||||||
|
|
||||||
const { loading, setLoading } = useLoading(false);
|
const { loading, setLoading } = useLoading(false);
|
||||||
@@ -153,7 +92,6 @@ const renderData = reactive<{ cookieStatus: boolean; loading: boolean }>({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['update:visible']);
|
const emit = defineEmits(['update:visible']);
|
||||||
const groupList = ref<KamiInternalModelEntityV1CardRedeemAccountGroup[]>([]);
|
|
||||||
|
|
||||||
const handleOk = () => {
|
const handleOk = () => {
|
||||||
if (formData.value) {
|
if (formData.value) {
|
||||||
@@ -161,10 +99,13 @@ const handleOk = () => {
|
|||||||
if (res) return;
|
if (res) return;
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
if (props.id === '') {
|
if (isNull(props.id)) {
|
||||||
await addWalmartCard(formData.value);
|
await apiCkClient.apiCookieInfoJdAccountAddPost(formData.value);
|
||||||
} else {
|
} else {
|
||||||
await updateWalmartCard({ id: props.id, ...formData.value });
|
await apiCkClient.apiCookieInfoJdAccountUpdatePut({
|
||||||
|
id: props.id,
|
||||||
|
...formData.value
|
||||||
|
});
|
||||||
}
|
}
|
||||||
emit('update:visible', false);
|
emit('update:visible', false);
|
||||||
formData.value = generateFormData();
|
formData.value = generateFormData();
|
||||||
@@ -194,38 +135,6 @@ watch(
|
|||||||
renderData.cookieStatus = false;
|
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>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { batchAdd, downloadWalmartCardData } from '@/api/card-walmart-account';
|
import type { KamiApiCardRedeemJdV1CookieInfo } from '@/api/generated';
|
||||||
import type { KamiApiCardInfoWalmartV1AccountCookieCheckRes } from '@/api/generated';
|
|
||||||
import { getAPIBaseUrl } from '@/api/utils';
|
import { getAPIBaseUrl } from '@/api/utils';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import { getToken, getTokenFrom } from '@/utils/auth';
|
import { getToken, getTokenFrom } from '@/utils/auth';
|
||||||
@@ -153,7 +152,7 @@ export const batchImportModel = defineComponent({
|
|||||||
visible: false
|
visible: false
|
||||||
});
|
});
|
||||||
const { loading, setLoading } = useLoading(false);
|
const { loading, setLoading } = useLoading(false);
|
||||||
const tableData = ref<KamiApiCardInfoWalmartV1AccountCookieCheckRes[]>([]);
|
const tableData = ref<KamiApiCardRedeemJdV1CookieInfo[]>([]);
|
||||||
|
|
||||||
return () => (
|
return () => (
|
||||||
<>
|
<>
|
||||||
@@ -170,7 +169,7 @@ export const batchImportModel = defineComponent({
|
|||||||
v-model:visible={state.visible}
|
v-model:visible={state.visible}
|
||||||
onBeforeOk={async (done: (closed: boolean) => void) => {
|
onBeforeOk={async (done: (closed: boolean) => void) => {
|
||||||
try {
|
try {
|
||||||
await batchAdd({ list: tableData.value });
|
// await batchAdd({ list: tableData.value });
|
||||||
emit('close');
|
emit('close');
|
||||||
Message.success('上传成功');
|
Message.success('上传成功');
|
||||||
done(true);
|
done(true);
|
||||||
@@ -186,7 +185,7 @@ export const batchImportModel = defineComponent({
|
|||||||
<Button
|
<Button
|
||||||
long
|
long
|
||||||
status='warning'
|
status='warning'
|
||||||
onClick={() => downloadWalmartCardData()}
|
// onClick={() => downloadWalmartCardData()}
|
||||||
>
|
>
|
||||||
下载模板
|
下载模板
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -28,14 +28,6 @@
|
|||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</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-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-col>
|
</a-col>
|
||||||
@@ -64,35 +56,21 @@
|
|||||||
v-if="checkTokenFromLogin()"
|
v-if="checkTokenFromLogin()"
|
||||||
type="primary"
|
type="primary"
|
||||||
size="small"
|
size="small"
|
||||||
@click="showAddModel({ id: '', ...generateFormModel() })"
|
@click="showAddModel({ ...generateFormModel() })"
|
||||||
>
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<icon-plus />
|
<icon-plus />
|
||||||
</template>
|
</template>
|
||||||
添加
|
添加
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button @click="download">
|
<!-- <a-button @click="download">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<icon-download />
|
<icon-download />
|
||||||
</template>
|
</template>
|
||||||
导出
|
导出
|
||||||
</a-button>
|
</a-button> -->
|
||||||
<batchImportModel @close="() => search()" />
|
<batchImportModel @close="() => search()" />
|
||||||
</a-space>
|
</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-row>
|
||||||
<a-table
|
<a-table
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
@@ -118,7 +96,11 @@
|
|||||||
:checked-value="1"
|
:checked-value="1"
|
||||||
:unchecked-value="0"
|
:unchecked-value="0"
|
||||||
:beforeChange="
|
:beforeChange="
|
||||||
newValue => updateCurrentStatus(record, newValue)
|
newValue =>
|
||||||
|
updateCurrentStatus(
|
||||||
|
record,
|
||||||
|
newValue as KamiApiCardRedeemJdV1AccountAddReqStatusEnum
|
||||||
|
)
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<a-tag
|
<a-tag
|
||||||
@@ -150,23 +132,6 @@
|
|||||||
</template>
|
</template>
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-tooltip>
|
</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-tooltip content="删除">
|
||||||
<a-button
|
<a-button
|
||||||
size="small"
|
size="small"
|
||||||
@@ -203,20 +168,14 @@ import { checkTokenFromLogin } from '@/utils/auth';
|
|||||||
import { onMounted, reactive, ref, watchEffect } from 'vue';
|
import { onMounted, reactive, ref, watchEffect } from 'vue';
|
||||||
import { Notification, TableColumnData } from '@arco-design/web-vue';
|
import { Notification, TableColumnData } from '@arco-design/web-vue';
|
||||||
import AddModal from './components/add-modal.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 { batchImportModel } from './components/component.tsx';
|
||||||
import {
|
import {
|
||||||
KamiApiCardInfoWalmartV1AccountListRecord,
|
ApiCookieInfoJdAccountListGetPageSizeEnum,
|
||||||
|
KamiApiCardRedeemJdV1AccountAddReqStatusEnum,
|
||||||
|
KamiApiCardRedeemJdV1CookieInfo,
|
||||||
KamiInternalModelEntityV1CardRedeemAccountGroup
|
KamiInternalModelEntityV1CardRedeemAccountGroup
|
||||||
} from '@/api/generated/index.ts';
|
} from '@/api/generated/index.ts';
|
||||||
|
import { apiCkClient } from '@/api/index.ts';
|
||||||
|
|
||||||
const basePagination: Pagination = {
|
const basePagination: Pagination = {
|
||||||
current: 1,
|
current: 1,
|
||||||
@@ -281,91 +240,70 @@ const columns: TableColumnData[] = [
|
|||||||
width: 220
|
width: 220
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
const generateFormModel = () => {
|
const generateFormModel = (): KamiApiCardRedeemJdV1CookieInfo => {
|
||||||
return {
|
return {
|
||||||
remark: '',
|
|
||||||
name: '',
|
name: '',
|
||||||
cookie: '',
|
cookie: ''
|
||||||
nickname: '',
|
|
||||||
maxAmountLimit: 0,
|
|
||||||
status: 1,
|
|
||||||
createdUserName: '',
|
|
||||||
groupId: null
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
const { loading, setLoading } = useLoading(false);
|
const { loading, setLoading } = useLoading(false);
|
||||||
const renderData = ref<KamiApiCardInfoWalmartV1AccountListRecord[]>([]);
|
const renderData = ref<KamiApiCardRedeemJdV1CookieInfo[]>([]);
|
||||||
const formModel = ref(generateFormModel());
|
const formModel = ref(generateFormModel());
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
addModalVisible: false,
|
addModalVisible: false,
|
||||||
deployModalVisible: false,
|
deployModalVisible: false,
|
||||||
accountDetailVisible: false,
|
accountDetailVisible: false,
|
||||||
accountId: '',
|
accountId: null,
|
||||||
account: null
|
account: null
|
||||||
});
|
});
|
||||||
|
|
||||||
const groupList = ref<KamiInternalModelEntityV1CardRedeemAccountGroup[]>([]);
|
const groupList = ref<KamiInternalModelEntityV1CardRedeemAccountGroup[]>([]);
|
||||||
|
|
||||||
const fetchData = async (
|
const fetchData = async () => {
|
||||||
params: WalmartCardParams = { current: 1, pageSize: 50 }
|
setLoading(true);
|
||||||
) => {
|
try {
|
||||||
// setLoading(true);
|
const res = await apiCkClient.apiCookieInfoJdAccountListGet(
|
||||||
// try {
|
pagination.current,
|
||||||
// const res = await apiClient.apiCardInfoWalmartAccountGetListGet(
|
pagination.pageSize as ApiCookieInfoJdAccountListGetPageSizeEnum
|
||||||
// params.current,
|
);
|
||||||
// params.pageSize as ApiCardInfoWalmartAccountGetListGetPageSizeEnum,
|
renderData.value = res.data.list;
|
||||||
// formModel.value.name,
|
pagination.total = res.data.total;
|
||||||
// formModel.value.nickname,
|
} catch (err) {
|
||||||
// formModel.value.cookie,
|
} finally {
|
||||||
// formModel.value.createdUserName,
|
setLoading(false);
|
||||||
// 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 onPageChange = (current: number) => {
|
const onPageChange = (current: number) => {
|
||||||
fetchData({ ...pagination, current });
|
pagination.current = current;
|
||||||
|
fetchData();
|
||||||
};
|
};
|
||||||
const onPageSizeChange = (pageSize: number) => {
|
const onPageSizeChange = (pageSize: number) => {
|
||||||
fetchData({ ...pagination, pageSize });
|
pagination.pageSize = pageSize;
|
||||||
|
fetchData();
|
||||||
};
|
};
|
||||||
const search = () => {
|
const search = () => {
|
||||||
fetchData({
|
fetchData();
|
||||||
...basePagination,
|
|
||||||
...formModel.value
|
|
||||||
} as unknown as WalmartCardParams);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
formModel.value = generateFormModel();
|
formModel.value = generateFormModel();
|
||||||
};
|
};
|
||||||
|
|
||||||
const getAllGroupList = () => {
|
const deleteOne = async (id: number) => {
|
||||||
// apiClient.apiCardInfoWalmartGroupAllListGet().then(res => {
|
|
||||||
// groupList.value = res.data.list;
|
|
||||||
// });
|
|
||||||
};
|
|
||||||
|
|
||||||
const deleteOne = async (id: string) => {
|
|
||||||
try {
|
try {
|
||||||
await deleteWalmartCard({ id });
|
await apiCkClient.apiCookieInfoJdAccountDeleteDelete(id);
|
||||||
} catch {
|
} catch {
|
||||||
Notification.error({
|
Notification.error({
|
||||||
id: 'walmartAccountNotice',
|
id: 'walmartAccountNotice',
|
||||||
content: '删除沃尔玛卡失败',
|
content: '删除京东ck失败',
|
||||||
closable: true
|
closable: true
|
||||||
});
|
});
|
||||||
} finally {
|
} finally {
|
||||||
fetchData({ ...pagination });
|
fetchData();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const showAddModel = (record: walmartCardUpdateRecord) => {
|
const showAddModel = (record: KamiApiCardRedeemJdV1CookieInfo) => {
|
||||||
state.addModalVisible = true;
|
state.addModalVisible = true;
|
||||||
state.accountId = record.id;
|
state.accountId = record.id;
|
||||||
state.account = record;
|
state.account = record;
|
||||||
@@ -373,7 +311,7 @@ const showAddModel = (record: walmartCardUpdateRecord) => {
|
|||||||
state.account.groupId = null;
|
state.account.groupId = null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const showDetailModel = (record: walmartCardUpdateRecord) => {
|
const showDetailModel = (record: KamiApiCardRedeemJdV1CookieInfo) => {
|
||||||
state.accountDetailVisible = true;
|
state.accountDetailVisible = true;
|
||||||
state.accountId = record.id;
|
state.accountId = record.id;
|
||||||
};
|
};
|
||||||
@@ -384,52 +322,28 @@ watchEffect(() => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
const updateCurrentStatus = async (
|
const updateCurrentStatus = async (
|
||||||
record: walmartCardUpdateRecord,
|
record: KamiApiCardRedeemJdV1CookieInfo,
|
||||||
newValue: string | number | boolean
|
newValue: KamiApiCardRedeemJdV1AccountAddReqStatusEnum
|
||||||
) => {
|
) => {
|
||||||
await updateWalmartCardStatus({ id: record.id, status: newValue as number });
|
await apiCkClient.apiCookieInfoJdAccountStatusPut({
|
||||||
record.status = newValue as number;
|
id: record.id,
|
||||||
|
status: newValue
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const statusMapper = (status: number): { text: string; color: string } => {
|
const statusMapper = (
|
||||||
|
status: KamiApiCardRedeemJdV1AccountAddReqStatusEnum
|
||||||
|
): { text: string; color: string } => {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 0:
|
case KamiApiCardRedeemJdV1AccountAddReqStatusEnum.Normal:
|
||||||
return { text: '失效', color: 'red' };
|
|
||||||
case 1:
|
|
||||||
return { text: '正常', color: 'green' };
|
return { text: '正常', color: 'green' };
|
||||||
case 2:
|
case KamiApiCardRedeemJdV1AccountAddReqStatusEnum.Disable:
|
||||||
return { text: '充值过快', color: 'orange' };
|
return { text: '禁用', color: 'red' };
|
||||||
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' };
|
|
||||||
default:
|
default:
|
||||||
return { text: '未知', color: 'gray' };
|
return { text: '未知', color: 'gray' };
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const refreshButton = (record: walmartCardUpdateRecord) => {
|
|
||||||
refreshWalmartCardStatus({ id: record.id }).then(() => {
|
|
||||||
fetchData();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchData();
|
fetchData();
|
||||||
getAllGroupList();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const onChangeRadio = (value: string | number | boolean) => {
|
|
||||||
formModel.value.groupId = value as number;
|
|
||||||
// fetchData();
|
|
||||||
};
|
|
||||||
const download = () => {
|
|
||||||
downloadDataList();
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user