feat: init project with miniprogram, cloud functions and admin console

这个提交包含在:
Guoguo
2026-04-22 21:24:20 +08:00
当前提交 a84e37a6e2
修改 106 个文件,包含 5902 行新增0 行删除
+27
查看文件
@@ -0,0 +1,27 @@
var db = require('./db')
async function writeLog(options) {
try {
await db.insert(
'INSERT INTO operation_logs (operator_type, operator_id, target_type, target_id, action, before_snapshot, after_snapshot, ip_address, user_agent, remark) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',
[
options.operator_type || 2,
options.operator_id || null,
options.target_type || '',
options.target_id || null,
options.action || '',
options.before_snapshot ? JSON.stringify(options.before_snapshot) : null,
options.after_snapshot ? JSON.stringify(options.after_snapshot) : null,
options.ip_address || null,
options.user_agent || null,
options.remark || null
]
)
} catch (e) {
console.error('writeLog failed:', e.message)
}
}
module.exports = {
writeLog: writeLog
}