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映射文件
综上,搞定