|
|
|
@ -14,8 +14,10 @@ import com.taxi.apipassenger.remote.ServiceVerificatoncodeClient;
|
|
|
|
|
import net.sf.json.JSONObject;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
|
|
import org.springframework.stereotype.Indexed;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import java.lang.invoke.ConstantCallSite;
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
@ -72,6 +74,12 @@ public class VerificationCodeService {
|
|
|
|
|
//四、颁发令牌
|
|
|
|
|
String token = JwtUtils.generatorToken(passenegerPhone,
|
|
|
|
|
IdentityConstant.PASSENGER_IDENTITY);
|
|
|
|
|
|
|
|
|
|
//将token存入redis
|
|
|
|
|
String tokenKey = Utils.getTokenPrefixKey(passenegerPhone,
|
|
|
|
|
IdentityConstant.PASSENGER_IDENTITY);
|
|
|
|
|
stringRedisTemplate.opsForValue().set(tokenKey,token,30,TimeUnit.DAYS);
|
|
|
|
|
|
|
|
|
|
CheckCodeResponse checkCodeResponse = new CheckCodeResponse();
|
|
|
|
|
checkCodeResponse.setToken(token);
|
|
|
|
|
return ResponseResult.success(checkCodeResponse);
|
|
|
|
|