1.修改1101(求职者)、1102(招聘者)、1103(网格员)、1104(内部工作者)
2.添加门户认证的类
This commit is contained in:
@@ -5,6 +5,7 @@ import java.util.Set;
|
||||
|
||||
import com.ruoyi.common.core.domain.model.RegisterBody;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.framework.web.service.OauthLoginService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -34,6 +35,8 @@ public class SysLoginController
|
||||
|
||||
@Autowired
|
||||
private SysPermissionService permissionService;
|
||||
@Autowired
|
||||
private OauthLoginService oauthLoginService;
|
||||
|
||||
/**
|
||||
* 登录方法
|
||||
@@ -166,4 +169,18 @@ public class SysLoginController
|
||||
String token=loginService.registerAppUser(registerBody);
|
||||
return AjaxResult.success().put("token",token);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取统一门户token
|
||||
*/
|
||||
@GetMapping("/getTjmhToken")
|
||||
public AjaxResult getTjmhToken(@RequestParam("code") String code){
|
||||
if(StringUtils.isBlank(code)){
|
||||
return AjaxResult.error("参数code为空,请传递code参数");
|
||||
}
|
||||
String token = oauthLoginService.oauthLogin(code);
|
||||
return AjaxResult.success()
|
||||
.put("token", token)
|
||||
.put("msg", "登录成功");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,7 +283,7 @@ public class SysUserController extends BaseController
|
||||
}
|
||||
sysUser.setPhonenumber(getUsername());
|
||||
Long[] postIds = {1L};
|
||||
Long[] roleIds = {100L};
|
||||
Long[] roleIds = {1102L};
|
||||
sysUser.setPostIds(postIds);
|
||||
sysUser.setRoleIds(roleIds);
|
||||
userService.insertUser(sysUser);
|
||||
|
||||
Reference in New Issue
Block a user