今天在写短信接口时候,要把验证码存到缓存里面.因为之前别人已经写的有案例,按照之前写的,获取 值.存到数据库,存到redis. 因为有过期时间,需要传过期时间.但是怎么都是不出来... 源码: @Overridepublic String sendRandomCode(SmsDto smsDto, Integer seconds) throws Exception { String code = RandomUtils.generateNumberString(6); String conten…