feat: add redemption code feature to user dashboard

- Add redemption code input component in dashboard
- Integrate redemption API endpoint
- Add i18n support for Chinese and English
- Display redemption section alongside subscriptions
This commit is contained in:
EUForest
2026-02-06 23:59:31 +08:00
parent 902e5fe59a
commit 1f9b7ea1db
5 changed files with 123 additions and 2 deletions
+18
View File
@@ -268,6 +268,24 @@ export async function updateUserRules(
);
}
/** Redeem Code POST /v1/public/redemption/ */
export async function redeemCode(
body: { code: string },
options?: { [key: string]: any }
) {
return request<API.Response & { data?: { message: string } }>(
`${import.meta.env.VITE_API_PREFIX || ""}/v1/public/redemption/`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
}
);
}
/** Query User Subscribe GET /v1/public/user/subscribe */
export async function queryUserSubscribe(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.QueryUserSubscribeListResponse }>(