|
@@ -21,6 +21,8 @@ import com.ruoyi.framework.manager.factory.AsyncFactory;
|
|
|
import com.ruoyi.framework.security.context.AuthenticationContextHolder;
|
|
|
import com.ruoyi.system.service.ISysConfigService;
|
|
|
import com.ruoyi.system.service.ISysUserService;
|
|
|
+import com.sooka.jnb.score.domain.ScoreOperate;
|
|
|
+import com.sooka.jnb.score.service.IScoreService;
|
|
|
import com.sooka.jnb.wxUser.mapper.WxUserMapper;
|
|
|
import com.sooka.jnb.utils.WechatUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -32,6 +34,10 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
+
|
|
|
+import static com.ruoyi.common.constant.CacheConstants.SYS_CONFIG_KEY;
|
|
|
+
|
|
|
/**
|
|
|
* 登录校验方法
|
|
|
*
|
|
@@ -58,6 +64,9 @@ public class SysLoginService
|
|
|
private ISysConfigService configService;
|
|
|
|
|
|
@Autowired
|
|
|
+ private IScoreService scoreService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private WxUserMapper wxUserMapper;
|
|
|
|
|
|
@Autowired
|
|
@@ -91,6 +100,15 @@ public class SysLoginService
|
|
|
user.setCreateBy(openid);
|
|
|
user.setUpdateBy(openid);
|
|
|
wxUserMapper.insert(user);
|
|
|
+
|
|
|
+ //初始化积分
|
|
|
+ ScoreOperate scoreOperate = new ScoreOperate(
|
|
|
+ user.getId().toString(),
|
|
|
+ Integer.valueOf(redisCache.getCacheObject(SYS_CONFIG_KEY + "init_socre").toString()),
|
|
|
+ "0",
|
|
|
+ "0"
|
|
|
+ );
|
|
|
+ scoreService.initScore(scoreOperate);
|
|
|
}
|
|
|
LoginUser loginUser = createLoginWxUser(user);
|
|
|
// SecurityUtils.getUserId()
|