- 博客(91)
- 收藏
- 关注
原创 解决Navicat中2059 - Authentication plugin ‘caching sha2 password‘ cannot be loaded的问题
出现这个原因是mysql8 之前的版本中加密规则是mysql_native_password,而在mysql8之后,加密规则是caching_sha2_password(高版本navicat没有问题,高版本已经兼容了解决这个问题)。使用navicat连接MySQL(8.0及以上),出现提示:2059 - Authentication plugin ‘caching sha2 password’ cannot be loaded。最后再去连接测试,问题就解决了。win键+R进入命令模式;
2023-09-02 10:45:49
1409
原创 接口鉴权和通过注解鉴权接口访问
}// 如果不是映射到方法直接通过 if(!logger . info("请求的接口路径==========>{}" , servletPath);if(!//1.接口参数非空验证 if(StringUtils . isEmpty(token)) {os . write(JSON . toJSONString(new ResponseBean(ResponseBean . ERROR , "接口参数验证未通过")) . getBytes());
2023-07-14 16:45:03
501
原创 下载(导出)pdf模板文件(比如:审批单),报错:Invalid nested tag *** found, expected closing tag ***
html转xhtml格式化
2022-06-29 11:31:15
1633
原创 微信公众号开发相关流程及功能介绍
进入的网址:https://mp.weixin.qq.com。测试号(网址:https://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=sandbox/login),用户在开发之前可以通过测试号快速测试开发,但是测试号的接口能力有限,只限测试使用。1.1.1 订阅号适用于个人和组织,群发消息1条/天,消息展示在订阅号列表里,有基础消息接口,可以自定义菜单,无微信支付功能。1.1.2 服务号不适用于个人,群发消息4条/月,消息展示在会话表里,有基础消息接口,有高级接
2022-06-28 18:13:09
7979
原创 react(hooks)使用quill富文本编辑器(富文本中图片使用对象存储的方式)
难点:图片是对象存储,图片URL是存在有效期的,所以系统做了定时任务更新图片,数据库存储该字段内容时只存储对象存储的KEY(不存在URL),当定时任务来执行更新的时候,要查找到符文本中的图片KEY就相当的困难,甚至容易更新出错的可能解决思路:富文本中存在的图片KEY,再单独创建一个字段存储(多个图片可以使用中间表或者用特殊符号分隔这些KEY),在查询时(或更新时)通过该字段中KEY先通过缓存拿到URL,然后去富文本内容中通过KEY替换成URL,达到前端显示是图片URL,存储在表中是KEY,定时任务只需要更
2022-06-10 17:35:39
2282
原创 SM2 国密加密加签操作工具
pom引入依bouncycastle赖注意:bouncycastle版本过低会出现报错(我之前报错的的版本号1.60,修改后使用的1.68)<dependency> <groupId>org.bouncycastle</groupId> <artifactId>bcprov-ext-jdk15to18</artifactId> <version>1.68</version></depe.
2022-05-23 09:49:54
8171
原创 微信H5拉起(跳转)微信小程序
main.js配置忽略wx-open-launch-weappVue.config.ignoredElements = ['wx-open-launch-weapp'];template<template> <view class="index-wrapper"> <view class="wrapper"> <view class="">点击下面按钮跳转</view> <wx-open-launch-wea.
2022-05-13 10:56:18
2156
原创 解决request的输入流只能读取一次(获取body中的数据)
定义一个RequestWrapper类继承HttpServletRequestWrapperpublic class RequestWrapper extends HttpServletRequestWrapper { private final String body; public RequestWrapper(HttpServletRequest request) { super(request); StringBuilder stringBui.
2022-05-07 09:29:18
854
原创 uniapp 自定义弹框
实现:通过v-if(v-show)控制弹窗的显示与隐藏界面代码<template> <view class="coupon-wrapper"> <text class="coupon-desc" @tap="viewVouponCode">点击查看券号</text> <view class="coupon-voucher-code-popup" v-if="showVoucherCode"> <view class="
2022-04-26 17:39:57
3423
2
原创 docker安装各种软件
配置镜像加速(腾讯云)执行以下命令,打开 /etc/docker/daemon.json 配置文件vim /etc/docker/daemon.json按 i 切换至编辑模式,添加以下内容,并保存{ "registry-mirrors": [ "https://mirror.ccs.tencentyun.com" ]}执行以下命令,重启 Docker 即可sudo systemctl restart docker############docker安
2022-04-12 22:20:44
494
原创 微信网页授权,解决REDIRECT_URL携带#号,微信返回时临时code等参数拼接在URL中间,而不是最后面
微信授权获取临时code的URLhttps://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=snsapi_userinfo&state=012#wechat_redirect授权逻辑代码通过window.history.pushState({}, 0, jumpURL)解决问题=,其中jumpU.
2022-04-12 09:30:57
6669
原创 centos安装mysql8.0
借鉴https://www.cnblogs.com/yaowen/p/9486138.html,写的非常好,很实用,我参考这篇文章安装了自己的MySQL,在这里做了个记录。清理原有的mysql数据库查找已经依赖包rpm -pa | grep mysql删除找到的依赖包yum remove mysql-xxx-xxx-使用find / -name mysql命令找到所有有关mysql的文件,并删除find / -name mysqlrm -rf /var/lib/mysql
2022-04-09 12:04:50
1760
原创 centos 安装iptables防火墙
安装iptables防火墙yum install iptables-services -y启动iptable防火墙systemctl enable iptablessystemctl start iptables编辑防火墙增加端口打开配置文件:vim /etc/sysconfig/iptables增加端口:-A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT重启防火墙systemct.
2022-04-09 11:34:10
926
原创 jenkins相关操作
jdk安装目录:/usr/lib/jvm/java-1.8.0-openjdkinitialAdminPassword文件目录:/data/jenkins_home/secrets/initialAdminPasswordjenkins初始密码: 003c4ab8ed7444b48ac9cd833eb26a0cjenkins账号:userAdmin 密码:qwerty@123# 邮箱:821282316@qq.com服务器信息:39.106.12.77 glp800./启动: service je
2022-04-01 23:23:44
255
原创 centos 搭建maven私服(安装Nexus)
环境搭建1.安装jdk,注意版本要求;2.选择nexus版本,它有两个版本,Nexus Repository Manager OSS 和 Nexus Repository Manager Pro,一般使用前者即可;3.本地下载:https://www.sonatype.com/download-oss-sonatype(或者使用wget命令下载:wget https://sonatype-download.global.ssl.fastly.net/nexus/oss/nexus-3.25.1-04.
2022-03-31 23:17:26
1266
原创 docker安装jenkins记录
启动docker,查找Jenkins镜像文件docker search jenkins下载Jenkins镜像文件(最新)docker pull jenkins/jenkins:lts创建Jenkins挂载目录并授权权限,这样我们就可以很方便地对容器内的配置文件进行修改。mkdir -p /data/jenkins_home/chmod 777 /data/jenkins_home/创建并启动Jenkins容器docker run -d -p 8090:8080 -p 8.
2022-03-30 23:01:04
1431
原创 centOS7按照docker
准备Linux 内核:官方建议 3.10 以上,3.8以上貌似也可注意:本文的命令使用的是 root 用户登录执行,不是 root 的话所有命令前面要加 sudo卸载旧版本(如果之前安装过的话)yum remove docker docker-common docker-selinux docker-engine安装需要的软件包, yum-util 提供yum-config-manager功能,另两个是devicemapper驱动依赖yum install -y yum-util.
2022-03-30 22:18:28
149
原创 微信内嵌H5(uniapp)授权登录(静默授权)
1. 开发前准备注册微信公众号完成信息填写等;配置网页授权域名;2. 前端开发onLoad()中初始化临时codeonLoad(options) { this.initWechatParams();}initWechatParamsasync initWechatParams() { const _this = this; _this.loginParams.appId = "*****"; //解析URL的参数,获取临时code //code作为换取access_t
2022-03-25 14:53:49
4168
原创 微信通过txt文件验证服务器是否可用
控制器@GetMapping("/valid") @ResponseBody public void valid( HttpServletResponse response, @RequestParam(value = "signature") String signature, @RequestParam(value = "timestamp") String timestamp, @RequestParam(value = "nonce") .
2022-03-23 21:28:05
565
原创 微信小程序(uniapp)授权登录
1. 开发前准备2. 前端开发初始化openId和sessionKeyasync initWechat_MP() { const _this = this; console.log('wechat==========>', _this.wechat); if (_this.wechat && _this.wechat.openId && _this.wechat.sessionKey) { return; } uni.login({ su
2022-03-23 21:20:20
2269
原创 微信内嵌H5(uniapp)授权登录(非静默授权)
1. 开发准备在微信后台配置网页授权域名(主要要解决的是微信校验txt文件,开发时在微信开发者工具,我使用的是natapp做域名解析,通过natapp穿透到本地开发测试)IP白名单(不记得需不需要这一步,不需要可以不配置)2. 前端开发第一步:获取临时code(REDIRECT_URI必须是微信后台配置过的网页授权域名)initWechat_H5() { const h5AppId = this.$mStore.getters.globalConfig.wechatH5AppId ||
2022-03-23 21:04:11
1960
原创 微信小程序(uniapp)获取用户位置信息及选择位置
1. 开发前准备注册微信小程序账号并配置相关信息;注册腾讯地图开放平台并完成应用创建等;下载qqmap-wx-jssdk.min.js放到项目中;2. 获取用户当前位置wx.getLocation// #ifdef MP-WEIXINthis.initLocationInfoMP();// #endif//初始化位置initLocationInfoMP() { const _this = this; wx.getLocation({ //type: 'gcj02', //wg
2022-03-23 20:35:57
2419
1
原创 微信内嵌H5(uniapp)获取用户位置信息及打开内置地图
public class Wechat2HTTPConverter extends MappingJackson2HttpMessageConverter {public Wechat2HTTPConverter() { List<MediaType> mediaTypes = new ArrayList<>(); mediaTypes.add(MediaType.TEXT_PLAIN); setSupportedMediaTypes(mediaTypes)
2022-03-23 18:01:37
4064
原创 RestTemplateConfig配置
@Configurationpublic class RestTemplateConfig {private RestTemplateBuilder restTemplateBuilder;public RestTemplateConfig(RestTemplateBuilder restTemplateBuilder) { this.restTemplateBuilder = restTemplateBuilder;}@Beanpublic RestTemplate restTem
2022-03-22 10:22:04
2292
原创 springboot异步处理,自定义线程池
线程池配置类@Configurationpublic class ThreadPoolConfig { @Bean("threadPoolTaskExecutor_1") public ThreadPoolTaskExecutor threadPoolTaskExecutor_1() { System.out.println("线程池threadPoolTaskExecutor1初始化===============>开始:"+ System.currentTi.
2022-03-09 18:54:25
449
原创 微信查询元素信息时boundingClientRect()和exec()区别
参考代码//代码1const query = wx.createSelectorQuery(); query.select('#id').boundingClientRect(res => { console.log('元素', res);}).exec();//代码2const query = wx.createSelectorQuery();query.select('#id').boundingClientRect().exec(resList => { cons.
2022-03-04 10:19:30
1736
原创 微信小程序和公众号(H5)获取元素信息
H5页面// #ifdef H5var query = wx.createSelectorQuery();query.select("#search-bar").boundingClientRect().exec(res => { console.log("searchBar:" + res);});// #endif小程序(非自定义组件)非自定义组件不用加.in(this)// #ifdef MP-WEIXINconst query = wx.createSelecto.
2022-03-04 09:36:18
650
原创 Random使用(实现解决Random低效的问题)
1. 方式一(不推荐,原因是:“Random”对象应该被重用,因为Random每次创建一个随机值时是低效的) ... Random random = new Random(); ...2. 方式二(非静态方法)public class StringUtil { private Random random = SecureRandom.getInstanceStrong(); public String getRandomString(int length) {
2022-01-12 09:35:51
1082
原创 JWT认证
在pom.xml中加入依赖<!-- jwt依赖 --><dependency> <groupId>com.auth0</groupId> <artifactId>java-jwt</artifactId> <version>3.4.0</version></dependency><!-- 相关一些依赖 --><dependency> .
2022-01-06 11:44:08
394
原创 日期检索SQL
开始日期和结束日期都有<if test="query.startDate!= null and query.endDate!= null"> and ( date_col <![CDATA[ >= ]]> concat(convert(varchar, #{query.startDate}), ' 00:00:00') and date_col <![CDATA[ <= ]]> concat(convert(varchar, #{query.end.
2022-01-05 15:49:14
633
1
原创 java 方法重载和重写的区别
比较比较方法重写方法重载发生在父、子类中同一个类中方法名必须相同必须相同参数必须相同(个数、类型、顺序都必须相同)个数或者类型必须不同访问修饰符必须是public不限制访问修饰符类型子类的访问修饰符不能比父类更加严格可以改变访问修饰符异常处理子类的异常不能比父类更大、也不能比父类更多被重载的方法可以声明新的或更多的检查异常返回类型必须相同可以不同总结重载更加灵活,重写限制更多。参照一个网友的总结参.
2021-12-06 18:11:04
188
原创 后端通过session+注解鉴权
pom.xml文件导入依赖<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> <version>2.3.5.RELEASE</version></dependency><dependency> .
2021-12-02 17:58:59
294
原创 前后端分离项目通过注解+拦截器鉴权
注解类(Authorized.java)@Documented@Inherited@Target({ElementType.TYPE, ElementType.METHOD})@Retention(RetentionPolicy.RUNTIME)public @interface Authorized {}拦截器处理类(AuthInterceptor.java)public class AuthInterceptor extends HandlerInterceptorAdapte.
2021-11-25 19:29:32
460
原创 前后端分离项目通过header参数鉴权
前端,在请求头加上鉴权参数const apiKey = '******'const echo = '随机字符串';const timestamp = new Date().getTime();headers: { 'Content-Type': 'application/json;charset=utf-8', 'Cache-Control': 'no-cache;max-age=0', 'Pragma': 'no-cache', 'x-echo-key': ech.
2021-11-25 19:07:25
1078
原创 uniapp 组件封装-图片选择
在目录components下创建文件夹image目录,在image目录下创建index.vue文件,代码如下:<template name="avatar"> <view> <image :src="imgSrc.imgSrc" @tap="fSelect" :style="[imgStyle]" class="my-avatar" ></image> <canvas canvas-id="avatar-.
2021-09-29 11:26:08
423
原创 mybatis batch操作
批量插入<insert id="insertBatch" parameterType="java.util.List"> insert into tablename ( column_01, column_02, column_03 ) values <foreach collection="list" item="item" separator="," index="index"> ( .
2021-09-28 17:50:30
360
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人