JavaWeb
Jancoyan
天真的理想主义者。
展开
-
springboot接收图片报错 request is not a multipart request 和 multipart boundary was found
后台接收图片报错 request is not a multipart request 和 multipart boundary was foundrequest is not a multipart request 可能是因为前端没有指定请求头 Content-Type 为 multipart/form-data ,但是这个请求头不必在headers中指定。如果直接在headers中指定,后端会因为检测不到 multipart boundary 而报错 the request was rejected原创 2021-10-19 12:48:50 · 2641 阅读 · 1 评论 -
vue局部组件引用报错For recursive components, make sure to provide the “name“ option.
组件在引用的时候不能加大括号错误代码:import {CropperImage} from './component/CropperImage'正确代码:import CropperImage from './component/CropperImage'原创 2021-10-18 18:28:12 · 1074 阅读 · 0 评论 -
vue-element-admin+Axios跨域请求session不一致问题
vue-element-admin+Axios跨域请求session不一致问题场景复现前端:Vue-Cli + Axios + Node.js + vue-element-admin后端:Spring Boot数据库:MySQL + Redis在做用户注册的验证码功能的时候,前端发起请求,后端生成验证码图片发送到前端,并将验证码字符串存放到session中,但是在前端输入表单发送注册请求的时候,一直显示注册失败,通过调试发现两次请求的SessionID不同。解决步骤设置proxy代理(原创 2021-10-17 22:17:27 · 707 阅读 · 1 评论 -
远程连接阿里云mysql数据库Access denied for user ‘root‘@‘IP地址‘(using password: YES)
处理思路与本地出现的Access denied for user ‘root‘@‘localhost‘类似解决方案首先保证阿里云安全组的3306端口处于开放状态!!首先保证阿里云安全组的3306端口处于开放状态!!首先保证阿里云安全组的3306端口处于开放状态!!Linux端:关闭mysql服务service mysql stop修改配置文件跳过grant-tables;sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf上面是mysql8.0.原创 2021-08-24 12:40:16 · 675 阅读 · 0 评论 -
已拦截跨源请求:同源策略禁止读取远程资源,不允许有多个或缺少Access-Control-Allow-Origin CORS头
Vue + SpringBoot开发移动端app问题:无法跨源进行请求,不允许有多个CORS头解决方案:后端添加过滤器,开放远程资源的读取/** * @Author: Jancoyan * @Date: 2021/8/23 * @Description: * @Version: 1.0 */package com.jancoyan.commentset.config;import org.springframework.web.servlet.HandlerInterceptor;原创 2021-08-23 14:14:07 · 1265 阅读 · 0 评论 -
Ubuntu20.10中连接mysql8.0时报错:Access denied for user ‘root‘@‘localhost‘
解决方案关闭服务service mysql stop修改配置文件跳过grant-tablessudo vim /etc/mysql/mysql.conf.d/mysqld.cnf---在mysqld下面写 skip-grant-tables[mysqld]skip-grant-tables启动服务登录service mysql start修改密码:进入mysql数据库,查看user和hostmysql> use mysql;mysql> select user原创 2021-07-12 14:46:30 · 306 阅读 · 0 评论 -
ubuntu彻底卸载mysql
转载自 https://www.cnblogs.com/yixius/articles/6971585.html删除mysql的数据文件sudo rm /var/lib/MySQL/ -R删除mysql的配置文件sudo rm /etc/mysql/ -R自动卸载mysql(包括server和client)sudo apt-get autoremove mysql* --purgesudo apt-get remove apparmor检查是否卸载干净dpkg -l | grep my.转载 2021-07-12 14:08:57 · 561 阅读 · 0 评论 -
记一次 “HTTP 405 Method Not Allowed”的解决方法
写一个个人博客,在提交表单的时候一直显示 HTTP 405 Method Not Allowed,不支持Post方法。后端接口有写RequestMapping路径,起初以为是请求方式的问题,遂更改uri和请求方式,多次无果。最后发现并不是请求方式的问题,而是数据库的问题。在进行后端controller的业务逻辑的时候出现了bug,导致了前端显示 HTTP405 ,其实并不是网络的问题而是后端业务逻辑的问题在controller中使用ActiveRecord进行数据插入,目标表的主键设置为了自增我以原创 2021-07-03 13:03:35 · 1367 阅读 · 0 评论 -
Whitelabel Error Page启动类在包目录下仍然出现
最近在学习SpringBoot的时候新建项目之后经常遇到 Whitelabel Error Page 的情况,经检查之后发现程序启动类在包的根目录下,但是就是Whitelabel Error Page。最后发现是yml配置文件中没有配置mvc的相关配置:修改之前的内容spring: datasource: type: com.alibaba.druid.pool.DruidDataSource driver-class-name: com.mysql.cj.jdbc.Driver原创 2021-06-28 22:19:11 · 582 阅读 · 3 评论 -
Required request part ‘editormd-image-file‘ is not present
Required request part ‘editormd-image-file’ is not present我是用的SSM框架搭建的博客系统,使用editormd进行图片上传的时候遇到了问题:后端报错Required request part 'editormd-image-file' is not present前端报错cannot parse json... // 具体错误记不清了,反正就是不能把一个对象转换为json格式废话不多说,直接上解决方案。SpringMVC处理Multipa原创 2021-05-01 22:34:38 · 318 阅读 · 0 评论 -
MyBatis逆向工程 - MyBatis Generator的使用
MyBatis逆向工程 - MyBatis Generator的使用官网 : http://mybatis.org/generator/添加依赖 或者 引入jar包 <!-- pom.xml --> <!-- MBG --> <!-- https://mvnrepository.com/artifact/org.mybatis.generator/mybatis-generator-core --> <dependency&g原创 2021-03-21 10:51:50 · 113 阅读 · 0 评论