自动化立体仓库 - WMS系统
#
vincent
2020-05-25 df4d3f65aed6d504c45c5ae05dfd345479562c1a
src/main/java/com/zy/common/web/AuthController.java
@@ -83,10 +83,19 @@
    public void code(@RequestParam String sd, HttpServletResponse response) {
        RandomValidateCodeUtil.getRandcode(sd, response);
    }
    @RequestMapping("/code.do")
    public String codeDo(@RequestParam String sd) {
        String code = RandomValidateCodeUtil.code.get(sd);
    public String codeDo(@RequestParam String sd) throws Exception {
        String code = null;
        int time = 0;
        while (time < 3000) {
            code = RandomValidateCodeUtil.code.get(sd);
            if (!Cools.isEmpty(code)){
                break;
            } else {
                Thread.sleep(10);
                time = time + 100;
            }
        }
        RandomValidateCodeUtil.code.remove(sd);
        return code;
    }