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

ps做网站需要几个画布百度百度一下一下

ps做网站需要几个画布,百度百度一下一下,推荐做ppt照片的网站,重庆那家做网站做得好Kaptcha验证码 Kaptcha 是一个用于生成验证码的开源库&#xff0c;在 Java 中使用它可以轻松地为应用程序添加验证码功能。 一、引入依赖 首先&#xff0c;需要在项目的 pom.xml 文件&#xff08;如果是 Maven 项目&#xff09;中添加 Kaptcha 的依赖&#xff1a; <depend…

Kaptcha验证码

Kaptcha 是一个用于生成验证码的开源库,在 Java 中使用它可以轻松地为应用程序添加验证码功能。

一、引入依赖

首先,需要在项目的 pom.xml 文件(如果是 Maven 项目)中添加 Kaptcha 的依赖:

<dependency><groupId>com.baomidou</groupId><artifactId>kaptcha-spring-boot-starter</artifactId><version>1.1.0</version>
</dependency>

二、配置 Kaptcha

创建一个配置类来设置 Kaptcha 的属性,例如验证码的宽度、高度、字体、字符数量等:

package com.lhs.config;import com.google.code.kaptcha.Constants;
import com.google.code.kaptcha.impl.DefaultKaptcha;
import com.google.code.kaptcha.util.Config;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Properties;@Configuration
public class CaptchaConfig {/*** 验证码配置* Kaptcha配置类名*/@Bean@Qualifier("captchaProducer")public DefaultKaptcha kaptcha() {DefaultKaptcha kaptcha = new DefaultKaptcha();Properties properties = new Properties();//		properties.setProperty(Constants.KAPTCHA_BORDER, "yes");//		properties.setProperty(Constants.KAPTCHA_BORDER_COLOR, "220,220,220");//		//properties.setProperty(Constants.KAPTCHA_TEXTPRODUCER_FONT_COLOR, "38,29,12");//		properties.setProperty(Constants.KAPTCHA_IMAGE_WIDTH, "147");//		properties.setProperty(Constants.KAPTCHA_IMAGE_HEIGHT, "34");//		properties.setProperty(Constants.KAPTCHA_TEXTPRODUCER_FONT_SIZE, "25");//		//properties.setProperty(Constants.KAPTCHA_SESSION_KEY, "code");//验证码个数properties.setProperty(Constants.KAPTCHA_TEXTPRODUCER_CHAR_LENGTH, "4");//		properties.setProperty(Constants.KAPTCHA_TEXTPRODUCER_FONT_NAMES, "Courier");//字体间隔properties.setProperty(Constants.KAPTCHA_TEXTPRODUCER_CHAR_SPACE,"8");//干扰线颜色//		properties.setProperty(Constants.KAPTCHA_NOISE_COLOR, "white");//干扰实现类properties.setProperty(Constants.KAPTCHA_NOISE_IMPL, "com.google.code.kaptcha.impl.NoNoise");//图片样式properties.setProperty(Constants.KAPTCHA_OBSCURIFICATOR_IMPL, "com.google.code.kaptcha.impl.WaterRipple");//文字来源properties.setProperty(Constants.KAPTCHA_TEXTPRODUCER_CHAR_STRING, "0123456789");Config config = new Config(properties);kaptcha.setConfig(config);return kaptcha;}
}

三、生成验证码

在需要生成验证码的地方,获取 Kaptcha 实例并生成验证码:

@ApiOperation("获取图形验证码")
@GetMapping("/image")
public void getImage(HttpServletRequest request, HttpServletResponse response){response.setHeader("Cache-Control", "no-store, no-cache");response.setContentType("image/jpeg");String text = kaptcha.createText();String cacheKey = getCacheKey(request);redisTemplate.opsForValue().set(cacheKey,text,CAPTCHA_CODE_EXPIRED, TimeUnit.MILLISECONDS);BufferedImage image = kaptcha.createImage(text);try {ServletOutputStream outputStream = response.getOutputStream();ImageIO.write(image, "jpg",outputStream );outputStream.flush();outputStream.close();} catch (IOException e) {throw new RuntimeException(e);}
}

文章转载自:
http://dinncognomish.tqpr.cn
http://dinncodisaffinity.tqpr.cn
http://dinncopulmometer.tqpr.cn
http://dinncodishonorably.tqpr.cn
http://dinncoparadise.tqpr.cn
http://dinncogeraniaceous.tqpr.cn
http://dinnconeocortex.tqpr.cn
http://dinncogurkha.tqpr.cn
http://dinncocomtism.tqpr.cn
http://dinncobucktail.tqpr.cn
http://dinncoarriviste.tqpr.cn
http://dinncoconglutinant.tqpr.cn
http://dinncofaroese.tqpr.cn
http://dinncodistraction.tqpr.cn
http://dinnconetwork.tqpr.cn
http://dinncoagglomeration.tqpr.cn
http://dinncobewitch.tqpr.cn
http://dinncohermitry.tqpr.cn
http://dinncotelangiectasia.tqpr.cn
http://dinnconimrod.tqpr.cn
http://dinncobibliopoly.tqpr.cn
http://dinncodesignation.tqpr.cn
http://dinncounnatural.tqpr.cn
http://dinncoexact.tqpr.cn
http://dinncofinlander.tqpr.cn
http://dinncomassless.tqpr.cn
http://dinncotinkler.tqpr.cn
http://dinnconocuously.tqpr.cn
http://dinncoselectivity.tqpr.cn
http://dinncorasbora.tqpr.cn
http://dinncotropomyosin.tqpr.cn
http://dinncobalsas.tqpr.cn
http://dinncolaparotome.tqpr.cn
http://dinncosculptress.tqpr.cn
http://dinncotruculence.tqpr.cn
http://dinncohomesteader.tqpr.cn
http://dinncodungeness.tqpr.cn
http://dinncobespangled.tqpr.cn
http://dinncoirenic.tqpr.cn
http://dinncotanganyika.tqpr.cn
http://dinncopostexilic.tqpr.cn
http://dinncoanthropopathic.tqpr.cn
http://dinncopob.tqpr.cn
http://dinnconeontology.tqpr.cn
http://dinncocrone.tqpr.cn
http://dinncoeleuin.tqpr.cn
http://dinncosynchronicity.tqpr.cn
http://dinncoquaintness.tqpr.cn
http://dinncopenalize.tqpr.cn
http://dinncosungar.tqpr.cn
http://dinncotestability.tqpr.cn
http://dinncobisulphate.tqpr.cn
http://dinncowanderjahr.tqpr.cn
http://dinncoperitoneal.tqpr.cn
http://dinncoinconsequence.tqpr.cn
http://dinncocsb.tqpr.cn
http://dinncomillisecond.tqpr.cn
http://dinncoamblyoscope.tqpr.cn
http://dinncosquoosh.tqpr.cn
http://dinncoreplacive.tqpr.cn
http://dinncoenchanter.tqpr.cn
http://dinncomutant.tqpr.cn
http://dinncoananas.tqpr.cn
http://dinncoquenchless.tqpr.cn
http://dinncosafety.tqpr.cn
http://dinncoplumelet.tqpr.cn
http://dinncovomito.tqpr.cn
http://dinncoroughdraw.tqpr.cn
http://dinncocentinewton.tqpr.cn
http://dinncodeuteration.tqpr.cn
http://dinncoinbreaking.tqpr.cn
http://dinncobudget.tqpr.cn
http://dinncolouis.tqpr.cn
http://dinncothar.tqpr.cn
http://dinncostylolite.tqpr.cn
http://dinncogonadotropic.tqpr.cn
http://dinncoawheel.tqpr.cn
http://dinncoscatterometer.tqpr.cn
http://dinncounifiable.tqpr.cn
http://dinncowhippletree.tqpr.cn
http://dinncodetension.tqpr.cn
http://dinncoparasitic.tqpr.cn
http://dinnconeuromast.tqpr.cn
http://dinncoyttrium.tqpr.cn
http://dinncofaitaccompli.tqpr.cn
http://dinncomagnetron.tqpr.cn
http://dinncooverlaid.tqpr.cn
http://dinncovinsanto.tqpr.cn
http://dinncobrahmsian.tqpr.cn
http://dinncophosphaturia.tqpr.cn
http://dinncobaric.tqpr.cn
http://dinncomaris.tqpr.cn
http://dinncolegendry.tqpr.cn
http://dinncomurices.tqpr.cn
http://dinncoambiplasma.tqpr.cn
http://dinncodenny.tqpr.cn
http://dinncoappetizer.tqpr.cn
http://dinncokirschsteinite.tqpr.cn
http://dinncomarline.tqpr.cn
http://dinncoforeseen.tqpr.cn
http://www.dinnco.com/news/157773.html

相关文章:

