当前位置: 首页 > news >正文

ruoyi-vue初步接触

因为最近参加了一个比赛,培训的时候说最终考试是要求使用ruoyi-vue来做功能,于是我在网上找到了ruoyi这个项目,准备给他搭建起来。

找了一下官网 发现了这个 准备工作

 然后我就开始查看本机环境

java --version
openjdk 21.0.8 2025-07-15
OpenJDK Runtime Environment (build 21.0.8+9-Ubuntu-0ubuntu122.04.1)
OpenJDK 64-Bit Server VM (build 21.0.8+9-Ubuntu-0ubuntu122.04.1, mixed mode, sharing)
mysql --version
mysql  Ver 8.0.43-0ubuntu0.22.04.1 for Linux on x86_64 ((Ubuntu))

还有个 Maven ,我发现这个我没有,就赶紧去装一个 还是apt命令老一套

sudo apt install maven

然后看看版本

mvn --version
Apache Maven 3.6.3
Maven home: /usr/share/maven

好了,然后去克隆仓库

就 git clone 呗

git clone https://gitee.com/y_project/RuoYi.git

然后,就是来到仓库下面,给那个 ruoyi-admin/src/main/resources/application-druid.yml 文件里面的连接数据库的信息改改,就是这段

            master:url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                username: rootpassword: root

配置完了,就把数据库也对应的导入一下。

mysql> create database `ry-vue` charset utf8mb4;
Query OK, 1 row affected (0.03 sec)mysql> use `ry-vue`
Database changed

然后导进去数据库文件 mysql> source /home/zhaoyao/script/java/RuoYi-Vue/sql/ry_20250522.sql; 

好了,然后数据库创建好了。

来到仓库目录下,ll 命令看一下列表

ll
total 76K
drwxrwxr-x 2 zhaoyao zhaoyao 4.0K  9月  8 17:57 bin
drwxrwxr-x 2 zhaoyao zhaoyao 4.0K  9月  8 17:57 doc
-rw-rw-r-- 1 zhaoyao zhaoyao 1.1K  9月  8 17:57 LICENSE
-rw-rw-r-- 1 zhaoyao zhaoyao  10K  9月  8 17:57 pom.xml
-rw-rw-r-- 1 zhaoyao zhaoyao 9.7K  9月  8 17:57 README.md
drwxrwxr-x 4 zhaoyao zhaoyao 4.0K  9月 16 14:34 ruoyi-admin
drwxrwxr-x 4 zhaoyao zhaoyao 4.0K  9月 16 14:34 ruoyi-common
drwxrwxr-x 4 zhaoyao zhaoyao 4.0K  9月 16 14:34 ruoyi-framework
drwxrwxr-x 4 zhaoyao zhaoyao 4.0K  9月 16 14:34 ruoyi-generator
drwxrwxr-x 4 zhaoyao zhaoyao 4.0K  9月 16 14:34 ruoyi-quartz
drwxrwxr-x 4 zhaoyao zhaoyao 4.0K  9月 16 14:34 ruoyi-system
drwxrwxr-x 7 zhaoyao zhaoyao 4.0K  9月 16 14:33 ruoyi-ui
-rw-rw-r-- 1 zhaoyao zhaoyao 1.6K  9月  8 17:57 ry.bat
-rw-rw-r-- 1 zhaoyao zhaoyao 1.7K  9月  8 17:57 ry.sh
drwxrwxr-x 2 zhaoyao zhaoyao 4.0K  9月  8 17:57 sql

然后 执行  mvn clean install -Dmaven.test.skip=true 

提示一大堆,然后就看到这个

