mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-20 09:16:37 +08:00
feat: 未配置在线支付时,限制用户输入金额 (close #74)
This commit is contained in:
parent
05beade3ad
commit
608c945ae6
@ -38,6 +38,7 @@ func GetStatus(c *gin.Context) {
|
|||||||
"enable_drawing": common.DrawingEnabled,
|
"enable_drawing": common.DrawingEnabled,
|
||||||
"enable_data_export": common.DataExportEnabled,
|
"enable_data_export": common.DataExportEnabled,
|
||||||
"data_export_default_time": common.DataExportDefaultTime,
|
"data_export_default_time": common.DataExportDefaultTime,
|
||||||
|
"enable_online_topup": common.PayAddress != "" && common.EpayId != "" && common.EpayKey != "",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
|
@ -54,6 +54,10 @@ const TopUp = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const preTopUp = async (payment) => {
|
const preTopUp = async (payment) => {
|
||||||
|
if (!enableOnlineTopUp) {
|
||||||
|
showError('管理员未开启在线充值!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (amount === 0) {
|
if (amount === 0) {
|
||||||
await getAmount();
|
await getAmount();
|
||||||
}
|
}
|
||||||
@ -128,6 +132,9 @@ const TopUp = () => {
|
|||||||
if (status.top_up_link) {
|
if (status.top_up_link) {
|
||||||
setTopUpLink(status.top_up_link);
|
setTopUpLink(status.top_up_link);
|
||||||
}
|
}
|
||||||
|
if (status.enable_online_top_up) {
|
||||||
|
setEnableOnlineTopUp(status.enable_online_topup);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
getUserQuota().then();
|
getUserQuota().then();
|
||||||
}, []);
|
}, []);
|
||||||
@ -229,6 +236,7 @@ const TopUp = () => {
|
|||||||
</Divider>
|
</Divider>
|
||||||
<Form>
|
<Form>
|
||||||
<Form.Input
|
<Form.Input
|
||||||
|
disabled={!enableOnlineTopUp}
|
||||||
field={'redemptionCount'}
|
field={'redemptionCount'}
|
||||||
label={'实付金额:' + renderAmount()}
|
label={'实付金额:' + renderAmount()}
|
||||||
placeholder='充值数量'
|
placeholder='充值数量'
|
||||||
|
Loading…
Reference in New Issue
Block a user