控制器返回结果或者-1,使用try catch try { return userInfoLogic.getUserIdByPhone(phone);} catch (RuntimeException e) { return -1;}