下载若依前后端版本并在本地运行
参考视频:https://www.bilibili.com/video/BV1HT4y1d7oA/?spm_id_from=333.337.search-card.all.click&vd_source=0dcc3acedc4fc1c77ebc9bfbcbd12cec
若依
what?
开源项目,二次开发来完成自己的任务。
是一个数据和用户权限管理系统
三个版本:ruoyi:springboot、ruoyi-vue前后端分离、cloud微服务(换后台为springcloud)
官网:https://www.ruoyi.vip/
why?
功能完整,文档丰富,包括前后端、数据库,可以减少工作量。
学习优秀开源项目底层的编程思想,提高自己的编程能力。
how?
前期准备:
基础:SpringBoot+Vue(可以先学习 楠)
环境:
1、JDK cmd→java -version→1.8.0
2、MySQL:业务数据 Redis:缓存数据
3、Maven:基于此构建环境
4、Vue
如何使用开源项目?
下载并运行、看懂业务流程→二次开发
1、下载:
Q1:idea-如何从GitHub/GITEE下载项目?
复制下载链接→file(version control)→directory(本地存放根目录)
项目架构:
ruoyi-ui 前台 纯vue工程 单独打开
其余ruoyi-后台 后台跑admin,其余是工具类
2、运行
2.1 启动后台:
2.1.1 安装redis
https://github.com/tporadowski/redis/releases
https://github.com/lework/RedisDesktopManager-Windows/releases
端口号:6379
安装:https://www.bilibili.com/video/BV17D4y1M7ha/?spm_id_from=333.337.search-card.all.click&vd_source=0dcc3acedc4fc1c77ebc9bfbcbd12cec
2.1.2 配置数据库MySQL
执行sql脚本
https://blog.csdn.net/Freer_von/article/details/126362573
Q2:执行sql脚本时出现报错
解决:https://stackoverflow.com/questions/4005409/error-1046-no-database-selected-how-to-resolve
指明数据库 在两个sql文件前加
结果:成功导入
修改application-druid.yml:
2.1.3 配置redis
修改application.yml的host:
2.1.4 运行
Q:运行报错
[org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘captchaController’: Unsatisfied dependency expressed through field ‘configService’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sysConfigServiceImpl’: Invocation of init method failed; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; nested exception is org.springframework.data.redis.connection.PoolException: Could not get a resource from the pool; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to redis_win:6379
](org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘captchaController’: Unsatisfied dependency expressed through field ‘configService’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sysConfigServiceImpl’: Invocation of init method failed; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; nested exception is org.springframework.data.redis.connection.PoolException: Could not get a resource from the pool; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to redis_win:6379
解决:redis配置有误 改redis_win为127.0.0.1即可
2.1.5 启动成功
2.2 启动前台
单独打开ruoyi-ui
运行npm install 和npm run dev
启动成功