单点登录

This commit is contained in:
gongjiale 2024-12-04 19:49:27 +08:00
parent 057fa28723
commit 02c6aa0847
3 changed files with 14 additions and 8 deletions

View File

@ -197,13 +197,16 @@ public class BbcController extends BaseController {
user.setPhonenumber(mobile); user.setPhonenumber(mobile);
user.setStatus(status); user.setStatus(status);
user.setNickName(nickName); user.setNickName(nickName);
Random random = new Random(); // Random random = new Random();
int min = 8000; // int min = 8000;
int max = 9000; // int max = 9000;
int randomNumber = random.nextInt(max - min + 1) + min; // int randomNumber = random.nextInt(max - min + 1) + min;
user.setUserId(Long.valueOf(randomNumber)); // user.setUserId(Long.valueOf(randomNumber)); 删除 随机数id 使用序列新增
//用户创建 //用户创建
userService.registerUser(user); userService.registerUser(user);
/**
* todo 新增 用户权限 给予默认 角色
*/
//获取返回给IAM连接器的唯一标识用于后续该条数据的更新修改删除 //获取返回给IAM连接器的唯一标识用于后续该条数据的更新修改删除
String uid = user.getUserId() + ""; String uid = user.getUserId() + "";
if (uid != null) { if (uid != null) {

View File

@ -64,7 +64,7 @@ public class SysLoginController
AjaxResult ajax = AjaxResult.success(); AjaxResult ajax = AjaxResult.success();
// 生成令牌 // 生成令牌
String password= AESUtil.decrypt(loginBody.getPassword()); String password= AESUtil.decrypt(loginBody.getPassword());
String token = loginService.loginNoCode(loginBody.getUsername().toLowerCase(Locale.ROOT),password, loginBody.getCode(), String token = loginService.loginNoCode(loginBody.getUsername().toUpperCase(Locale.ROOT),password, loginBody.getCode(),
loginBody.getUuid()); loginBody.getUuid());
ajax.put(Constants.TOKEN, token); ajax.put(Constants.TOKEN, token);
return ajax; return ajax;

View File

@ -155,9 +155,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- <selectKey keyProperty="userId" order="BEFORE" resultType="Long">--> <!-- <selectKey keyProperty="userId" order="BEFORE" resultType="Long">-->
<!-- select seq_sys_user.nextval as userId from DUAL--> <!-- select seq_sys_user.nextval as userId from DUAL-->
<!-- </selectKey>--> <!-- </selectKey>-->
<!-- <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">--> <!-- <insert id="insertUser" parameterType="SysUser" >-->
<insert id="insertUser" parameterType="SysUser" > <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
<selectKey keyProperty="userId" order="BEFORE" resultType="Long">
select seq_sys_user.nextval as userId from DUAL
</selectKey>
insert into sys_user( insert into sys_user(
<if test="userId != null and userId != 0">user_id,</if> <if test="userId != null and userId != 0">user_id,</if>
<if test="deptId != null and deptId != 0">dept_id,</if> <if test="deptId != null and deptId != 0">dept_id,</if>