ruoyi出现的那些bug

1、

npm install --registry=https://registry.npm.taobao.org   //配置镜像站

request to https://registry.npm.taobao.org/element-ui failed, reason: certificate has expired

路径错误

​
npm install https://registry.npmmirror.com

2、添加自定义模块

(1)新建 模块,选择jdk,add module as(老版本) ,parent,填写groupId,版本,下一步

打开新建模块的pom

    <dependencies>
        <dependency>
            <groupId>com.ruoyi</groupId>
            <artifactId>ruoyi-common</artifactId>
        </dependency>
    </dependencies>

打开通用pom,确定新增module

<module>okr</module>
    </modules>
    <packaging>pom</packaging>

添加depend

            <dependency>
                <groupId>com.zz</groupId>
                <artifactId>xxx</artifactId>
                <version>${ruoyi.version}</version>
            </dependency>

打开ry-admin的pom

        <dependency>
            <groupId>com.zz</groupId>
            <artifactId>xxx</artifactId>
        </dependency>

添加完依赖,需要重新import maven一下

(2)粘贴代码

在新建模块下的src下粘贴main(注意:Controller 要单独放在ruoyi-admin 模块Controller 包下)

在ry-ui下的src下粘贴vue里面的api和views

出现问题

==================================

自定义模块401或者404

{"msg":"请求访问:/project/exam/list,认证失败,无法访问系统资源","code":401}

放开spring日志 --> application.yml

# 日志配置
logging:
  level:
    com.ruoyi: debug
    #org.springframework: warn
    org.springframework: debug

DEBUG o.s.w.s.r.ResourceHttpRequestHandler - [handleRequest,560] - Resource not found

原因:

a.(注意:Controller 要单独放在ruoyi-admin 模块Controller 包下)没有查看到,但只适用包名相同的情况

b.不同需要在springboot 的启动类上加入配置

@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }, scanBasePackages = { "com.ruoyi.", "com.test." }) 或者加上
@ComponentScan({ "com.ruoyi.", "com.test." })  )

c.如果controller和注释一起写,会提示重复,

去掉controller,用自己的模块就好;

d.然后就会报mybatis解析不了

mybatis:
  # 搜索指定包别名
  #20240524新添加xx依赖
  typeAliasesPackage: com.ruoyi.**.domain,com.xx.**.domain
  # 配置mapper的扫描,找到所有的mapper.xml映射文件

综上,搞定

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值