diff --git a/database/install/sys_dict_data1_i18n_zh.sql b/database/install/sys_dict_data1_i18n_zh.sql index ea6b10d3..c44ffe2d 100644 --- a/database/install/sys_dict_data1_i18n_zh.sql +++ b/database/install/sys_dict_data1_i18n_zh.sql @@ -342,13 +342,13 @@ INSERT INTO `sys_dict_data` VALUES (1722, 1722, 'job.errTargetParams', '操作 INSERT INTO `sys_dict_data` VALUES (1723, 1723, 'job.errCronExpression', '操作调度任务【{name}】失败,Cron表达式不正确', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); INSERT INTO `sys_dict_data` VALUES (1724, 1724, 'job.errJobExists', '调度任务新增【{name}】失败,同任务组内有相同任务名称', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); INSERT INTO `sys_dict_data` VALUES (1725, 1725, 'job.statusEq', '变更状态与旧值相等!', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); -INSERT INTO `sys_dict_data` VALUES (1750, 1750, 'role.admin', '超级管理员', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); -INSERT INTO `sys_dict_data` VALUES (1751, 1751, 'role.adminAssign', '管理人员', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); +INSERT INTO `sys_dict_data` VALUES (1750, 1750, 'role.system', '系统', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); +INSERT INTO `sys_dict_data` VALUES (1751, 1751, 'role.admin', '管理人员', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); INSERT INTO `sys_dict_data` VALUES (1752, 1752, 'role.operator', '运维人员', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); INSERT INTO `sys_dict_data` VALUES (1753, 1753, 'role.monitor', '监控人员', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); INSERT INTO `sys_dict_data` VALUES (1754, 1754, 'role.vistor', '普通用户', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); -INSERT INTO `sys_dict_data` VALUES (1755, 1755, 'role.adminRemark', '超级管理员,无法修改删除', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); -INSERT INTO `sys_dict_data` VALUES (1756, 1756, 'role.adminAssignRemark', '管理人员 可以对设备进行任何操作', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); +INSERT INTO `sys_dict_data` VALUES (1755, 1755, 'role.systemRemark', '系统,无法修改删除', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); +INSERT INTO `sys_dict_data` VALUES (1756, 1756, 'role.adminRemark', '管理人员 可以对设备进行任何操作', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); INSERT INTO `sys_dict_data` VALUES (1757, 1757, 'role.operatorRemark', '运维人员 可以从设备读取数据,并对设备进行配置,但是不能对设备进行软件升级操作。', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); INSERT INTO `sys_dict_data` VALUES (1758, 1758, 'role.monitorRemark', '监控人员 只能从设备读取数据,而不能对设备进行任何设置', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); INSERT INTO `sys_dict_data` VALUES (1759, 1759, 'role.vistorRemark', '普通用户 只可看系统相关信息', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); diff --git a/database/install/sys_dict_data2_i18n_en.sql b/database/install/sys_dict_data2_i18n_en.sql index f17be541..87dfd710 100644 --- a/database/install/sys_dict_data2_i18n_en.sql +++ b/database/install/sys_dict_data2_i18n_en.sql @@ -342,13 +342,13 @@ INSERT INTO `sys_dict_data` VALUES (3722, 3722, 'job.errTargetParams', 'Failed t INSERT INTO `sys_dict_data` VALUES (3723, 3723, 'job.errCronExpression', 'Scheduled task [{name}] failed with incorrect Cron expression!', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); INSERT INTO `sys_dict_data` VALUES (3724, 3724, 'job.errJobExists', 'Failed to add a new task [{name}] to a scheduling task, same task name in the same task group', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); INSERT INTO `sys_dict_data` VALUES (3725, 3725, 'job.statusEq', 'The change state is equal to the old value!', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); -INSERT INTO `sys_dict_data` VALUES (3750, 3750, 'role.admin', 'Super Administrator', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); -INSERT INTO `sys_dict_data` VALUES (3751, 3751, 'role.adminAssign', 'Managers', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); +INSERT INTO `sys_dict_data` VALUES (3750, 3750, 'role.system', 'System', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); +INSERT INTO `sys_dict_data` VALUES (3751, 3751, 'role.admin', 'Administrator', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); INSERT INTO `sys_dict_data` VALUES (3752, 3752, 'role.operator', 'Operators', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); INSERT INTO `sys_dict_data` VALUES (3753, 3753, 'role.monitor', 'Monitor', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); INSERT INTO `sys_dict_data` VALUES (3754, 3754, 'role.vistor', 'General Users', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); -INSERT INTO `sys_dict_data` VALUES (3755, 3755, 'role.adminRemark', 'Super Administrator, cannot modify or delete', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); -INSERT INTO `sys_dict_data` VALUES (3756, 3756, 'role.adminAssignRemark', 'Administrators can perform any operation on the device', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); +INSERT INTO `sys_dict_data` VALUES (3755, 3755, 'role.systemRemark', 'System, cannot modify or delete', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); +INSERT INTO `sys_dict_data` VALUES (3756, 3756, 'role.adminRemark', 'Administrators can perform any operation on the device', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); INSERT INTO `sys_dict_data` VALUES (3757, 3757, 'role.operatorRemark', 'Operation and maintenance personnel can read data from the device and configure the device, but cannot perform software upgrade operations on the device.', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); INSERT INTO `sys_dict_data` VALUES (3758, 3758, 'role.monitorRemark', 'Monitoring personnel Can only read data from the device, but cannot make any settings on the device', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); INSERT INTO `sys_dict_data` VALUES (3759, 3759, 'role.vistorRemark', 'Ordinary users can only see system-related information', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); diff --git a/database/install/sys_role.sql b/database/install/sys_role.sql index 9dac69b0..3376f7d9 100644 --- a/database/install/sys_role.sql +++ b/database/install/sys_role.sql @@ -29,8 +29,8 @@ CREATE TABLE `sys_role` ( LOCK TABLES `sys_role` WRITE; -INSERT INTO `sys_role` VALUES (1, 'role.admin', 'supervisor', 1, '1', '1', '1', '1', '0', 'supervisor', 1697091437683, 'supervisor', 1697091437683, 'role.adminRemark'); -INSERT INTO `sys_role` VALUES (2, 'role.adminAssign', 'administrator', 2, '1', '1', '1', '1', '0', 'supervisor', 1698486915894, 'supervisor', 1717143830709, 'role.adminAssignRemark'); +INSERT INTO `sys_role` VALUES (1, 'role.system', 'system', 1, '1', '1', '1', '1', '0', 'supervisor', 1697091437683, 'supervisor', 1697091437683, 'role.systemRemark'); +INSERT INTO `sys_role` VALUES (2, 'role.admin', 'admin', 2, '1', '1', '1', '1', '0', 'supervisor', 1698486915894, 'supervisor', 1717143830709, 'role.adminRemark'); INSERT INTO `sys_role` VALUES (3, 'role.operator', 'operator', 3, '1', '1', '1', '1', '0', 'supervisor', 1698486934900, 'supervisor', 1717143582784, 'role.operatorRemark'); INSERT INTO `sys_role` VALUES (4, 'role.monitor', 'monitor', 4, '1', '1', '1', '1', '0', 'supervisor', 1698486950714, 'supervisor', 1706774389300, 'role.monitorRemark'); INSERT INTO `sys_role` VALUES (5, 'role.vistor', 'vistor', 5, '1', '1', '1', '1', '0', 'supervisor', 1698486975779, 'supervisor', 1706774405096, 'role.vistorRemark'); diff --git a/database/upgrade/upg_sys_dict_data1_i18n_zh.sql b/database/upgrade/upg_sys_dict_data1_i18n_zh.sql index 6ce42075..072b4352 100644 --- a/database/upgrade/upg_sys_dict_data1_i18n_zh.sql +++ b/database/upgrade/upg_sys_dict_data1_i18n_zh.sql @@ -349,13 +349,13 @@ REPLACE INTO `sys_dict_data` VALUES (1722, 1722, 'job.errTargetParams', '操作 REPLACE INTO `sys_dict_data` VALUES (1723, 1723, 'job.errCronExpression', '操作调度任务【{name}】失败,Cron表达式不正确', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); REPLACE INTO `sys_dict_data` VALUES (1724, 1724, 'job.errJobExists', '调度任务新增【{name}】失败,同任务组内有相同任务名称', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); REPLACE INTO `sys_dict_data` VALUES (1725, 1725, 'job.statusEq', '变更状态与旧值相等!', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); -REPLACE INTO `sys_dict_data` VALUES (1750, 1750, 'role.admin', '超级管理员', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); -REPLACE INTO `sys_dict_data` VALUES (1751, 1751, 'role.adminAssign', '管理人员', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); +REPLACE INTO `sys_dict_data` VALUES (1750, 1750, 'role.system', '系统', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); +REPLACE INTO `sys_dict_data` VALUES (1751, 1751, 'role.admin', '管理人员', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); REPLACE INTO `sys_dict_data` VALUES (1752, 1752, 'role.operator', '运维人员', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); REPLACE INTO `sys_dict_data` VALUES (1753, 1753, 'role.monitor', '监控人员', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); REPLACE INTO `sys_dict_data` VALUES (1754, 1754, 'role.vistor', '普通用户', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); -REPLACE INTO `sys_dict_data` VALUES (1755, 1755, 'role.adminRemark', '超级管理员,无法修改删除', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); -REPLACE INTO `sys_dict_data` VALUES (1756, 1756, 'role.adminAssignRemark', '管理人员 可以对设备进行任何操作', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); +REPLACE INTO `sys_dict_data` VALUES (1755, 1755, 'role.systemRemark', '系统,无法修改删除', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); +REPLACE INTO `sys_dict_data` VALUES (1756, 1756, 'role.adminRemark', '管理人员 可以对设备进行任何操作', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); REPLACE INTO `sys_dict_data` VALUES (1757, 1757, 'role.operatorRemark', '运维人员 可以从设备读取数据,并对设备进行配置,但是不能对设备进行软件升级操作。', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); REPLACE INTO `sys_dict_data` VALUES (1758, 1758, 'role.monitorRemark', '监控人员 只能从设备读取数据,而不能对设备进行任何设置', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); REPLACE INTO `sys_dict_data` VALUES (1759, 1759, 'role.vistorRemark', '普通用户 只可看系统相关信息', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); diff --git a/database/upgrade/upg_sys_dict_data2_i18n_en.sql b/database/upgrade/upg_sys_dict_data2_i18n_en.sql index f6b8f9a9..9e8904aa 100644 --- a/database/upgrade/upg_sys_dict_data2_i18n_en.sql +++ b/database/upgrade/upg_sys_dict_data2_i18n_en.sql @@ -344,13 +344,13 @@ REPLACE INTO `sys_dict_data` VALUES (3722, 3722, 'job.errTargetParams', 'Failed REPLACE INTO `sys_dict_data` VALUES (3723, 3723, 'job.errCronExpression', 'Scheduled task [{name}] failed with incorrect Cron expression!', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); REPLACE INTO `sys_dict_data` VALUES (3724, 3724, 'job.errJobExists', 'Failed to add a new task [{name}] to a scheduling task, same task name in the same task group', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); REPLACE INTO `sys_dict_data` VALUES (3725, 3725, 'job.statusEq', 'The change state is equal to the old value!', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); -REPLACE INTO `sys_dict_data` VALUES (3750, 3750, 'role.admin', 'Super Administrator', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); -REPLACE INTO `sys_dict_data` VALUES (3751, 3751, 'role.adminAssign', 'Managers', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); +REPLACE INTO `sys_dict_data` VALUES (3750, 3750, 'role.system', 'System', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); +REPLACE INTO `sys_dict_data` VALUES (3751, 3751, 'role.admin', 'Administrator', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); REPLACE INTO `sys_dict_data` VALUES (3752, 3752, 'role.operator', 'Operators', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); REPLACE INTO `sys_dict_data` VALUES (3753, 3753, 'role.monitor', 'Monitor', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); REPLACE INTO `sys_dict_data` VALUES (3754, 3754, 'role.vistor', 'General Users', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); -REPLACE INTO `sys_dict_data` VALUES (3755, 3755, 'role.adminRemark', 'Super Administrator, cannot modify or delete', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); -REPLACE INTO `sys_dict_data` VALUES (3756, 3756, 'role.adminAssignRemark', 'Administrators can perform any operation on the device', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); +REPLACE INTO `sys_dict_data` VALUES (3755, 3755, 'role.systemRemark', 'System, cannot modify or delete', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); +REPLACE INTO `sys_dict_data` VALUES (3756, 3756, 'role.adminRemark', 'Administrators can perform any operation on the device', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); REPLACE INTO `sys_dict_data` VALUES (3757, 3757, 'role.operatorRemark', 'Operation and maintenance personnel can read data from the device and configure the device, but cannot perform software upgrade operations on the device.', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); REPLACE INTO `sys_dict_data` VALUES (3758, 3758, 'role.monitorRemark', 'Monitoring personnel Can only read data from the device, but cannot make any settings on the device', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); REPLACE INTO `sys_dict_data` VALUES (3759, 3759, 'role.vistorRemark', 'Ordinary users can only see system-related information', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL); diff --git a/database/upgrade/upg_sys_role.sql b/database/upgrade/upg_sys_role.sql index 7d81fa9f..6cdbeb24 100644 --- a/database/upgrade/upg_sys_role.sql +++ b/database/upgrade/upg_sys_role.sql @@ -1,7 +1,7 @@ SET FOREIGN_KEY_CHECKS=0; -INSERT IGNORE INTO `sys_role` VALUES (1, 'role.admin', 'supervisor', 1, '1', '1', '1', '1', '0', 'supervisor', 1697091437683, 'supervisor', 1697091437683, 'role.adminRemark'); -INSERT IGNORE INTO `sys_role` VALUES (2, 'role.adminAssign', 'administrator', 2, '1', '1', '1', '1', '0', 'supervisor', 1698486915894, 'supervisor', 1717143830709, 'role.adminAssignRemark'); +INSERT IGNORE INTO `sys_role` VALUES (1, 'role.system', 'system', 1, '1', '1', '1', '1', '0', 'supervisor', 1697091437683, 'supervisor', 1697091437683, 'role.systemRemark'); +INSERT IGNORE INTO `sys_role` VALUES (2, 'role.admin', 'admin', 2, '1', '1', '1', '1', '0', 'supervisor', 1698486915894, 'supervisor', 1717143830709, 'role.adminRemark'); INSERT IGNORE INTO `sys_role` VALUES (3, 'role.operator', 'operator', 3, '1', '1', '1', '1', '0', 'supervisor', 1698486934900, 'supervisor', 1717143582784, 'role.operatorRemark'); INSERT IGNORE INTO `sys_role` VALUES (4, 'role.monitor', 'monitor', 4, '1', '1', '1', '1', '0', 'supervisor', 1698486950714, 'supervisor', 1706774389300, 'role.monitorRemark'); INSERT IGNORE INTO `sys_role` VALUES (5, 'role.vistor', 'vistor', 5, '1', '1', '1', '1', '0', 'supervisor', 1698486975779, 'supervisor', 1706774405096, 'role.vistorRemark'); diff --git a/src/framework/constants/admin/admin.go b/src/framework/constants/admin/admin.go index 7ac32c50..1c158a8d 100644 --- a/src/framework/constants/admin/admin.go +++ b/src/framework/constants/admin/admin.go @@ -1,12 +1,12 @@ package admin -// 管理员常量信息 +// 系统管理员常量信息 -// 管理员-系统指定角色ID +// 系统管理员-系统指定角色ID const ROLE_ID = "1" -// 管理员-系统指定角色KEY -const ROLE_KEY = "admin" +// 系统管理员-系统指定角色KEY +const ROLE_KEY = "system" -// 管理员-系统指定权限 +// 系统管理员-系统指定权限 const PERMISSION = "*:*:*" diff --git a/src/modules/system/controller/sys_profile.go b/src/modules/system/controller/sys_profile.go index 8b5669da..55095bcf 100644 --- a/src/modules/system/controller/sys_profile.go +++ b/src/modules/system/controller/sys_profile.go @@ -60,7 +60,7 @@ func (s *SysProfileController) Info(c *gin.Context) { } isAdmin := config.IsAdmin(loginUser.UserID) if isAdmin { - roleGroup = append(roleGroup, i18n.TKey(language, "role.admin")) + roleGroup = append(roleGroup, i18n.TKey(language, "role.system")) } // 查询用户所属岗位组