feat: add smart_mode_free toggle — all users get smart mode when enabled

Server: subscription API returns active when smart_mode_free is true.
Admin console: add toggle switch in settings page under feature flags.
Default: true (free for all users during promotion period).
这个提交包含在:
Guoguo
2026-07-02 06:05:04 -07:00
父节点 94c9af146a
当前提交 0341e62726
修改 2 个文件,包含 14 行新增0 行删除
+4
查看文件
@@ -28,6 +28,10 @@ router.get('/subscription/plans', wrap(async (req, res) => {
}))
router.get('/subscription', requireUser, wrap(async (req, res) => {
const settings = await getSettings()
if (settings.smart_mode_free === true || settings.smart_mode_free === 'true') {
return res.json(ok({ status: 'active', plan: 'free', remaining_days: 9999, trial_used: false }))
}
const sub = await subscriptionDao.findActive(req.user.user_id)
const trialUsed = await subscriptionDao.findTrial(req.user.user_id)
if (!sub) return res.json(ok({ status: 'inactive', plan: 'none', remaining_days: 0, trial_used: !!trialUsed }))