| | |
| | | if (ObjectUtils.isEmpty(unionid)) { |
| | | unionid = "无"; |
| | | } |
| | | userService.addOrUpdate(openid, sessionKey, unionid); |
| | | userService.addOrUpdate(openid, sessionKey, unionid,this.getAppId()); |
| | | return tokenService.loginApplets(openid,this.getAppId()); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/addOrUpdate") |
| | | R addOrUpdate(@RequestParam("openid") String openid, @RequestParam("sessionKey") String sessionKey, |
| | | @RequestParam("unionid") String unionid); |
| | | @RequestParam("unionid") String unionid,@RequestParam("appId")String appId); |
| | | |
| | | /** |
| | | * 维护小程序用户基本信息 头像 昵称 性别 |
| | |
| | | */ |
| | | @PostMapping("/addOrUpdate") |
| | | public R addOrUpdate(@RequestParam("openid") String openid, @RequestParam("sessionKey") String sessionKey, |
| | | @RequestParam("unionid") String unionid) { |
| | | return userService.updateInsertUser(openid, sessionKey, unionid); |
| | | @RequestParam("unionid") String unionid,@RequestParam("appId")String appId) { |
| | | return userService.updateInsertUser(openid, sessionKey, unionid,appId); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 用户在开放平台的唯一标识符 |
| | | * @return token |
| | | */ |
| | | R updateInsertUser(String openid, String sessionKey, String unionid); |
| | | R updateInsertUser(String openid, String sessionKey, String unionid,String appId); |
| | | |
| | | /** |
| | | * 维护小程序用户基本信息 头像 昵称 性别 |
| | |
| | | * @return token |
| | | */ |
| | | @Override |
| | | public R updateInsertUser(String openid, String sessionKey, String unionid) { |
| | | public R updateInsertUser(String openid, String sessionKey, String unionid,String appId) { |
| | | SysUserDO sysUserDO = |
| | | userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getOpenid, openid)); |
| | | boolean empty = ObjectUtils.isEmpty(sysUserDO); |
| | |
| | | sysUserDO1.setLastLoginTime(date); |
| | | sysUserDO1.setPassword(encode); |
| | | sysUserDO1.setType(1); |
| | | sysUserDO1.setAppId(appId); |
| | | num = userDao.insert(sysUserDO1); |
| | | } else { |
| | | String encode = new BCryptPasswordEncoder().encode(UserConstants.PASSWORD); |
| | |
| | | sysUserDO.setPassword(encode); |
| | | sysUserDO.setLastLoginTime(date); |
| | | sysUserDO.setType(1); |
| | | sysUserDO.setAppId(appId); |
| | | num = userDao.updateById(sysUserDO); |
| | | } |
| | | if (num > 0) { |
| | |
| | | String encode = new BCryptPasswordEncoder().encode(administratorsUserVO.getPassword()); |
| | | administratorsUserVO.setPassword(encode); |
| | | BeanUtils.copyProperties(administratorsUserVO, sysUserDO); |
| | | sysUserDO.setAppId(administratorsUserVO.getAppid()); |
| | | int insert = 0; |
| | | try { |
| | | insert = userDao.insert(sysUserDO); |