当前位置: 首页 > news >正文

大型网站设计首页实例网络营销的策划流程

大型网站设计首页实例,网络营销的策划流程,还有那个网站平台做化妆品批发的,南宁百度 - 网站正在建设中文章目录 简述私钥、公钥、私钥证书生成License 生成License 客户端部署 简述 可用于项目交付项目部署到甲方以及包括代码防止泄露,经常会出现公司内部代码被已离职人员在下家公司使用,底层代码的封装增加license部分,杜绝这块的问题。定期更…

文章目录

  • 简述
  • 私钥、公钥、私钥证书生成
  • License 生成
  • License 客户端部署

简述

可用于项目交付项目部署到甲方以及包括代码防止泄露,经常会出现公司内部代码被已离职人员在下家公司使用,底层代码的封装增加license部分,杜绝这块的问题。定期更换license文件可进行续期,项目中采用truelicense version 1.33实现,SpringBoot version 2.0.3.RELEASE。
代码如下:
license-server
License-client
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

私钥、公钥、私钥证书生成

私钥

keytool -genkey -alias privatekey -keystore privateKeys.store -validity 3650

私钥证书

keytool -export -alias privatekey -file certfile.cer -keystore privateKeys.store

公钥

keytool -import -alias publiccert -file certfile.cer -keystore publicCerts.store

License 生成

拉去码云中的项目
访问接口生成License文件

package com.license.server.controller;import com.license.core.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;import java.util.HashMap;
import java.util.Map;/*** 用于生成证书文件,不能放在给客户部署的代码里** @author zifangsky* @date 2018/4/26* @since 1.0.0*/
@RestController
@RequestMapping("/license")
public class LicenseCreatorController {/*** 证书生成路径*/private String licensePath = "C:/Users/zifangsky/Desktop/license_demo/license.lic";/*** 获取服务器硬件信息** @param osName 操作系统类型,如果为空则自动判断* @return com.ccx.models.license.LicenseCheckModel* @author zifangsky* @since 1.0.0*/@RequestMapping(value = "/getServerInfos", produces = {MediaType.APPLICATION_JSON_UTF8_VALUE})public LicenseCheckModel getServerInfos(@RequestParam(value = "osName", required = false) String osName) {//操作系统类型if (StringUtils.isBlank(osName)) {osName = System.getProperty("os.name");}osName = osName.toLowerCase();AbstractServerInfos abstractServerInfos = null;//根据不同操作系统类型选择不同的数据获取方法if (osName.startsWith("windows")) {abstractServerInfos = new WindowsServerInfos();} else if (osName.startsWith("linux")) {abstractServerInfos = new LinuxServerInfos();} else {//其他服务器类型abstractServerInfos = new LinuxServerInfos();}return abstractServerInfos.getServerInfos();}/*** 生成证书** @param param 生成证书需要的参数,如:{"subject":"ccx-models","privateAlias":"privateKey","keyPass":"5T7Zz5Y0dJFcqTxvzkH5LDGJJSGMzQ","storePass":"3538cef8e7","licensePath":"C:/Users/zifangsky/Desktop/license.lic","privateKeysStorePath":"C:/Users/zifangsky/Desktop/privateKeys.keystore","issuedTime":"2018-04-26 14:48:12","expiryTime":"2018-12-31 00:00:00","consumerType":"User","consumerAmount":1,"description":"这是证书描述信息","licenseCheckModel":{"ipAddress":["192.168.245.1","10.0.5.22"],"macAddress":["00-50-56-C0-00-01","50-7B-9D-F9-18-41"],"cpuSerial":"BFEBFBFF000406E3","mainBoardSerial":"L1HF65E00X9"}}* @return java.util.Map<java.lang.String                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               java.lang.Object>* @author zifangsky* @since 1.0.0*/@RequestMapping(value = "/generateLicense", produces = {MediaType.APPLICATION_JSON_UTF8_VALUE})public Map<String, Object> generateLicense(@RequestBody(required = true) LicenseCreatorParam param) {Map<String, Object> resultMap = new HashMap<>(2);if (StringUtils.isBlank(param.getLicensePath())) {param.setLicensePath(licensePath);}LicenseCreator licenseCreator = new LicenseCreator(param);boolean result = licenseCreator.generateLicense();if (result) {resultMap.put("result", "ok");resultMap.put("msg", param);} else {resultMap.put("result", "error");resultMap.put("msg", "证书文件生成失败!");}return resultMap;}
//
//    @RequestMapping(value = "/generateLicense", produces = {MediaType.APPLICATION_JSON_UTF8_VALUE})
//    public Map<String, Object> generateLicense(@RequestBody Map<String, Object> params) {
//        return licenseCreatorService.generateLicense(params);
//    }}

License 客户端部署

生成完毕后
将License客户端代码拉去到本地,然后打包到本地依赖库。若install后依赖还是存在问题可以通过如下命令

mvn install:install-file -DgroupId=com.license.client   -DartifactId=license-client -Dversion=1.0.0-SNAPSHOT  -Dfile=D:\LicenseDemo\license-client\target\license-client-1.0.0-SNAPSHOT.jar   -Dpackaging=jar

将自己的项目依赖这个license-client,添加自定义拦截器
该拦截器在license完成,只需在自己的项目中配置添加即可
在这里插入图片描述
在这里插入图片描述
上图 在 WebMvcConfigurer 中注入 拦截器 并且 添加拦截器 添加拦截地址
注:拦截地址为登录校验地址 如果 登录校验地址与 登录页跳转地址相同 请将登录验证地址更名 否则 拦截器 在没有通过认证证书的情况下 会将登陆页面拦截
配置文件

添加 license 配置 公钥路径 以及 证书路径可更改

license:subject: license_demopublicAlias: publicCertstorePass: public_password1234licensePath: E:/license.lic

配置启动类
在这里插入图片描述

启动类包扫描 默认扫描 application启动类 文件平级以及下级的文件夹与类 配置license 包扫描路径 com.licanse

http://www.yidumall.com/news/89990.html

相关文章:

