| | |
| | | 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.*; |
| | |
| | | json.put("message", "成功"); |
| | | json.put("status", 0); |
| | | json.put("code", 200); |
| | | return json; |
| | | 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) { |