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).
这个提交包含在:
@@ -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 }))
|
||||
|
||||
在新工单中引用
屏蔽一个用户