🐛 fix(api): Fix type error in API request and add return URL parameter

This commit is contained in:
web@ppanel 2025-02-21 12:59:23 +07:00
parent 4418c47f4f
commit ee286dd629
23 changed files with 71 additions and 72 deletions

View File

@ -1,76 +1,70 @@
<a name="readme-top"></a>
# Changelog
# [1.0.0-beta.12](https://github.com/perfect-panel/ppanel-web/compare/v1.0.0-beta.11...v1.0.0-beta.12) (2025-02-18)
### 🐛 Bug Fixes
* More bugs ([2d88a3a](https://github.com/perfect-panel/ppanel-web/commit/2d88a3a))
- More bugs ([2d88a3a](https://github.com/perfect-panel/ppanel-web/commit/2d88a3a))
# [1.0.0-beta.11](https://github.com/perfect-panel/ppanel-web/compare/v1.0.0-beta.10...v1.0.0-beta.11) (2025-02-16)
### 🐛 Bug Fixes
* **email**: Update platform configuration handling to use current ref for consistency ([c90175b](https://github.com/perfect-panel/ppanel-web/commit/c90175b))
- **email**: Update platform configuration handling to use current ref for consistency ([c90175b](https://github.com/perfect-panel/ppanel-web/commit/c90175b))
# [1.0.0-beta.10](https://github.com/perfect-panel/ppanel-web/compare/v1.0.0-beta.9...v1.0.0-beta.10) (2025-02-16)
### 🐛 Bug Fixes
* **subscribe**: Update forms to include refetch functionality and improve toast messages ([fc55e95](https://github.com/perfect-panel/ppanel-web/commit/fc55e95))
- **subscribe**: Update forms to include refetch functionality and improve toast messages ([fc55e95](https://github.com/perfect-panel/ppanel-web/commit/fc55e95))
# [1.0.0-beta.9](https://github.com/perfect-panel/ppanel-web/compare/v1.0.0-beta.8...v1.0.0-beta.9) (2025-02-15)
### 🐛 Bug Fixes
* **register**: Adjust user email verification logic to handle domain suffix checks correctly ([686aa2d](https://github.com/perfect-panel/ppanel-web/commit/686aa2d))
- **register**: Adjust user email verification logic to handle domain suffix checks correctly ([686aa2d](https://github.com/perfect-panel/ppanel-web/commit/686aa2d))
# [1.0.0-beta.8](https://github.com/perfect-panel/ppanel-web/compare/v1.0.0-beta.7...v1.0.0-beta.8) (2025-02-15)
### ✨ Features
* **accounts**: Update third-party account binding and unbinding ([1841552](https://github.com/perfect-panel/ppanel-web/commit/1841552))
* **auth-control**: Adding phone number labels to mobile verification configurations in multiple languages ([046740f](https://github.com/perfect-panel/ppanel-web/commit/046740f))
* **auth-control**: Update general ([3883646](https://github.com/perfect-panel/ppanel-web/commit/3883646))
* **auth**: Add type parameter to SendCode and update related API typings ([4198871](https://github.com/perfect-panel/ppanel-web/commit/4198871))
* **auth**: Refactor mobile authentication config to support whitelist functionality ([c761ec7](https://github.com/perfect-panel/ppanel-web/commit/c761ec7))
* **device**: Modify IMEI to device identifier support ([e3f9ef6](https://github.com/perfect-panel/ppanel-web/commit/e3f9ef6))
* **imei**: Add IMEI related internationalization support and menu items ([13c3337](https://github.com/perfect-panel/ppanel-web/commit/13c3337))
* **locales**: Add kick offline confirmation and success messages in multiple languages ([5db5343](https://github.com/perfect-panel/ppanel-web/commit/5db5343))
* **locales**: Update 'sms' to 'mobile' in authentication methods across multiple languages ([fea2171](https://github.com/perfect-panel/ppanel-web/commit/fea2171))
* **log**: Add message log retrieval functionality and update related typings ([1c0ecae](https://github.com/perfect-panel/ppanel-web/commit/1c0ecae))
* **profile**: Update localization strings and enhance third-party account binding ([2d1effb](https://github.com/perfect-panel/ppanel-web/commit/2d1effb))
* **release**: Extend supported platforms for Docker images, closes [#9](https://github.com/perfect-panel/ppanel-web/issues/9) ([e3a31eb](https://github.com/perfect-panel/ppanel-web/commit/e3a31eb))
* **subscription**: Add delete user subscription functionality ([1fc3a10](https://github.com/perfect-panel/ppanel-web/commit/1fc3a10))
* **ui**: Update input components and enhance card minimum width for better layout ([8a02310](https://github.com/perfect-panel/ppanel-web/commit/8a02310))
* **user**: Add user Detail ([3a3d223](https://github.com/perfect-panel/ppanel-web/commit/3a3d223))
* **user**: Add User Detail ([fdaf11b](https://github.com/perfect-panel/ppanel-web/commit/fdaf11b))
- **accounts**: Update third-party account binding and unbinding ([1841552](https://github.com/perfect-panel/ppanel-web/commit/1841552))
- **auth-control**: Adding phone number labels to mobile verification configurations in multiple languages ([046740f](https://github.com/perfect-panel/ppanel-web/commit/046740f))
- **auth-control**: Update general ([3883646](https://github.com/perfect-panel/ppanel-web/commit/3883646))
- **auth**: Add type parameter to SendCode and update related API typings ([4198871](https://github.com/perfect-panel/ppanel-web/commit/4198871))
- **auth**: Refactor mobile authentication config to support whitelist functionality ([c761ec7](https://github.com/perfect-panel/ppanel-web/commit/c761ec7))
- **device**: Modify IMEI to device identifier support ([e3f9ef6](https://github.com/perfect-panel/ppanel-web/commit/e3f9ef6))
- **imei**: Add IMEI related internationalization support and menu items ([13c3337](https://github.com/perfect-panel/ppanel-web/commit/13c3337))
- **locales**: Add kick offline confirmation and success messages in multiple languages ([5db5343](https://github.com/perfect-panel/ppanel-web/commit/5db5343))
- **locales**: Update 'sms' to 'mobile' in authentication methods across multiple languages ([fea2171](https://github.com/perfect-panel/ppanel-web/commit/fea2171))
- **log**: Add message log retrieval functionality and update related typings ([1c0ecae](https://github.com/perfect-panel/ppanel-web/commit/1c0ecae))
- **profile**: Update localization strings and enhance third-party account binding ([2d1effb](https://github.com/perfect-panel/ppanel-web/commit/2d1effb))
- **release**: Extend supported platforms for Docker images, closes [#9](https://github.com/perfect-panel/ppanel-web/issues/9) ([e3a31eb](https://github.com/perfect-panel/ppanel-web/commit/e3a31eb))
- **subscription**: Add delete user subscription functionality ([1fc3a10](https://github.com/perfect-panel/ppanel-web/commit/1fc3a10))
- **ui**: Update input components and enhance card minimum width for better layout ([8a02310](https://github.com/perfect-panel/ppanel-web/commit/8a02310))
- **user**: Add user Detail ([3a3d223](https://github.com/perfect-panel/ppanel-web/commit/3a3d223))
- **user**: Add User Detail ([fdaf11b](https://github.com/perfect-panel/ppanel-web/commit/fdaf11b))
### 🐛 Bug Fixes
* **auth-control**: Fix citation error for platform values ([c940f3c](https://github.com/perfect-panel/ppanel-web/commit/c940f3c))
* **auth-control**: Fix citation error for platform values ([28813d2](https://github.com/perfect-panel/ppanel-web/commit/28813d2))
* **auth-control**: Rename phone_variable to phone_number in mobile verification configuration ([e5455aa](https://github.com/perfect-panel/ppanel-web/commit/e5455aa))
* **auth**: Update authentication configuration and localization strings ([47f2c58](https://github.com/perfect-panel/ppanel-web/commit/47f2c58))
* **locales**: Update expiration time description from minutes to seconds in multiple languages ([5bac933](https://github.com/perfect-panel/ppanel-web/commit/5bac933))
* **notify**: Ensure user info is updated after notification settings submission ([9bc3a94](https://github.com/perfect-panel/ppanel-web/commit/9bc3a94))
* **notify**: Set default values for notification settings to false ([3652819](https://github.com/perfect-panel/ppanel-web/commit/3652819))
* **third-party-accounts**: Remove mobile display logic from third-party accounts component ([b4946f7](https://github.com/perfect-panel/ppanel-web/commit/b4946f7))
* **third-party-accounts**: Update redirect property name in binding response handling ([012e83a](https://github.com/perfect-panel/ppanel-web/commit/012e83a))
* **user**: Refactor user form validation and reset password fields ([6733fc2](https://github.com/perfect-panel/ppanel-web/commit/6733fc2))
* **user**: Update locales ([4e7d249](https://github.com/perfect-panel/ppanel-web/commit/4e7d249))
* **user**: Update notification and verify code settings ([574b043](https://github.com/perfect-panel/ppanel-web/commit/574b043))
- **auth-control**: Fix citation error for platform values ([c940f3c](https://github.com/perfect-panel/ppanel-web/commit/c940f3c))
- **auth-control**: Fix citation error for platform values ([28813d2](https://github.com/perfect-panel/ppanel-web/commit/28813d2))
- **auth-control**: Rename phone_variable to phone_number in mobile verification configuration ([e5455aa](https://github.com/perfect-panel/ppanel-web/commit/e5455aa))
- **auth**: Update authentication configuration and localization strings ([47f2c58](https://github.com/perfect-panel/ppanel-web/commit/47f2c58))
- **locales**: Update expiration time description from minutes to seconds in multiple languages ([5bac933](https://github.com/perfect-panel/ppanel-web/commit/5bac933))
- **notify**: Ensure user info is updated after notification settings submission ([9bc3a94](https://github.com/perfect-panel/ppanel-web/commit/9bc3a94))
- **notify**: Set default values for notification settings to false ([3652819](https://github.com/perfect-panel/ppanel-web/commit/3652819))
- **third-party-accounts**: Remove mobile display logic from third-party accounts component ([b4946f7](https://github.com/perfect-panel/ppanel-web/commit/b4946f7))
- **third-party-accounts**: Update redirect property name in binding response handling ([012e83a](https://github.com/perfect-panel/ppanel-web/commit/012e83a))
- **user**: Refactor user form validation and reset password fields ([6733fc2](https://github.com/perfect-panel/ppanel-web/commit/6733fc2))
- **user**: Update locales ([4e7d249](https://github.com/perfect-panel/ppanel-web/commit/4e7d249))
- **user**: Update notification and verify code settings ([574b043](https://github.com/perfect-panel/ppanel-web/commit/574b043))
### 💄 Styles
* **dashboard**: Enhance card components with full height and improved empty state handling ([7e1d551](https://github.com/perfect-panel/ppanel-web/commit/7e1d551))
- **dashboard**: Enhance card components with full height and improved empty state handling ([7e1d551](https://github.com/perfect-panel/ppanel-web/commit/7e1d551))
<a name="readme-top"></a>

View File

@ -23,12 +23,12 @@ export default function Page() {
},
});
async function updateConfig(key: keyof API.UpdataAuthMethodConfigRequest, value: unknown) {
async function updateConfig(key: keyof API.UpdateAuthMethodConfigRequest, value: unknown) {
try {
await updateAuthMethodConfig({
...data,
[key]: value,
} as API.UpdataAuthMethodConfigRequest);
} as API.UpdateAuthMethodConfigRequest);
toast.success(t('saveSuccess'));
refetch();
} catch (error) {

View File

@ -21,12 +21,12 @@ export default function Page() {
},
});
async function updateConfig(key: keyof API.UpdataAuthMethodConfigRequest, value: unknown) {
async function updateConfig(key: keyof API.UpdateAuthMethodConfigRequest, value: unknown) {
try {
await updateAuthMethodConfig({
...data,
[key]: value,
} as API.UpdataAuthMethodConfigRequest);
} as API.UpdateAuthMethodConfigRequest);
toast.success(t('saveSuccess'));
refetch();
} catch (error) {

View File

@ -48,7 +48,7 @@ export default function Page() {
await updateAuthMethodConfig({
...ref.current,
[key]: value,
} as API.UpdataAuthMethodConfigRequest);
} as API.UpdateAuthMethodConfigRequest);
toast.success(t('saveSuccess'));
refetch();
} catch (error) {

View File

@ -22,12 +22,12 @@ export default function Page() {
},
});
async function updateConfig(key: keyof API.UpdataAuthMethodConfigRequest, value: unknown) {
async function updateConfig(key: keyof API.UpdateAuthMethodConfigRequest, value: unknown) {
try {
await updateAuthMethodConfig({
...data,
[key]: value,
} as API.UpdataAuthMethodConfigRequest);
} as API.UpdateAuthMethodConfigRequest);
toast.success(t('saveSuccess'));
refetch();
} catch (error) {

View File

@ -22,12 +22,12 @@ export default function Page() {
},
});
async function updateConfig(key: keyof API.UpdataAuthMethodConfigRequest, value: unknown) {
async function updateConfig(key: keyof API.UpdateAuthMethodConfigRequest, value: unknown) {
try {
await updateAuthMethodConfig({
...data,
[key]: value,
} as API.UpdataAuthMethodConfigRequest);
} as API.UpdateAuthMethodConfigRequest);
toast.success(t('saveSuccess'));
refetch();
} catch (error) {

View File

@ -22,12 +22,12 @@ export default function Page() {
},
});
async function updateConfig(key: keyof API.UpdataAuthMethodConfigRequest, value: unknown) {
async function updateConfig(key: keyof API.UpdateAuthMethodConfigRequest, value: unknown) {
try {
await updateAuthMethodConfig({
...data,
[key]: value,
} as API.UpdataAuthMethodConfigRequest);
} as API.UpdateAuthMethodConfigRequest);
toast.success(t('saveSuccess'));
refetch();
} catch (error) {

View File

@ -61,7 +61,7 @@ export default function Page() {
await updateAuthMethodConfig({
...data,
[key]: value,
} as API.UpdataAuthMethodConfigRequest);
} as API.UpdateAuthMethodConfigRequest);
toast.success(t('updateSuccess'));
refetch();
} catch (error) {

View File

@ -22,12 +22,12 @@ export default function Page() {
},
});
async function updateConfig(key: keyof API.UpdataAuthMethodConfigRequest, value: unknown) {
async function updateConfig(key: keyof API.UpdateAuthMethodConfigRequest, value: unknown) {
try {
await updateAuthMethodConfig({
...data,
[key]: value,
} as API.UpdataAuthMethodConfigRequest);
} as API.UpdateAuthMethodConfigRequest);
toast.success(t('saveSuccess'));
refetch();
} catch (error) {

View File

@ -143,7 +143,7 @@ export function SubscriptionDetail({
header: 'ID',
},
{
accessorKey: 'imei',
accessorKey: 'identifier',
header: 'IMEI',
},
{
@ -182,7 +182,7 @@ export function SubscriptionDetail({
}}
actions={{
render: (row) => {
if (!row.imei) return [];
if (!row.identifier) return [];
return [
<ConfirmButton
key='offline'

View File

@ -19,7 +19,7 @@ export async function getAuthMethodConfig(
/** Update auth method config PUT /v1/admin/auth-method/config */
export async function updateAuthMethodConfig(
body: API.UpdataAuthMethodConfigRequest,
body: API.UpdateAuthMethodConfigRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: API.AuthMethodConfig }>('/v1/admin/auth-method/config', {

View File

@ -1,5 +1,5 @@
// @ts-ignore
// API 更新时间:
// API 唯一标识:
import * as announcement from './announcement';

View File

@ -1177,13 +1177,6 @@ declare namespace API {
security_config: SecurityConfig;
};
type UpdataAuthMethodConfigRequest = {
id: number;
method: string;
config: Record<string, any>;
enabled: boolean;
};
type UpdateAlipayF2fRequest = {
id: number;
name: string;
@ -1230,6 +1223,13 @@ declare namespace API {
application_id: number;
};
type UpdateAuthMethodConfigRequest = {
id: number;
method: string;
config: Record<string, any>;
enabled: boolean;
};
type UpdateCouponRequest = {
id: number;
name: string;
@ -1440,7 +1440,7 @@ declare namespace API {
type UserDevice = {
id: number;
ip: string;
imei: string;
identifier: string;
user_agent: string;
online: boolean;
enabled: boolean;

View File

@ -1,5 +1,5 @@
// @ts-ignore
// API 更新时间:
// API 唯一标识:
import * as auth from './auth';

View File

@ -628,7 +628,7 @@ declare namespace API {
type UserDevice = {
id: number;
ip: string;
imei: string;
identifier: string;
user_agent: string;
online: boolean;
enabled: boolean;

View File

@ -50,7 +50,7 @@ export default function Page() {
enabled: !!orderNo && data?.status === 1,
queryKey: ['checkoutOrder', orderNo],
queryFn: async () => {
const { data } = await checkoutOrder({ orderNo: orderNo! });
const { data } = await checkoutOrder({ orderNo: orderNo!, returnUrl: window.location.href });
return data?.data;
},
});

View File

@ -71,6 +71,7 @@ export default function Purchase({ subscribe, setSubscribe }: Readonly<PurchaseP
if (orderNo) {
const { data } = await checkoutOrder({
orderNo,
returnUrl: window.location.href,
});
const type = data.data?.type;
const checkout_url = data.data?.checkout_url;

View File

@ -135,6 +135,7 @@ export default function Recharge(props: Readonly<ButtonProps>) {
if (orderNo) {
const { data } = await checkoutOrder({
orderNo,
returnUrl: window.location.href,
});
const type = data.data?.type;
const checkout_url = data.data?.checkout_url;

View File

@ -79,6 +79,7 @@ export default function Renewal({ id, subscribe }: Readonly<RenewalProps>) {
if (orderNo) {
const { data } = await checkoutOrder({
orderNo,
returnUrl: window.location.href,
});
const type = data.data?.type;
const checkout_url = data.data?.checkout_url;

View File

@ -86,6 +86,7 @@ export default function ResetTraffic({ id, replacement }: Readonly<ResetTrafficP
if (orderNo) {
const { data } = await checkoutOrder({
orderNo,
returnUrl: window.location.href,
});
const type = data.data?.type;
const checkout_url = data.data?.checkout_url;

View File

@ -1,5 +1,5 @@
// @ts-ignore
// API 更新时间:
// API 唯一标识:
import * as auth from './auth';

View File

@ -628,7 +628,7 @@ declare namespace API {
type UserDevice = {
id: number;
ip: string;
imei: string;
identifier: string;
user_agent: string;
online: boolean;
enabled: boolean;

View File

@ -91,6 +91,7 @@ declare namespace API {
type CheckoutOrderRequest = {
orderNo: string;
returnUrl?: string;
};
type CheckoutOrderResponse = {
@ -828,7 +829,7 @@ declare namespace API {
type UserDevice = {
id: number;
ip: string;
imei: string;
identifier: string;
user_agent: string;
online: boolean;
enabled: boolean;