JEECG-页面按钮图标存放地址

本文详细介绍了如何在JEECG页面中使用easyui图标作为按钮图标,并通过themes文件夹下的icon.css进行样式配置。包括文件存放路径、样式引用及应用示例。

JEECG页面按钮图标是用的easyui的图标,放到WebRoot\plug-in\easyui\themes\icons\文件夹下

并且用themes文件夹下的icon.css作为样式文件

 

感谢你的补充说明!你描述的结构是 **JeecgBoot 3.x 版本(尤其是基于 Spring Boot 3 + 分层架构)的新模块化设计**,与旧版有所不同。 --- ### 🔍 当前项目结构分析 ``` jeecg-boot/ ├── jeecg-boot-system/ ← 系统模块根目录 │ ├── jeecg-boot-api/ ← 提供接口定义(DTO、Feign 接口等) │ │ └── pom.xml │ ├── jeecg-boot-biz/ ← 业务实现模块(Service、Controller、ServiceImpl) │ │ └── pom.xml │ └── jeecg-boot-start/ ← 启动模块(Spring Boot 入口) │ └── pom.xml ``` 这是典型的 **“三层分模块” 架构**: | 模块 | 职责 | |------|------| | `jeecg-boot-api` | 定义对外接口 DTO、VO、FeignClient 接口(不包含实现) | | `jeecg-boot-biz` | 核心业务逻辑:Controller、Service、Mapper、Entity 等 | | `jeecg-boot-start` | Spring Boot 主启动类所在模块,负责整合所有依赖并运行应用 | --- ## ✅ 正确答案:将 Redis 依赖添加到 `jeecg-boot-start/pom.xml` ### 📌 原因如下: - `jeecg-boot-start` 是 **Spring Boot 的启动模块**,它会引入 `jeecg-boot-biz` 和其他模块。 - 所有需要被 Spring 容器管理的中间件(如 Redis、MQ、Elasticsearch)都应该在这里声明依赖。 - 只有在这个模块中引入,Spring 才能自动装配 `StringRedisTemplate`、`RedisTemplate` 等 Bean。 --- ### ✅ 操作步骤 #### 1. 编辑文件: ``` jeecg-boot/jeecg-boot-system/jeecg-boot-start/pom.xml ``` #### 2. 添加 Redis 相关依赖: ```xml <!-- Spring Boot Starter for Redis --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> <!-- 连接池支持(推荐) --> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-pool2</artifactId> </dependency> ``` > ⚠️ 注意:不要加 `<scope>` 或设置为 `provided`,否则运行时报 `ClassNotFoundException` --- ### ✅ 验证是否生效 确保以下代码可以正常注入: ```java @RestController public class TestController { @Autowired private StringRedisTemplate stringRedisTemplate; @GetMapping("/test/redis") public String test() { stringRedisTemplate.opsForValue().set("test_key", "hello_redis", 60, TimeUnit.SECONDS); return stringRedisTemplate.opsForValue().get("test_key"); } } ``` 访问 `/test/redis` 应返回 `"hello_redis"`,并在 Redis 中可见。 --- ### ❌ 不要添加的位置及原因 | 模块 | 是否添加 | 原因 | |------|----------|------| | `jeecg-boot-api` | ❌ 不要 | 仅用于接口定义,不应包含任何中间件依赖 | | `jeecg-boot-biz` | ⚠️ 视情况 | 如果只是使用 Redis 工具类(如 `RedisUtil`),可以在 biz 中调用,但依赖仍由 start 提供;除非 biz 独立部署才需自己引入 | | 根 POM(jeecg-boot/pom.xml) | ❌ 不要直接加 | 它是父工程,用于版本管理和依赖管理(dependencyManagement),不是具体依赖引入处 | --- ### ✅ 补充建议:统一管理版本(可选) 如果你希望在多个微服务中复用 Redis 配置,可以在根 `pom.xml` 中使用 `<dependencyManagement>` 统一版本: ```xml <!-- jeecg-boot/pom.xml --> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> <version>${spring-boot.version}</version> </dependency> </dependencies> </dependencyManagement> ``` 这样子模块无需指定版本号,保持一致性。 --- ### ✅ 实际应用场景举例:Token 存入 Redis 你在 `jeecg-boot-biz` 模块中的登录服务里写逻辑: ```java // LoginServiceImpl.java in jeecg-boot-biz @Autowired private StringRedisTemplate redisTemplate; public String login(String username, String password) { // ... 认证成功后 String token = JwtUtil.generate(username); redisTemplate.opsForValue().set("login_token:" + token, userId, 30, TimeUnit.MINUTES); return token; } ``` 只要 `jeecg-boot-start` 引入了 Redis 依赖,并且 Spring 扫描到了这个 Bean,就能正常使用。 ---
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值