升级V2.0.0指南
从V1.2.1版本升级到V2.0.0版本相关步骤,数据库未变更。
后端升级
建议: cloneapp-parent项目,再根据自己项目实际情况来删减配置
# clone 2.0版本的模板项目进行微服务架构项目搭建
git clone -b v2.0 http://git.spm.wiseda.com.cn:2080/D20002ZK/app-parent.git
- waf-parent依赖升级
后端只要将pom.xml中引用waf-parent版本改为2.0.0即可,启动后测试功能是否正常
<parent>
<groupId>com.wiseda.waf</groupId>
<artifactId>waf-parent</artifactId>
<version>2.0.0</version>
</parent>
- Application注解添加
添加@EnableDiscoveryClient、@EnableFeignClients两个注解,
@EnableFeignClients为必须添加,因框架中的接口调用已改为Feign实现
@EnableDiscoveryClient为可选,如不需要服务注册、发现、配置可不启用,相应的yaml、jar包都可以进行排队
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
public class ServerApplication {
......
}
- 添加FeignInterceptor拦截器
app-parent项目中com.wiseda.xxx.config.FeignInterceptor路径
- MybatisPlusConfig 修改
// 移除configurationCustomizer mybatis-plus 3.4.3版本已没有该配置
@Bean
public ConfigurationCustomizer configurationCustomizer() {
return configuration -> configuration.setUseDeprecatedExecutor(false);
}
- Swagger配置修改 原
@EnableSwagger2、@EnableKnife4j注解调整为@EnableSwagger2WebMvc
@Configuration
@EnableSwagger2WebMvc
public class Swagger2Config implements WebMvcConfigurer {
......
}
通过在application.yml配置knife,可开启认证、是否生产模式,原waf.swagger.enable属性移除
# api文档配置
knife4j:
# 启用增强模式才可以使用下列配置
enable: true
# 是否生产环境(禁用api文档)
production: false
basic:
# 启用基本用户/密码认证
enable: true
username: admin
password: 123456
前端升级
- Vue2版本升级
# 查看当前项目远程仓库信息
git remote -v
# 配置一个远程仓库(fork过来的那个地址,waf-web-origin这个名字自己随意命名,不要跟现有的冲突就是了)
git remote add waf-web-origin http://git.spm.wiseda.com.cn:2080/D20002ZK/waf-web.git
# 拉取基础框架版本
git fetch waf-web-origin
# 合并基础框架master分支到本地应用
git merge waf-web-origin/v2.0
# 查看文件状态列表
git status
# 如有冲突的文件,解决冲突提交
git push
- Vue3版本下载
# clone vue3版本项目
git clone http://git.spm.wiseda.com.cn:2080/D20002ZK/waf-web-vue3.git
# 安装、运行
npm install
npm run dev
