若依框架使用

本文档记录了若依框架的后端和前端启动步骤,包括创建数据库、导入数据、启动服务等。在后端启动时需注意Redis服务的开启,前端启动时需配置VUE_APP_BASE_API,并解决npm命令的执行问题。对于npm安装慢的问题,建议通过更换registry来加速。在遇到'vue-cli-service'命令找不到时,需确保Node.js和npm已正确安装。只有前后端同时运行,项目才能正常访问。
摘要由CSDN通过智能技术生成

刚入行新人,部门未来使用若依框架进行开发,转载前辈遇到的问题,并记录自己的使用

原文链接:https://blog.csdn.net/m0_53313913/article/details/112452126

 

运行:

#后端

1.创建数据库ry-vue并导入数据脚本ry_2021xxxx.sqlquartz.sql
2.打开项目运行com.ruoyi.RuoYiApplication.java,出现如下图表示启动成功

#前端

# 进入项目目录
cd ruoyi-ui

# 安装依赖
npm install

# 强烈建议不要用直接使用 cnpm 安装,会有各种诡异的 bug,可以通过重新指定 registry 来解决 npm 安装速度慢的问题。
npm install --registry=https://registry.npmmirror.com

# 本地开发 启动项目
npm run dev

输入:(http://localhost:80 (opens new window)) 默认账户/密码 admin/admin123

​​​​​​​

问题:
#后端

1.注意配置中的mysql的密码和数据库是否正确

2.Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘sysConfigController’: 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 localhost:6379
原因:没有安装redis(注意)要把redis服务开启才可以跑起来,用dos窗口进入redis跟目录输入redis-server redis.windows.conf
下载网址:https://github.com/tporadowski/redis/releases。

前端
1.在src中的env.development中修改成VUE_APP_BASE_API = ‘http://localhost:8080/citywater’(8080是自己在后端server配置中设置的接口,citywater是自己在后端server中context-path的内容)
2.添加npm(这个要下载nodejs)再配置,但是会报这个错
‘vue-cli-service’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ruoyi@3.3.0 dev: vue-cli-service serve
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ruoyi@3.3.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\blingbling\AppData\Roaming\npm-cache_logs\2021-01-10T10_04_42_947Z-debug.log
解决方案:下一个nodejs之后.在dos窗口中可以用node-v和npm -v检查是否安装成功再用。用dos命令进入若依前段项目ruoyi-ui中输入npm install --registry=thhp://registry.npm.taobao.org;

前后端要同时运行才可以进入
 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值