  • 学雷锋 做美德少年网站营销策划方案模板
  • 昆明网站建设搭建手机app开发
  • 自己做网站需要啥管理系统
  • 济宁市建设银行网站百度seo规则
  • 铜陵电子商务网站建设无需下载直接进入的网站的代码
  • 微信开发者工具的介绍广州百度推广优化
  • 峨眉网站建设代运营电商公司
  • 江西网站开发联系方式seo网站有优化培训吗
  • 网站备案个人信息泄露创量广告投放平台
  • 做网站的公司主要做shm重庆seo网站收录优化
  • 做纸棋的网站seo网站排名优化软件
  • 自己公司内网网站和外网怎么做同步谷歌seo网站运营
  • 广州我网站制作百度推广一个点击多少钱
  • 做新闻网站用香港阿里云服务器短视频营销成功的案例
  • 备案的域名拿来做别的网站企业中层管理人员培训课程
  • 做外贸如何选择网站推广神器
  • 网站建设公司转型各国足球世界排名
  • 服务器部署wordpress免费seo关键词优化服务
  • 常州网站制作哪家好怎么建网站免费的
  • 做网站的学什么代码b2b平台营销
  • 服务器哪些端口可以做网站seo外包公司是啥
  • 长春市城乡建设局网站深圳推广平台深圳网络推广
  • 供应链公司是什么行业西安seo按天收费
  • 网站建设合同 域名网站设计制作在哪里找
  • phpcms做网站感想百度权重5的网站能卖多少钱
  • 外贸做零售的网站微信推广引流方法
  • 罗湖网站建设公司阿里云域名注册官网网址
  • WordPress图片变模糊化工网站关键词优化
  • 哪个网站做课件能赚钱自媒体是什么
  • 搜索引擎搜不到网站专业软文代写