Skip to content

Commit 6e17030

Browse files
committed
feat: 新增接口返回值及前端显示
1 parent 8ff6546 commit 6e17030

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

apps/server/src/modules/web/config/controllers/config.controller.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,7 @@ export class ConfigController extends BaseController {
3737
@BuildFileUrl(["**.logo", "**.icon"])
3838
@Public()
3939
async getConfig() {
40-
const fullConfig = await this.websiteService.getConfig();
41-
42-
return {
43-
webinfo: fullConfig.webinfo,
44-
copyright: fullConfig.copyright,
45-
statistics: fullConfig.statistics,
46-
};
40+
return await this.websiteService.getConfig();
4741
}
4842

4943
/**

apps/web/app/profile/personal-rights/recharge-center.vue

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ interface PaymentMethod {
2323
icon: string;
2424
}
2525
26+
const appStore = useAppStore();
27+
2628
// 组合式函数
2729
const { t } = useI18n();
2830
const toast = useMessage();
@@ -293,15 +295,20 @@ definePageMeta({
293295
t("web-personal-rights.rechargeCenter.agreement")
294296
}}</span>
295297
<UButton variant="link" class="p-0" @click="toServiceTerms">
296-
《{{ t("web-personal-rights.rechargeCenter.payment") }}》
298+
《{{
299+
appStore.siteConfig?.agreement.paymentTitle ||
300+
t("web-personal-rights.rechargeCenter.payment")
301+
}}》
297302
</UButton>
298303
</div>
299304
<div class="flex items-center gap-4">
300-
<div class="text-xl font-bold">¥ {{ currentOption?.sellPrice }}</div>
305+
<div v-if="currentOption" class="text-xl font-bold">
306+
¥ {{ currentOption?.sellPrice }}
307+
</div>
301308
<UButton
302309
color="primary"
303310
size="lg"
304-
:disabled="!rechargeCenterInfo?.rechargeStatus"
311+
:disabled="!rechargeCenterInfo?.rechargeRule.length"
305312
@click="handleRecharge"
306313
>
307314
{{ t("web-personal-rights.rechargeCenter.immediatelyPurchase") }}

apps/web/models/global.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ export interface SiteConfig {
88
copyright: WebsiteCopyright;
99
/** 统计信息 */
1010
statistics: WebsiteStatistics;
11+
/** 协议 */
12+
agreement: Agreement;
13+
}
14+
15+
export interface Agreement {
16+
paymentTitle: string;
17+
paymentContent: string;
18+
privacyTitle: string;
19+
privacyContent: string;
20+
serviceTitle: string;
21+
serviceContent: string;
22+
updateAt: string;
1123
}
1224

1325
/** 协议项接口 */

0 commit comments

Comments
 (0)