1.vue静态文件,以及单页面
ruoyi-admin\src\main\resources\static
\ruoyi-admin\src\main\resources\templates
2.后台开放白名单
"/cms", "/cms#/login"
3. mvc访问vue页面入口,接口
package com.ruoyi.web.controller.system;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
/***
* 首页vue配置
*/
@Controller
public class SysIndexController {
/***
* 访问门户首页,测试
* @return
*/
@RequestMapping(value = "/cms",method = RequestMethod.GET)
public String index()
{
return "index";
}
/***
* 访问后台管理系统登录界面,测试
* @return
*/
@RequestMapping(value = "/admincms",method = RequestMethod.GET)
public String admincms()
{
return "index";
}
}
4.
#vue静态资源读取 mvc: view: prefix: .html static-path-pattern: /** resources: static-locations: classpath:/templates/,classpath:/static/
5.maven依赖
<!--解决Handler dispatch failed;nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter-->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>