shikeyin
2024-01-11 65da8373531677b1c37a98f53eaa30c892f35e5a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package com.iplatform.base.util;
 
import com.iplatform.base.Constants;
import com.walker.infrastructure.utils.StringUtils;
import com.walker.web.CaptchaResult;
 
public class CaptchaUtils {
 
    /**
     * 返回验证码缓存标识,即:存储在redis(或内存)中的唯一标识。<p></p>
     * 目前使用表示规则 = captcha_codes:uuid
     * @param data
     * @return
     * @date 2023-04-07
     */
    public static final String getVerifyKey(CaptchaResult data){
        if(data == null || StringUtils.isEmpty(data.getUuid())){
            throw new IllegalArgumentException("待验证信息未空,或者uuid不存在!");
        }
        return Constants.CAPTCHA_CODE_PREFIX + data.getUuid();
    }
}