查询微信用户角色传递openid为空时返回数组

This commit is contained in:
lc 2024-04-11 16:48:00 +08:00
parent 5fe926d573
commit 2cb313c1a8
1 changed files with 3 additions and 1 deletions

View File

@ -252,7 +252,9 @@ public class WxLoginController extends BaseController {
@RequestMapping("/selectWXuserRole") @RequestMapping("/selectWXuserRole")
public AjaxResult selectWXuserRole(@RequestParam String openid){ public AjaxResult selectWXuserRole(@RequestParam String openid){
if (StringUtils.isEmpty(openid)){ if (StringUtils.isEmpty(openid)){
return AjaxResult.error("请登录!"); List<Object> data = new ArrayList<>();
data.add(0);
return new AjaxResult(HttpStatus.SUCCESS,"roleIds",data);
} }
//获取当前用户信息 //获取当前用户信息
SysUser user = iSysUserService.selectUserByopenid(openid); SysUser user = iSysUserService.selectUserByopenid(openid);