- 博客(15)
- 收藏
- 关注
原创 前端通过代理的方式解决跨域和访问不同的端口
这两个路径不能直接访问到后端接口因为是前端自己访问自己,我们需要设置代理,让请求转发到指定的后端接口api。这边有两个后端api,api的端口不同。在 vue.config中的配置。在前端设置axios的基本参数。编写调用api的请求。
2024-06-11 17:00:53
652
原创 前后端分离实现上传图片
前端通过配置代理,将/dev-api/代理到localhost:8080,代理到后端服务器上。通过服务地址映射到本地地址,这样前端就可以通过相对地址访问到在本地上的图片文件了。先将图片保存到本地,然后返回给前端一个带/dev-api/的相对路径。最主要的是后端要开开启服务端和本地的映射。
2023-09-26 17:15:59
449
原创 HandlerInterceptor 拦截器拿不到前端请求的token的问题
OPTIONS请求是需要放行的,放行之后就可以拿到token了。
2023-09-23 13:26:51
441
1
原创 Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2打包springboot项目时候遇到打包失败添加配置跳过测试阶段可以打包了。 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-
2022-03-20 21:07:22
456
原创 nacos操作
命名空间:命名空间是用来做配置隔离默认:public,默认新增的配置都在public空间。如果bootstrap.properties没有指定spring.cloud.nacos.config.namespace(命名空间)则默认才用public命名空间里的内容。命名空间的作用:(1)可以用来做环境隔离。(2)可以为每一个微服务配置隔离,为每一个微服务创建命名空间。配置集:所有配置的集合配置集ID:类似文件名。Data ID就是配置集id配置分组:默认所有的配置集都属于:DEFA
2022-03-04 19:46:39
374
原创 如何使用nacos作为配置中心
1、首先引入依赖<dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId></dependency>2、创建bootstrap.properties文件,并且配置两条配置spring.application.name=应用名spring.cloud.na
2022-03-04 17:20:16
765
原创 guli商城笔记 docker下载nginx
随便启动一个 nginx 实例,没有的话docker会自动下载,为了复制配置docker run -p 80:80 --name nginx 然后进入的mydata文件,讲容器内的配置文件拷贝到当前目录docker container cp nginx:/etc/nginx .后面有.将配置文件复制出来之后就可以把正在运行的nginx实例停掉了docker stop nginx然后将nginx镜像删除掉docker rm nginx为了目录更有结构,给当前nginx文件夹进行改名
2022-01-19 15:51:19
1872
原创 linux安装docker
1、先卸载docker,如果没有安装可以无视sudo yum remove docker \docker-client \docker-client-latest \docker-common \docker-latest \docker-latest-logrotate \docker-logrotate \docker-engine2、安装docker-cesudo yum install -y yum-utils \device-mapper-persistent-data \
2022-01-17 18:09:12
108
原创 对一张表进行修改,where条件或修改的值是子查询
写项目的时候遇到一个问题,对一张表进行修改,但是修改的值需要使用子查询查询这张表获得,sql语句为update banner b, (select * from banner where id = 5) cset b.sort = c.sort where 条件;需要用到临时表下面写对修改条件使用子查询的语句update banner set sort = sort-1 where sort > (select sort from (select sort from bann
2022-01-03 23:19:51
436
原创 vagrant开启密码登录功能,使用xshell连接虚拟机
vagrant开启密码登录功能首先切换到root用户su root然后修改指定位置的配置文件vi /etc/ssh/sshd_config找到passwordAuthentication 把no修改为yes修改成功之后重启服务service sshd restart到此就设置完成了...
2021-12-14 00:05:17
2621
原创 The user that is running Vagrant doesn‘t have the proper permissions to write a Vagrantfile to the s
The user that is running Vagrant doesn't have the proper permissionsto write a Vagrantfile to the specified location. Please ensure thatyou call `vagrant init` in a location where the proper permissionsare in place to create a Vagrantfile.vagrant初始化遇到
2021-12-13 22:49:23
1578
原创 Spring整合mybatis
Spring整合mybatisSqlSessionFactoryBuilderSqlSessionFactory需要的jar包>mybatis>spring>others <!--mybatis--> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifact
2020-09-16 00:31:10
109
原创 SpringIOC注入
SpringIOC扩展使用IOC注解,IOC编程思想实现显示用户信息功能理解构造注入掌握使用注解IOC的方法理解不同数据的注入方法操作步骤1、新创建一个maven项目选择maven为项目取一个名字2,在新创建的项目中引入SpringIOC依赖和其他所用到的依赖,例如test注解依赖`// springIOC依赖 <dependency> <groupId>org.springframework</groupId>
2020-09-10 01:39:31
151
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