public JSONObject xiaoYouBangLogin(InitClockInfo clockInInfo)InitClockInfo clockInInfo,包含用户的初始化登录信息,例如手机号(通过 getPhone() 获取)。accountHolder.set(clockInInfo.getPhone());
type.set("getInfo");ThreadLocal 变量 accountHolder 和 type 来存储线程上下文信息。accountHolder.set(clockInInfo.getPhone()):type.set("getInfo"):"getInfo",可能用于分类日志记录或逻辑分支。String loginUrl = "https://xcx.xybsyw.com/login/login.action";String ency = (String) this.redisTemplate.opsForValue().get("encryptionValue:" + clockInInfo.getPhone());
JSONObject encryptionValue = null;encryptionValue),缓存的 key 格式为:encryptionValue:<手机号>。if (ency != null) {
encryptionValue = JSONUtil.parseObj(ency);
}ency,则将其解析为 JSONObject。JSONUtil.parseObj(ency):ency)转换为 JSON 对象,便于后续使用。else {
encryptionValue = selectEncryptionValue();
}selectEncryptionValue() 方法动态生成加密值。selectEncryptionValue():if (encryptionValue != null)
this.redisTemplate.opsForValue().set(
"encryptionValue:" + clockInInfo.getPhone(),
JSONUtil.toJsonStr((JSON) encryptionValue),
5L,
TimeUnit.SECONDS
);"encryptionValue:" + clockInInfo.getPhone()。encryptionValue 转换为 JSON 字符串存储。TimeUnit.SECONDS)。原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。