若依打包将vue放到.jar里面部署

1.vue静态文件,以及单页面

ruoyi-admin\src\main\resources\static 

\ruoyi-admin\src\main\resources\templates

2.后台开放白名单

"/cms",
"/cms#/login"

若依打包将vue放到.jar里面部署_第1张图片

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/

若依打包将vue放到.jar里面部署_第2张图片

5.maven依赖

    
        
            javax.xml.bind
            jaxb-api
            2.3.0
        
        
            com.sun.xml.bind
            jaxb-impl
            2.3.0
        
        
            com.sun.xml.bind
            jaxb-core
            2.3.0
        
        
            javax.activation
            activation
            1.1.1
        

你可能感兴趣的:(vue.js,前端,javascript)