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