|
|
@@ -7,6 +7,7 @@ import javax.validation.Validator;
|
|
|
|
|
|
import com.ruoyi.system.mapper.*;
|
|
|
import com.ruoyi.system.service.ISysDeptService;
|
|
|
+import com.ruoyi.weChat.service.WeChatService;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -59,6 +60,8 @@ public class SysUserServiceImpl implements ISysUserService
|
|
|
@Autowired
|
|
|
private ISysDeptService deptService;
|
|
|
@Autowired
|
|
|
+ private WeChatService weChatService;
|
|
|
+ @Autowired
|
|
|
protected Validator validator;
|
|
|
|
|
|
/**
|
|
|
@@ -548,4 +551,15 @@ public class SysUserServiceImpl implements ISysUserService
|
|
|
public Object selectName(String name) {
|
|
|
return userMapper.selectName(name);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String setOpenId(String code) {
|
|
|
+ System.out.println(code);
|
|
|
+ String openId = weChatService.getOpenId(code);
|
|
|
+ SysUser user = new SysUser();
|
|
|
+ user.setUserId(SecurityUtils.getUserId());
|
|
|
+ user.setOpenId(openId);
|
|
|
+ userMapper.updateUser(user);
|
|
|
+ return openId;
|
|
|
+ }
|
|
|
}
|