修改签到时获取用户Id的方式
This commit is contained in:
@@ -272,13 +272,13 @@ public class UserController {
|
||||
// 签到
|
||||
@PostMapping("signIn")
|
||||
public ResponseData<Object> signIn() {
|
||||
int userId = Integer.parseInt(StpUtil.getLoginId().toString());
|
||||
int i = signInRecordDao.checkSignStatus(userId);
|
||||
long userId = StpUtil.getLoginIdAsLong();
|
||||
int i = signInRecordDao.checkSignStatus((int) userId);
|
||||
if (i != 0) {
|
||||
throw new BusinessException(ErrorCode.SIGN_IN_FAIL);
|
||||
}
|
||||
|
||||
int result = signInRecordDao.signIn(userId);
|
||||
int result = signInRecordDao.signIn((int) userId);
|
||||
UserModel userModel = userDao.selectById(userId);
|
||||
int count = Integer.parseInt(FunctionConfigHolder.getValue("签到增加积分"));
|
||||
|
||||
@@ -290,7 +290,7 @@ public class UserController {
|
||||
|
||||
if (result == 1) {
|
||||
// 增加记录
|
||||
CoinRecords coinRecords = new CoinRecords("签到增加积分",userId,count, (int) VVTools.currentTimeStamp(),1);
|
||||
CoinRecords coinRecords = new CoinRecords("签到增加积分", (int) userId,count, (int) VVTools.currentTimeStamp(),1);
|
||||
coinRecordsDao.insert(coinRecords);
|
||||
return ResponseData.success(null);
|
||||
}else {
|
||||
|
||||
Reference in New Issue
Block a user