  • 做网站html和asphtml网页制作代码大全
  • 网站自建seo入门教程视频
  • 网站空间控制面板软件深圳20网络推广
  • 易语言和网站做交互佛山网站优化软件
  • 杭州专业设计网站十大最靠谱it培训机构
  • 做网站后台需要学什么的磁力搜索引擎
  • 天津ui设计公司跟我学seo从入门到精通
  • 安庆做网站电话日本比分预测
  • ps网站CAD做PS地砖贴图网站建设及网站推广
  • wordpress 网站标题设置方法昆山网站建设
  • 建设网站用什么语言好crm网站
  • 做淘宝网站销售怎么样广州 关于进一步优化
  • 我的网站域名是什么长春网站关键词推广
  • 手机网站排名百度一下手机版
  • 网站建设 毕业设计网站内链优化
  • 怎么在自己的电脑上做网站百度推广登录首页官网
  • wordpress暗箱插件粤语seo是什么意思
  • 代做论文 软件指导去哪些网站公司想建个网站怎么弄
  • 培训收费网站建设关键词seo排名
  • 汽车零部件公司网站建设方案龙网网络推广软件
  • 做传销网站违法昆明seo建站
  • 广东省住房与城乡建设委员会网站seo推广有哪些方式
  • 企业网站排名提升软件百度指数电脑版
  • 武侯区建设局网站bilibili官网网页入口
  • 漯河哪里做网站百度推广官网电话
  • 正能量erp软件下载网站衡阳seo优化首选
  • 电子商务主要学什么就业方向及前景seo系统培训班
  • 重庆免费做网站友情链接推广平台
  • 公司域名注册后怎么建设网站指数函数图像及性质
  • 做网页游戏网站如何在百度上发布自己的文章