Ship signup sheet, subscribe reminders, cover crop, and theme updates.
Wire real WeChat app config, prefer activity cover over posters, and add admin cover cropping for the home banner. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -148,12 +148,24 @@ router.delete('/activity/past/:id', userAuth, requireUserAdmin, (req, res) => {
|
||||
ok(res, { id: removed })
|
||||
})
|
||||
|
||||
router.get('/subscribe/config', (req, res) => {
|
||||
const settings = db.read().settings || {}
|
||||
const tmplId = str(settings.subscribeTmplId)
|
||||
ok(res, {
|
||||
enabled: !!tmplId,
|
||||
tmplIds: tmplId ? [tmplId] : [],
|
||||
notice: '提交即视为同意接收活动提醒'
|
||||
})
|
||||
})
|
||||
|
||||
router.post('/signup', userAuth, (req, res) => {
|
||||
const body = req.body || {}
|
||||
const activityId = str(body.activityId)
|
||||
const name = str(body.name, 20)
|
||||
const phone = str(body.phone)
|
||||
let sourceSharer = str(body.sourceSharer, 64)
|
||||
// accept / reject / ban / filter / none — matches wx.requestSubscribeMessage result values
|
||||
const remindStatus = str(body.remindStatus || 'none', 16) || 'none'
|
||||
if (!activityId || !name || !phone) return fail(res, 400, '请填写姓名和手机号')
|
||||
if (!PHONE_RE.test(phone)) return fail(res, 400, '请填写正确的手机号')
|
||||
if (sourceSharer === req.user.openid) sourceSharer = ''
|
||||
@@ -172,7 +184,10 @@ router.post('/signup', userAuth, (req, res) => {
|
||||
name,
|
||||
phone,
|
||||
company: str(body.company, 40),
|
||||
position: str(body.position, 40),
|
||||
sourceSharer,
|
||||
remindStatus,
|
||||
remindAccepted: remindStatus === 'accept',
|
||||
createdAt: new Date().toISOString(),
|
||||
checkedIn: false,
|
||||
checkedInAt: ''
|
||||
|
||||
Reference in New Issue
Block a user