[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
一、新建的子模块,接口报404或Whitelabel Error Page(也是404)
没有找到对应controller的RequestMapping;
解决:
①在父项目中的pom.xml添加对应的模块<modules>和<dependency>,参考ruoyi-generator;
②在子模块ruoyi-admin中的pom.xml,添加对应模块的<dependency>,参考ruoyi-generator;
③(※重要)将父项目的pom.xml,子模块admin的pom.xml,新建的子模块的pom.xml,分别右键->maven->Reload Project
,然后整个项目 Rebuild Project,期间先关闭服务再操作,若仍然404,可关闭并重新打开开发工具,重新操作一遍该步骤。
二、新建的子模块,接口访问报403错误,只调postman调用/浏览器直接调用无问题,前端调用403错误
解决:去掉在:SecurityConfig.java 自定义的 .antMatchers("/test/**").anonymous(),
若依前端访问不是匿名,带有token,所以不使用anonymous(),默认的authenticated 即可。
三、新建的子模块,*Mapper.xml扫描不到(Invalid bound statement (not found))
Invalid bound statement (not found): com.xxx.xxx.mapper.xxxMapper.selectList
准备将生成的*Mapper.xml放入至其他子模块试一下,发现文件名不对
这里没有合并,就看出问题来了 ,文件名称有问题
解决: 这里的mapper.family,是一个文件名,family并不是一个子文件夹,将文件名修改好就行了。
四、文件上传
后台报错:Content type
'multipart/form-data;boundary=----WebKitFormBoundarymn2IDPynGhlHwALI;charset=UTF-8'
not supported;
解决办法:去掉:@RequestBody,body不会接收file。
五、获取用户信息异常
是由于权限控制,必须登录获取当前用户信息所致:@PreAuthorize("@ss.hasPermi('test:test:list')")
解决:若不需要登录就能访问,可以直接注释这个权限。