vince
2024-01-16 5f92b2034f84caeab9cb6efc61ecbe22407935b4
src/main/java/com/fzzy/gateway/hx2023/controller/GatewayController.java
@@ -7,6 +7,7 @@
import com.fzzy.gateway.entity.GatewayConf;
import com.fzzy.gateway.hx2023.data.GatewayAuthData;
import com.fzzy.gateway.service.GatewayConfService;
import com.ld.license.LicenseVerify;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
@@ -84,7 +85,21 @@
        json.put("message", "成功");
        json.put("status", 0);
        json.put("code", 200);
        try{
            LicenseVerify licenseVerify = new LicenseVerify();
            //校验证书是否有效
            boolean verifyResult = licenseVerify.verify();
            if(verifyResult){
        return json;
            }else{
                log.error("证书验证失败!拒绝访问");
                return null;
            }
        }catch (Exception e){
            log.error("证书验证失败:" + e.getMessage(),e);
            return null;
        }
    }
    public void updateGatewayToken(String token, String username) {