renrenfast开源项目打包过程,前端使用vue element-UI,前后端分离,打包为一个jar包运行

    xiaoxiao2022-07-14  155

    项目使用的是renrenfast2.0 框架,后台springboot,前端vue+element-ui。项目本身有shiro拦截机制,需要放开static路径下文件,才可以访问。

    步骤如下:

    1.前端:npm run build

    (1)在dist目录下有3个文件(包括数字-其实是日期、index、config)

    (2)把这3个文件拷贝到后端项目的static目录下

    2.后端:

    (1)config目录下index.js中,配置“api接口请求地址”,如 window.SITE_CONFIG['baseUrl'] = 'http://localhost:8080/admin-fast';

    (2)application.yml 目录下,false改为true(平时开发不需要改回) spring:   resources:     add-mappings: true

    (3)shiroConfig.java 拦截配置文件中需要开放static路径,如 filterMap.put("/static/**", "anon"); 上面这条语句必须写在filterMap.put("/**", "oauth2");之上

    3.后端项目按平常maven-package打包即可

    4.访问:http://localhost:8080/admin-fast/static/index.html

    最新回复(0)