[INFO] ruoyi .............................................. SUCCESS [  0.116 s]
[INFO] ruoyi-common ....................................... SUCCESS [  2.147 s]
[INFO] ruoyi-system ....................................... SUCCESS [  0.365 s]
[INFO] ruoyi-framework .................................... SUCCESS [  0.411 s]
[INFO] ruoyi-quartz ....................................... SUCCESS [  0.142 s]
[INFO] ruoyi-generator .................................... SUCCESS [  0.220 s]
[INFO] ruoyi-admin ........................................ SUCCESS [  0.865 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.402 s
[INFO] Finished at: 2025-09-16T15:02:54+08:00
[INFO] ------------------------------------------------------------------------

说明这一步成功了,然后有可能中间提示什么没有ruoyi的文件夹来记录日志,那你手动创建一个 并且给权限就好了。

然后来到后端 

cd ruoyi-admin/target

再执行 

java -jar ruoyi-admin.jar

就看到了如下效果

java -jar ruoyi-admin.jar
Application Version: 3.9.0
Spring Boot Version: 2.5.15
////////////////////////////////////////////////////////////////////
//                          _ooOoo_                               //
//                         o8888888o                              //
//                         88" . "88                              //
//                         (| ^_^ |)                              //
//                         O\  =  /O                              //
//                      ____/`---'\____                           //
//                    .'  \\|     |//  `.                         //
//                   /  \\|||  :  |||//  \                        //
//                  /  _||||| -:- |||||-  \                       //
//                  |   | \\\  -  /// |   |                       //
//                  | \_|  ''\---/''  |   |                       //
//                  \  .-\__  `-`  ___/-. /                       //
//                ___`. .'  /--.--\  `. . ___                     //
//              ."" '<  `.___\_<|>_/___.'  >'"".                  //
//            | | :  `- \`.;`\ _ /`;.`/ - ` : | |                 //
//            \  \ `-.   \_ __\ /__ _/   .-` /  /                 //
//      ========`-.____`-.___\_____/___.-`____.-'========         //
//                           `=---='                              //
//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^        //
//             佛祖保佑       永不宕机      永无BUG               //
////////////////////////////////////////////////////////////////////
15:07:28.893 [background-preinit] INFO  o.h.v.i.util.Version - [<clinit>,21] - HV000001: Hibernate Validator 6.2.5.Final
15:07:28.894 [main] INFO  c.r.RuoYiApplication - [logStarting,55] - Starting RuoYiApplication using Java 21.0.8 on lnb000597chn with PID 73476 (/home/zhaoyao/script/java/RuoYi-Vue/ruoyi-admin/target/ruoyi-admin.jar started by zhaoyao in /home/zhaoyao/script/java/RuoYi-Vue/ruoyi-admin/target)
15:07:28.895 [main] DEBUG c.r.RuoYiApplication - [logStarting,56] - Running with Spring Boot v2.5.15, Spring v5.3.39
15:07:28.895 [main] INFO  c.r.RuoYiApplication - [logStartupProfileInfo,686] - The following 1 profile is active: "druid"
15:07:30.300 [main] INFO  o.a.c.h.Http11NioProtocol - [log,168] - Initializing ProtocolHandler ["http-nio-8080"]
15:07:30.302 [main] INFO  o.a.c.c.StandardService - [log,168] - Starting service [Tomcat]
15:07:30.302 [main] INFO  o.a.c.c.StandardEngine - [log,168] - Starting Servlet engine: [Apache Tomcat/9.0.108]
15:07:30.341 [main] INFO  o.a.c.c.C.[.[.[/] - [log,168] - Initializing Spring embedded WebApplicationContext
15:07:30.811 [main] DEBUG c.r.f.s.f.JwtAuthenticationTokenFilter - [init,242] - Filter 'jwtAuthenticationTokenFilter' configured for use
15:07:31.283 [main] INFO  c.a.d.p.DruidDataSource - [init,1002] - {dataSource-1} inited
15:07:31.697 [main] DEBUG c.r.s.m.S.selectDictDataList - [debug,135] - ==>  Preparing: select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark from sys_dict_data WHERE status = ? order by dict_sort asc
15:07:31.803 [main] DEBUG c.r.s.m.S.selectDictDataList - [debug,135] - ==> Parameters: 0(String)
15:07:31.820 [main] DEBUG c.r.s.m.S.selectDictDataList - [debug,135] - <==      Total: 29
15:07:32.185 [main] DEBUG c.r.s.m.S.selectConfigList - [debug,135] - ==>  Preparing: select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark from sys_config
15:07:32.186 [main] DEBUG c.r.s.m.S.selectConfigList - [debug,135] - ==> Parameters: 
15:07:32.188 [main] DEBUG c.r.s.m.S.selectConfigList - [debug,135] - <==      Total: 8
15:07:32.538 [main] INFO  o.q.i.StdSchedulerFactory - [instantiate,1220] - Using default implementation for ThreadExecutor
15:07:32.546 [main] INFO  o.q.c.SchedulerSignalerImpl - [<init>,61] - Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
15:07:32.547 [main] INFO  o.q.c.QuartzScheduler - [<init>,229] - Quartz Scheduler v.2.3.2 created.
15:07:32.547 [main] INFO  o.q.s.RAMJobStore - [initialize,155] - RAMJobStore initialized.
15:07:32.548 [main] INFO  o.q.c.QuartzScheduler - [initialize,294] - Scheduler meta-data: Quartz Scheduler (v2.3.2) 'quartzScheduler' with instanceId 'NON_CLUSTERED'Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.NOT STARTED.Currently in standby mode.Number of jobs executed: 0Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads.Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.15:07:32.548 [main] INFO  o.q.i.StdSchedulerFactory - [instantiate,1374] - Quartz scheduler 'quartzScheduler' initialized from an externally provided properties instance.
15:07:32.548 [main] INFO  o.q.i.StdSchedulerFactory - [instantiate,1378] - Quartz scheduler version: 2.3.2
15:07:32.548 [main] INFO  o.q.c.QuartzScheduler - [setJobFactory,2293] - JobFactory set to: org.springframework.scheduling.quartz.SpringBeanJobFactory@50211483
15:07:32.564 [main] DEBUG c.r.q.m.S.selectJobAll - [debug,135] - ==>  Preparing: select job_id, job_name, job_group, invoke_target, cron_expression, misfire_policy, concurrent, status, create_by, create_time, remark from sys_job
15:07:32.565 [main] DEBUG c.r.q.m.S.selectJobAll - [debug,135] - ==> Parameters: 
15:07:32.567 [main] DEBUG c.r.q.m.S.selectJobAll - [debug,135] - <==      Total: 3
15:07:33.310 [main] INFO  o.a.c.h.Http11NioProtocol - [log,168] - Starting ProtocolHandler ["http-nio-8080"]
15:07:33.479 [main] INFO  o.q.c.QuartzScheduler - [start,547] - Scheduler quartzScheduler_$_NON_CLUSTERED started.
15:07:33.487 [main] INFO  c.r.RuoYiApplication - [logStarted,61] - Started RuoYiApplication in 4.842 seconds (JVM running for 5.188)
(♥◠‿◠)ノ゙  若依启动成功   ლ(´ڡ`ლ)゙  .-------.       ____     __        |  _ _   \      \   \   /  /    | ( ' )  |       \  _. /  '       |(_ o _) /        _( )_ .'         | (_,_).' __  ___(_ o _)'          |  |\ \  |  ||   |(_,_)'         |  | \ `'   /|   `-'  /           |  |  \    /  \      /           ''-'   `'-'    `-..-'              

这说明后端启动成功,然后再开个命令行窗口来到前端 cd ruoyi-ui/ 

先执行

npm install

再执行

npm run dev

如果提示说 vue-cli-service 没权限 那你就给他加可执行权限就行

chmod +x node_modules/.bin/vue-cli-service

如果运行成功,会自动打开浏览器,就是这个界面

image

如果失败是有可能提示,ENOSPC: System limit for number of file watchers reached

那就按下面的做,不过这个重启后失效

# 临时将 max_user_watches 设置为 524288
sudo sysctl fs.inotify.max_user_watches=524288
# 使更改立即生效
sudo sysctl -p

想要永久生效,得改那个文件 /etc/sysctl.conf ,里面增加一行 fs.inotify.max_user_watches=524288 

然后,好了,你就可以用这套系统了,这套系统总体来说上手难度不大,还能自动生成代码,也还是不错的。

 

http://www.zskr.cn/news/6006.html

相关文章:

  • AT_arc180_c [ARC180C] Subsequence and Prefix Sum
  • 如何快速看懂「祖传项目」?Qoder 强势推出新利器
  • 测试不再碎片化:AI智能体平台「项目资料套件」功能上线!
  • 充气泵方案:充气泵用数字传感器有什么好处?
  • mysql查看连接数,从查询到优化
  • Saga分布式事务框架执行逻辑
  • Microsoft AI Genius | 第三集实战课正式开启:用 Copilot Studio 定制你的专属智能体
  • 基于MATLAB的图像融合拼接GUI系统设计
  • Python使用多线程和异步调用
  • 基于MATLAB/Simulink的TI2000系列DSP模型设计
  • 挖矿木马病毒清理手册
  • Python常见函数和代码示例
  • keil5中stm32相关记录
  • centos7中安装protobuf-c
  • MyEMS:赋能每一个组织,成为自己的能源管理专家
  • Vue开发微信公众号上传图片
  • 栈的妙用:如何优雅地处理括号匹配难题 (C语言版)
  • 食品包装 AI 视觉检测技术:原理、优势与数据应用解析
  • 电流探头的常见应用场景
  • PC桌面应用开发选择
  • 无需复杂正则:SLS 新脱敏函数让隐私保护更简单高效
  • PLC结构化文本设计模式——适配器模式(Adapter Pattern)
  • 深入浅出 Java 多线程:从线程生命周期到并发安全
  • 实用指南:LINUX910 CENTOS8 新建虚拟机;重设root密码/时间同步
  • 零基础学习PYthon记录
  • Grafana 中文入门教程 | 构建你的第一个仪表盘
  • Topaz Photo AI Pro 4.0.4 AI图片智能降噪
  • Edge浏览器网页长截图
  • C++多线程编程—线程控制、同步与互斥详解
  • mac 的任务栏 Windows-Style Taskbar For macOS