1.创建子模块中,结构保持一致,才能被扫描到
<artifactId>ruoyi-weixin</artifactId>
<dependencies>
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-system</artifactId>
</dependency>
2.ruoyi-admin pom.xml
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-weixin</artifactId>
</dependency>3.加入最外面的pom.xml中
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-weixin</artifactId>
<version>${ruoyi.version}</version>
</dependency><module>ruoyi-weixin</module>
4.control调用
package com.ruoyi.api.controller;
import com.ruoyi.api.controller.utill.JsonResult;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping("/weixin/index")
public class IndexController {
@Autowired
private ISysUserService userService;
@ResponseBody
@RequestMapping("/add")
public AjaxResult selectAll() {
AjaxResult ajax = new AjaxResult();
JsonResult result=new JsonResult();
System.out.println("sdfsddddddddddddddddddddddd");
ajax.put("aa","bb");
return ajax;
}
}
5.在权限中控制,放出接口,不需要拦截的访问filterChainDefinitionMap.put("/weixin/**/**", "anon");版权声明:本文为weixin_43900855原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。