|
|
@@ -140,11 +140,16 @@ public class UserInfoCollectionController extends AppBaseController {
|
|
|
@PostMapping("/submitCollectionAnswerParam")
|
|
|
public R submitCollectionAnswerParam(@RequestBody SubmitCollectionAnswerParam param)
|
|
|
{
|
|
|
- String userIdStr = getUserId();
|
|
|
- if (StringUtils.isEmpty(userIdStr)) {
|
|
|
- throw new CustomException("请登录");
|
|
|
+ long userId;
|
|
|
+ try {
|
|
|
+ String userIdStr = getUserId();
|
|
|
+ if (StringUtils.isEmpty(userIdStr)) {
|
|
|
+ throw new CustomException("请登录");
|
|
|
+ }
|
|
|
+ userId = Long.parseLong(userIdStr);
|
|
|
+ } catch (Exception e) {
|
|
|
+ return R.error(401, "未登录");
|
|
|
}
|
|
|
- long userId = Long.parseLong(getUserId());
|
|
|
param.setUserId(userId);
|
|
|
int result = userInformationCollectionService.submitCollectionAnswerParam(param);
|
|
|
if (result > 0) {
|