Files
gitlab-instance-0a899031_di…/app/lib/course-payment.ts
2026-03-23 22:59:42 -05:00

20 lines
572 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 课程解锁 - 校验登录态 + VIP/api/vip/check
* 与 join 报名支付分离,课程解锁用 VIP 状态
*/
/** 前 2 章试看(暂时关闭,全部需 VIP 解锁) */
export function isFreeTrial(_moduleIndex: number, _lessonIndex: number): boolean {
return false;
}
/** 章节是否可观看(需传入 vip 状态,来自 useAuthAndVip 或 /api/vip/check */
export function canWatchLesson(
moduleIndex: number,
lessonIndex: number,
vip: boolean
): boolean {
if (isFreeTrial(moduleIndex, lessonIndex)) return true;
return vip;
}