🐛 fix(config): Bugs
This commit is contained in:
parent
bbc2da05f0
commit
f57e40cd3d
@ -7,7 +7,7 @@ NEXT_PUBLIC_API_URL=https://api.ppanel.dev
|
||||
|
||||
# Default Login User
|
||||
NEXT_PUBLIC_DEFAULT_USER_EMAIL=admin@ppanel.dev
|
||||
NEXT_PUBLIC_DEFAULT_USER_PASSWORD=admin-password
|
||||
NEXT_PUBLIC_DEFAULT_USER_PASSWORD=password
|
||||
|
||||
# Please put in the .env file, otherwise the i18n command will not work
|
||||
# OpenAI API key and proxy URL required for i18n command (optional)
|
||||
|
||||
@ -37,7 +37,7 @@ export default function AlipayF2F() {
|
||||
await updateAlipayF2FPaymentConfig({
|
||||
...data,
|
||||
[key]: value,
|
||||
} as API.PaymentConfig);
|
||||
} as API.UpdateAlipayF2fRequest);
|
||||
toast.success(t('saveSuccess'));
|
||||
refetch();
|
||||
} catch (error) {
|
||||
@ -62,6 +62,23 @@ export default function AlipayF2F() {
|
||||
/>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TableCell>
|
||||
<Label>{t('alipayf2f.sandbox')}</Label>
|
||||
<p className='text-muted-foreground text-xs'>{t('alipayf2f.sandboxDescription')}</p>
|
||||
</TableCell>
|
||||
<TableCell className='text-right'>
|
||||
<Switch
|
||||
checked={data?.config.sandbox}
|
||||
onCheckedChange={(checked) => {
|
||||
updateConfig('config', {
|
||||
...data?.config,
|
||||
sandbox: checked,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TableCell>
|
||||
<Label>{t('showName')}</Label>
|
||||
|
||||
@ -5,7 +5,9 @@
|
||||
"invoiceName": "Custom Product Name",
|
||||
"invoiceNameDescription": "Will be displayed on Alipay bill",
|
||||
"privateKey": "Alipay Private Key",
|
||||
"publicKey": "Alipay Public Key"
|
||||
"publicKey": "Alipay Public Key",
|
||||
"sandbox": "Sandbox Mode",
|
||||
"sandboxDescription": "Enable sandbox mode to test payments"
|
||||
},
|
||||
"enable": "Enable",
|
||||
"enableDescription": "Enable this payment method",
|
||||
|
||||
@ -5,7 +5,9 @@
|
||||
"invoiceName": "自定义产品名称",
|
||||
"invoiceNameDescription": "将显示在支付宝账单中",
|
||||
"privateKey": "支付宝私钥",
|
||||
"publicKey": "支付宝公钥"
|
||||
"publicKey": "支付宝公钥",
|
||||
"sandbox": "沙箱模式",
|
||||
"sandboxDescription": "启用沙箱模式以测试支付"
|
||||
},
|
||||
"enable": "启用",
|
||||
"enableDescription": "启用此支付方式",
|
||||
|
||||
@ -12,7 +12,7 @@ export async function getAlipayF2FPaymentConfig(options?: { [key: string]: any }
|
||||
|
||||
/** Update alipay f2f payment config PUT /v1/admin/payment/alipay_f2f */
|
||||
export async function updateAlipayF2FPaymentConfig(
|
||||
body: API.PaymentConfig,
|
||||
body: API.UpdateAlipayF2fRequest,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.Response & { data?: any }>('/v1/admin/payment/alipay_f2f', {
|
||||
@ -46,7 +46,7 @@ export async function getEpayPaymentConfig(options?: { [key: string]: any }) {
|
||||
|
||||
/** Update epay payment config PUT /v1/admin/payment/epay */
|
||||
export async function updateEpayPaymentConfig(
|
||||
body: API.PaymentConfig,
|
||||
body: API.UpdateEpayRequest,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.Response & { data?: any }>('/v1/admin/payment/epay', {
|
||||
@ -69,7 +69,7 @@ export async function getStripeAlipayPaymentConfig(options?: { [key: string]: an
|
||||
|
||||
/** Update stripe alipay payment config PUT /v1/admin/payment/stripe_alipay */
|
||||
export async function updateStripeAlipayPaymentConfig(
|
||||
body: API.PaymentConfig,
|
||||
body: API.UpdateStripeRequest,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.Response & { data?: any }>('/v1/admin/payment/stripe_alipay', {
|
||||
@ -95,7 +95,7 @@ export async function getStripeWeChatPayPaymentConfig(options?: { [key: string]:
|
||||
|
||||
/** Update stripe wechat pay payment config PUT /v1/admin/payment/stripe_wechat_pay */
|
||||
export async function updateStripeWeChatPayPaymentConfig(
|
||||
body: API.PaymentConfig,
|
||||
body: API.UpdateStripeRequest,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.Response & { data?: any }>('/v1/admin/payment/stripe_wechat_pay', {
|
||||
|
||||
63
apps/admin/services/admin/typings.d.ts
vendored
63
apps/admin/services/admin/typings.d.ts
vendored
@ -1,4 +1,12 @@
|
||||
declare namespace API {
|
||||
type AlipayF2FConfig = {
|
||||
app_id: string;
|
||||
private_key: string;
|
||||
public_key: string;
|
||||
invoice_name: string;
|
||||
sandbox: boolean;
|
||||
};
|
||||
|
||||
type Announcement = {
|
||||
id: number;
|
||||
title: string;
|
||||
@ -183,7 +191,6 @@ declare namespace API {
|
||||
type CurrencyConfig = {
|
||||
currency_unit: string;
|
||||
currency_symbol: string;
|
||||
access_key: string;
|
||||
};
|
||||
|
||||
type DeleteAnnouncementRequest = {
|
||||
@ -244,6 +251,12 @@ declare namespace API {
|
||||
expiration_email_template: string;
|
||||
};
|
||||
|
||||
type EpayConfig = {
|
||||
pid: string;
|
||||
url: string;
|
||||
key: string;
|
||||
};
|
||||
|
||||
type Follow = {
|
||||
id: number;
|
||||
ticket_id: number;
|
||||
@ -576,6 +589,8 @@ declare namespace API {
|
||||
sni: string;
|
||||
allow_insecure: boolean;
|
||||
fingerprint: string;
|
||||
reality_server_addr: string;
|
||||
reality_server_port: number;
|
||||
reality_private_key: string;
|
||||
reality_public_key: string;
|
||||
reality_short_id: string;
|
||||
@ -627,6 +642,13 @@ declare namespace API {
|
||||
site_logo: string;
|
||||
};
|
||||
|
||||
type StripeConfig = {
|
||||
public_key: string;
|
||||
secret_key: string;
|
||||
webhook_secret: string;
|
||||
payment: string;
|
||||
};
|
||||
|
||||
type Subscribe = {
|
||||
id: number;
|
||||
name: string;
|
||||
@ -716,6 +738,19 @@ declare namespace API {
|
||||
security_config: SecurityConfig;
|
||||
};
|
||||
|
||||
type UpdateAlipayF2fRequest = {
|
||||
id: number;
|
||||
name: string;
|
||||
mark: string;
|
||||
icon?: string;
|
||||
domain?: string;
|
||||
config: AlipayF2FConfig;
|
||||
fee_mode: number;
|
||||
fee_percent?: number;
|
||||
fee_amount?: number;
|
||||
enable: boolean;
|
||||
};
|
||||
|
||||
type UpdateAnnouncementEnableRequest = {
|
||||
id: number;
|
||||
enable: boolean;
|
||||
@ -759,6 +794,19 @@ declare namespace API {
|
||||
show: boolean;
|
||||
};
|
||||
|
||||
type UpdateEpayRequest = {
|
||||
id: number;
|
||||
name: string;
|
||||
mark: string;
|
||||
icon?: string;
|
||||
domain?: string;
|
||||
config: EpayConfig;
|
||||
fee_mode: number;
|
||||
fee_percent?: number;
|
||||
fee_amount?: number;
|
||||
enable: boolean;
|
||||
};
|
||||
|
||||
type UpdateNodeGroupRequest = {
|
||||
id: number;
|
||||
name: string;
|
||||
@ -787,6 +835,19 @@ declare namespace API {
|
||||
trade_no?: string;
|
||||
};
|
||||
|
||||
type UpdateStripeRequest = {
|
||||
id: number;
|
||||
name: string;
|
||||
mark: string;
|
||||
icon?: string;
|
||||
domain?: string;
|
||||
config: StripeConfig;
|
||||
fee_mode: number;
|
||||
fee_percent?: number;
|
||||
fee_amount?: number;
|
||||
enable: boolean;
|
||||
};
|
||||
|
||||
type UpdateSubscribeGroupRequest = {
|
||||
id: number;
|
||||
name: string;
|
||||
|
||||
3
apps/admin/services/common/typings.d.ts
vendored
3
apps/admin/services/common/typings.d.ts
vendored
@ -57,7 +57,6 @@ declare namespace API {
|
||||
type CurrencyConfig = {
|
||||
currency_unit: string;
|
||||
currency_symbol: string;
|
||||
access_key: string;
|
||||
};
|
||||
|
||||
type Document = {
|
||||
@ -235,6 +234,8 @@ declare namespace API {
|
||||
sni: string;
|
||||
allow_insecure: boolean;
|
||||
fingerprint: string;
|
||||
reality_server_addr: string;
|
||||
reality_server_port: number;
|
||||
reality_private_key: string;
|
||||
reality_public_key: string;
|
||||
reality_short_id: string;
|
||||
|
||||
@ -7,10 +7,9 @@ import { getAuthorization, Logout } from './common';
|
||||
|
||||
async function handleError(response: any) {
|
||||
const code = response.data?.code;
|
||||
if ([40002, 40003, 40004].includes(code)) return Logout();
|
||||
if (response?.config?.skipErrorHandler) return;
|
||||
if (!isBrowser()) return;
|
||||
if ([40002, 40003, 40004].includes(code)) return Logout();
|
||||
|
||||
const t = await getTranslations('common');
|
||||
const message =
|
||||
t(`request.${code}`) !== `request.${code}`
|
||||
|
||||
@ -18,7 +18,7 @@ NEXT_PUBLIC_GITHUB_LINK=https://github.com/perfect-panel/ppanel-user-web
|
||||
|
||||
# Default Login User
|
||||
NEXT_PUBLIC_DEFAULT_USER_EMAIL=admin@ppanel.dev
|
||||
NEXT_PUBLIC_DEFAULT_USER_PASSWORD=admin-password
|
||||
NEXT_PUBLIC_DEFAULT_USER_PASSWORD=password
|
||||
|
||||
# Please put in the .env file, otherwise the i18n command will not work
|
||||
# OpenAI API key and proxy URL required for i18n command (optional)
|
||||
|
||||
3
apps/user/services/common/typings.d.ts
vendored
3
apps/user/services/common/typings.d.ts
vendored
@ -57,7 +57,6 @@ declare namespace API {
|
||||
type CurrencyConfig = {
|
||||
currency_unit: string;
|
||||
currency_symbol: string;
|
||||
access_key: string;
|
||||
};
|
||||
|
||||
type Document = {
|
||||
@ -235,6 +234,8 @@ declare namespace API {
|
||||
sni: string;
|
||||
allow_insecure: boolean;
|
||||
fingerprint: string;
|
||||
reality_server_addr: string;
|
||||
reality_server_port: number;
|
||||
reality_private_key: string;
|
||||
reality_public_key: string;
|
||||
reality_short_id: string;
|
||||
|
||||
3
apps/user/services/user/typings.d.ts
vendored
3
apps/user/services/user/typings.d.ts
vendored
@ -71,7 +71,6 @@ declare namespace API {
|
||||
type CurrencyConfig = {
|
||||
currency_unit: string;
|
||||
currency_symbol: string;
|
||||
access_key: string;
|
||||
};
|
||||
|
||||
type Document = {
|
||||
@ -377,6 +376,8 @@ declare namespace API {
|
||||
sni: string;
|
||||
allow_insecure: boolean;
|
||||
fingerprint: string;
|
||||
reality_server_addr: string;
|
||||
reality_server_port: number;
|
||||
reality_private_key: string;
|
||||
reality_public_key: string;
|
||||
reality_short_id: string;
|
||||
|
||||
@ -7,9 +7,9 @@ import { getAuthorization, Logout } from './common';
|
||||
|
||||
async function handleError(response: any) {
|
||||
const code = response.data?.code;
|
||||
if ([40002, 40003, 40004].includes(code)) return Logout();
|
||||
if (response?.config?.skipErrorHandler) return;
|
||||
if (!isBrowser()) return;
|
||||
if ([40002, 40003, 40004].includes(code)) return Logout();
|
||||
|
||||
const t = await getTranslations('common');
|
||||
const message =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user