| | |
| | | import com.ks.app.entity.SystemEnum; |
| | | import com.ks.app.entity.config.SystemConfigKey; |
| | | import com.ks.app.service.inter.config.SystemConfigService; |
| | | import com.ks.app.utils.Constant; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Component; |
| | | import org.yeshi.utils.StringUtil; |
| | |
| | | * @param: code |
| | | **/ |
| | | public boolean isPhoneCodeRight(SystemEnum system, String phone, String code) { |
| | | |
| | | if (!Constant.VERIFY_VCODE) { |
| | | return true; |
| | | } |
| | | String value = systemConfigService.getValueCache(system, SystemConfigKey.testAccount); |
| | | //测试账号 |
| | | if (!StringUtil.isNullOrEmpty(value)) { |
| | |
| | | |
| | | String oldCode = redisTemplate.opsForValue().get(String.format("vcp-%s-%s", system.name(), phone)); |
| | | return oldCode != null && oldCode.equalsIgnoreCase(code); |
| | | // return true; |
| | | } |
| | | |
| | | /** |
| | |
| | | Object oldCode = redisTemplate.opsForValue().get("v-c-e-" + StringUtil.Md5(email)); |
| | | return oldCode != null && oldCode.toString().equalsIgnoreCase(code); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |