|  |  | 
 |  |  | import com.baomidou.mybatisplus.mapper.Wrapper; | 
 |  |  | import com.baomidou.mybatisplus.plugins.Page; | 
 |  |  | import com.core.common.DateUtils; | 
 |  |  | import com.zy.crm.common.CodeRes; | 
 |  |  | import com.zy.crm.manager.entity.SmsCode; | 
 |  |  | import com.zy.crm.manager.service.SmsCodeService; | 
 |  |  | import com.core.annotations.ManagerAuth; | 
 |  |  | 
 |  |  | import com.core.domain.KeyValueVo; | 
 |  |  | import com.zy.crm.common.web.BaseController; | 
 |  |  | import com.zy.crm.manager.utils.SmsUtils; | 
 |  |  | import com.zy.crm.system.entity.User; | 
 |  |  | import com.zy.crm.system.service.UserService; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.web.bind.annotation.*; | 
 |  |  |  | 
 |  |  | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private SmsCodeService smsCodeService; | 
 |  |  |     @Autowired | 
 |  |  |     private UserService userService; | 
 |  |  |  | 
 |  |  |     @RequestMapping(value = "/smsCode/{id}/auth") | 
 |  |  |     @ManagerAuth | 
 |  |  | 
 |  |  |         if (!SmsUtils.verifyPhone(phone)) { | 
 |  |  |             return R.error("手机号格式不正确"); | 
 |  |  |         } | 
 |  |  |         EntityWrapper<User> userWrapper = new EntityWrapper<>(); | 
 |  |  |         userWrapper.eq("mobile", phone); | 
 |  |  |         User user = userService.selectOne(userWrapper); | 
 |  |  |         if (Cools.isEmpty(user)){ | 
 |  |  |             return R.parse(CodeRes.USER_10001); | 
 |  |  |         } | 
 |  |  |         if (user.getStatus()!=1){ | 
 |  |  |             return R.parse(CodeRes.USER_10002); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         SmsCode smsCode1 = smsCodeService.selectByPhone(phone); | 
 |  |  |         if (smsCode1 != null) { |