3.插入默认账号逻辑为根据用户id识别,山西太原需频闭admin字眼账号名称
| | |
| | | INSERT INTO `db_app_sys`.`tb_page_param`(`id`, `param`, `status`, `categoryId`,paramEnUs) VALUES ('57', '用户密码时效', '-1', '15',''); |
| | | 2.表'db_user.tb_user_inf'更新字段'password_update_time'中密码为'Null'的记录为当前时间 |
| | | UPDATE db_user.tb_user_inf SET password_update_time = NOW() WHERE password_update_time IS NULL; |
| | | 3.插入默认账号逻辑为根据用户id识别,山西太原需频闭admin字眼账号名称 |
| | | /** 未登录账号 ***/ |
| | | UPDATE db_user.tb_user_inf SET uname = 'unlogin_user' WHERE uid = 0; |
| | | |
| | | /** sys_admin**/ |
| | | UPDATE db_user.tb_user_inf SET uname = 'sys_tg' WHERE uid = 1; |
| | | |
| | | /** audit_admin**/ |
| | | UPDATE db_user.tb_user_inf SET uname = 'audit_tg' WHERE uid = 2; |
| | | |
| | | /** admin**/ |
| | | UPDATE db_user.tb_user_inf SET uname = 'tg' WHERE uid = 1001; |
| | | |
| | | V2.06 edit at date 2024-10-22 |
| | | 1.表'db_app_sys.tb_page_param2'插入默认配置 |
| | |
| | | //默认新增系统默认的账号superuser,admin |
| | | { |
| | | //添加admin |
| | | res = sql.sqlMysqlQuery("SELECT COUNT(*) as num_count FROM " + Sql_Mysql.TB_UserInf + " WHERE uName = 'admin';"); |
| | | res = sql.sqlMysqlQuery("SELECT COUNT(*) as num_count FROM " + Sql_Mysql.TB_UserInf + " WHERE uId = 1001;"); |
| | | if(res.next()) { |
| | | int count = res.getInt("num_count"); |
| | | if(count<1) { |
| | |
| | | sql.sqlMysqlExecute("INSERT INTO "+Sql_Mysql.TB_UserInf+"(uId,uSnId,uName,uMobilephone,uJobGroup,upassword,login_type,uRole,type,status,last_login_time,password_update_time,create_time,visit_time,visit_ip) VALUES(1001,'" + upstr + "', 'admin','','默认班组','" + upstr + "',1,0,1,1,'"+Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms)+"',null,'2021-12-14 16:16:04','00:00:00~23:59:59','*');"); |
| | | }else { |
| | | //修复前期添加默认账号时添加成了临时账号 |
| | | sql.sqlMysqlExecute("UPDATE " + Sql_Mysql.UserInfTable + " SET type = 1,expiration_time = null,lock_time = null,visit_time='00:00:00~23:59:59',visit_ip = '*' WHERE uName = 'admin'"); |
| | | sql.sqlMysqlExecute("UPDATE " + Sql_Mysql.UserInfTable + " SET type = 1,expiration_time = null,lock_time = null,visit_time='00:00:00~23:59:59',visit_ip = '*' WHERE uId = 1001"); |
| | | } |
| | | } |
| | | //添加superuser |
| | |
| | | |
| | | //默认新增指定UID = 0;1;2的 账号 |
| | | { |
| | | res = sql.sqlMysqlQuery("SELECT COUNT(*) as num_count FROM " + Sql_Mysql.TB_UserInf + " WHERE uName = '未登录的用户账号';"); |
| | | res = sql.sqlMysqlQuery("SELECT COUNT(*) as num_count FROM " + Sql_Mysql.TB_UserInf + " WHERE uId = 0;"); |
| | | if(res.next()) { |
| | | int count = res.getInt("num_count"); |
| | | if(count<1) { |
| | |
| | | sql.sqlMysqlExecute("INSERT INTO "+Sql_Mysql.TB_UserInf+"(uId,uSnId,uName,uMobilephone,uJobGroup,upassword,login_type,uRole,type,status,last_login_time,password_update_time,create_time,visit_time,visit_ip) VALUES('0','未登录的用户账号','未登录的用户账号','','','',1,0,1,1,null,'2021-12-14 16:18:44','2021-12-14 16:18:44','00:00:00~23:59:59','*');"); |
| | | |
| | | } |
| | | sql.sqlMysqlExecute("UPDATE " + Sql_Mysql.TB_UserInf + " SET uId = 0 WHERE uName = '未登录的用户账号'"); |
| | | //sql.sqlMysqlExecute("UPDATE " + Sql_Mysql.TB_UserInf + " SET uId = 0 WHERE uName = '未登录的用户账号'"); |
| | | } |
| | | |
| | | //添加默认账号sys_admin |
| | | res = sql.sqlMysqlQuery("SELECT COUNT(*) as num_count FROM " + Sql_Mysql.TB_UserInf + " WHERE uName = 'sys_admin';"); |
| | | // res = sql.sqlMysqlQuery("SELECT COUNT(*) as num_count FROM " + Sql_Mysql.TB_UserInf + " WHERE uName = 'sys_admin';"); |
| | | res = sql.sqlMysqlQuery("SELECT COUNT(*) as num_count FROM " + Sql_Mysql.TB_UserInf + " WHERE uId = 1;"); |
| | | if(res.next()) { |
| | | int count = res.getInt("num_count"); |
| | | if(count<1) { |
| | |
| | | } |
| | | |
| | | //添加默认账号audit_admin |
| | | res = sql.sqlMysqlQuery("SELECT COUNT(*) as num_count FROM " + Sql_Mysql.TB_UserInf + " WHERE uName = 'audit_admin';"); |
| | | res = sql.sqlMysqlQuery("SELECT COUNT(*) as num_count FROM " + Sql_Mysql.TB_UserInf + " WHERE uId = 2;"); |
| | | // res = sql.sqlMysqlQuery("SELECT COUNT(*) as num_count FROM " + Sql_Mysql.TB_UserInf + " WHERE uName = 'audit_admin';"); |
| | | if(res.next()) { |
| | | int count = res.getInt("num_count"); |
| | | if(count<1) { |
| | |
| | | INSERT INTO `db_app_sys`.`tb_page_param`(`id`, `param`, `status`, `categoryId`,paramEnUs) VALUES ('57', '用户密码时效', '-1', '15',''); |
| | | 2.表'db_user.tb_user_inf'更新字段'password_update_time'中密码为'Null'的记录为当前时间 |
| | | UPDATE db_user.tb_user_inf SET password_update_time = NOW() WHERE password_update_time IS NULL; |
| | | 3.插入默认账号逻辑为根据用户id识别,山西太原需频闭admin字眼账号名称 |
| | | /** 未登录账号 ***/ |
| | | UPDATE db_user.tb_user_inf SET uname = 'unlogin_user' WHERE uid = 0; |
| | | |
| | | /** sys_admin**/ |
| | | UPDATE db_user.tb_user_inf SET uname = 'sys_tg' WHERE uid = 1; |
| | | |
| | | /** audit_admin**/ |
| | | UPDATE db_user.tb_user_inf SET uname = 'audit_tg' WHERE uid = 2; |
| | | |
| | | /** admin**/ |
| | | UPDATE db_user.tb_user_inf SET uname = 'tg' WHERE uid = 1001; |
| | | |
| | | V2.06 edit at date 2024-10-22 |
| | | 1.表'db_app_sys.tb_page_param2'插入默认配置 |