| | |
| | | import com.yami.trading.security.common.manager.PasswordManager; |
| | | import com.yami.trading.security.common.manager.TokenStore; |
| | | import com.yami.trading.security.common.vo.TokenInfoVO; |
| | | import com.yami.trading.service.IdentifyingCodeTimeWindowService; |
| | | import com.yami.trading.service.WalletService; |
| | | import com.yami.trading.service.syspara.SysparaService; |
| | | import com.yami.trading.service.system.LogService; |
| | |
| | | import com.yami.trading.service.user.UserService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | |
| | | |
| | | @Autowired |
| | | UserDataService userDataService; |
| | | @Autowired |
| | | IdentifyingCodeTimeWindowService identifyingCodeTimeWindowService; |
| | | |
| | | |
| | | @PostMapping("/login") |
| | |
| | | String usercode = model.getUserCode(); |
| | | // 注册类型:1/手机;2/邮箱;3/用户名; |
| | | int type = model.getType(); |
| | | |
| | | String key = username; |
| | | String authcode = identifyingCodeTimeWindowService.getAuthCode(key); |
| | | if (StringUtils.isBlank(model.getEmailCode()) ||(authcode == null) || (!authcode.equals(model.getEmailCode()))) { |
| | | throw new YamiShopBindException("验证码不正确"); |
| | | } |
| | | User user = userService.register(model.getUserName(), |
| | | passwordEncoder.encode(password) |
| | | , model.getUserCode(), model.getType(),false); |