1
This commit is contained in:
35
api/model/sys_log.js
Normal file
35
api/model/sys_log.js
Normal file
@@ -0,0 +1,35 @@
|
||||
const db = require("../../middleware/db");
|
||||
const Sequelize = require("sequelize");
|
||||
// db日志管理
|
||||
module.exports = sys_log = db.define("sys_log", {
|
||||
table_name: {
|
||||
type: Sequelize.STRING(100),
|
||||
allowNull: false,
|
||||
defaultValue: "",
|
||||
comment: "表名",
|
||||
},
|
||||
operate: {
|
||||
type: Sequelize.STRING(100),
|
||||
allowNull: false,
|
||||
defaultValue: "",
|
||||
comment: "操作",
|
||||
},
|
||||
content: {
|
||||
type: Sequelize.JSON,
|
||||
allowNull: false,
|
||||
defaultValue: "",
|
||||
comment: "内容",
|
||||
set(value) {
|
||||
this.setDataValue("content", { value });
|
||||
},
|
||||
get() {
|
||||
let jsonValue = this.getDataValue("content");
|
||||
if (jsonValue && jsonValue.value !== undefined) {
|
||||
return jsonValue.value;
|
||||
} else {
|
||||
return jsonValue;
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
// sys_log.sync({ force: true });
|
||||
Reference in New Issue
Block a user