You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
vue-shop-admin-work/models/RoleModel.js

24 lines
931 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

// 导出一个函数这个函数接受数据库对象db和一个回调函数callback作为参数
module.exports = function(db, callback) {
// 用户模型
// 使用db.define方法定义一个模型模型名为RoleModel
db.define("RoleModel", {
// 定义模型的属性
role_id: {type: 'serial', key: true},
// 角色ID自增主键
role_name: String,
// 角色名称,类型为字符串
ps_ids: String,
// 权限ID列表类型为字符串可能以某种方式如逗号分隔存储多个权限ID
ps_ca: String,
// 权限字符串,类型为字符串,可能表示权限的字符串表示形式
role_desc: String
// 角色描述,类型为字符串
}, {
// 定义模型的选项
table: "sp_role"
// 指定模型对应的数据库表名为sp_role
});
// 调用回调函数,传入无参数
return callback();
}