chore: remove all mock/debug code for production release
Miniprogram: - ENV switched to 'prod' (disables __DEV__ flag) - Deleted mock.js and test-ble-frame.js - Removed mockBind/mockPurchase from api.js - Removed all debug UI panels and onMock* handlers from 6 pages - Removed mock purchase fallback in subscribe-plans - Removed SIMPLE PERIPHERAL dev board from BLE scan Server: - Removed /device/mock-bind route - Removed /subscription/mock-purchase route - Removed dev_openid fallback in wechat.js - Removed mockBind() from binding.dao.js - Removed mock fallback in purchase endpoint - NODE_ENV default changed to 'production' Admin: - ENV switched to 'prod' All mock code preserved in 'test' branch for future development use.
这个提交包含在:
@@ -56,23 +56,6 @@ router.post('/device/bind/confirm', requireUser, wrap(async (req, res) => {
|
||||
}))
|
||||
}))
|
||||
|
||||
router.post('/device/mock-bind', requireUser, wrap(async (req, res) => {
|
||||
const config = require('../config')
|
||||
if (config.nodeEnv === 'production') return res.json(fail(2001, 'not available in production'))
|
||||
const deviceId = String(req.body.device_id || '').trim()
|
||||
if (!deviceId) return res.json(fail(2001, 'device_id required'))
|
||||
|
||||
const active = await bindingDao.findActiveByUser(req.user.user_id)
|
||||
if (active) return res.json(fail(2001, '已绑定设备', { device_id: active.device_id }))
|
||||
|
||||
const device = await bindingDao.findDeviceExists(deviceId)
|
||||
if (!device) return res.json(fail(1005, 'DEVICE_NOT_FOUND'))
|
||||
|
||||
await bindingDao.mockBind(req.user.user_id, deviceId)
|
||||
await logDao.write({ user_id: req.user.user_id, action: 'device_bind_confirm', detail: '模拟绑定设备: ' + deviceId, ip: req.ip })
|
||||
res.json(ok({ message: 'success', device_id: deviceId }))
|
||||
}))
|
||||
|
||||
router.post('/device/unbind', requireUser, wrap(async (req, res) => {
|
||||
const deviceId = req.body.device_id || null
|
||||
await bindingDao.unbindByUser(req.user.user_id, deviceId)
|
||||
|
||||
在新工单中引用
屏蔽一个用户