新增账号,超管体系

This commit is contained in:
eafonyang
2026-06-18 17:37:08 +08:00
parent 481261b334
commit 476da9b459
27 changed files with 1439 additions and 84 deletions
+57
View File
@@ -0,0 +1,57 @@
const { DataTypes } = require('sequelize');
const sequelize = require('../config/database');
const DashboardUser = sequelize.define('DashboardUser', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
comment: '主键',
},
username: {
type: DataTypes.STRING(64),
allowNull: false,
unique: true,
comment: '登录账号',
},
password_hash: {
type: DataTypes.STRING(255),
allowNull: false,
comment: '密码哈希(bcrypt',
},
is_super_admin: {
type: DataTypes.TINYINT,
allowNull: false,
defaultValue: 0,
comment: '是否超级管理员:1=是',
},
status: {
type: DataTypes.TINYINT,
allowNull: false,
defaultValue: 1,
comment: '状态:1=启用,0=禁用',
},
last_login_at: {
type: DataTypes.DATE,
allowNull: true,
comment: '最近登录时间',
},
create_at: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
comment: '创建时间',
},
update_at: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
comment: '更新时间',
},
}, {
tableName: 'dashboard_user',
comment: 'Dashboard 后台账号',
});
module.exports = DashboardUser;
+2 -1
View File
@@ -2,5 +2,6 @@ const Brand = require('./Brand');
const Model = require('./Model');
const Ota = require('./Ota');
const ShareCodeLog = require('./ShareCodeLog');
const DashboardUser = require('./DashboardUser');
module.exports = { Brand, Model, Ota, ShareCodeLog };
module.exports = { Brand, Model, Ota, ShareCodeLog, DashboardUser };