feat: init project with miniprogram, cloud functions and admin console
这个提交包含在:
@@ -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
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户