步驟:
一询吴、找到文件vue.config.js,沒有則自己創(chuàng)建一個
image.png
二励幼、編寫vue.config.js的內容
image.png
module.exports = {
outputDir: 'default',
assetsDir:'static',
publicPath:'',
devServer:{
host:"127.0.0.1",
port:8080,
https:false,
open:true
},
pluginOptions: {
quasar: {
importStrategy: 'kebab',
rtlSupport: true
}
},
transpileDependencies: [
'quasar'
]
}
三汰寓、修改路由方式,修改為hash苹粟,文件位置自己找,vuecli3中在router.ts文件中
image.png
image.png
四跃闹、添加空路由
image.png
五嵌削、打包部署
npm run build
六、部署
找到編譯好的文件夾望艺,如果作為獨立項目苛秕,直接拷貝后放到Tomcat里即可,如果是放到另外一個項目中使用找默,則拷貝到其它項目中去
image.png
七艇劫、適配到EOS中使用
7.1、改變原EOS項目中的首頁配置
在webapps\default\WEB-INF\web.xml中配置
<welcome-file-list>
<welcome-file>index.html</welcome-file>//原為index.jsp
<welcome-file>coframe/index.jsp</welcome-file>
</welcome-file-list>
7.2惩激、修改原EOS項目中的登錄成功的跳轉頁店煞,也是項目主頁
在webapps\default\coframe\auth\index.jsp中配置
<%
String skin = "default";
Object userObj = session.getAttribute("userObject");
if(userObj != null){
UserObject userObject = (UserObject)userObj;
if(userObject.getAttributes().get(IConstants.MENU_TYPE) != null){
skin = (String)userObject.getAttributes().get(IConstants.MENU_TYPE);
}
}
response.sendRedirect(request.getContextPath() + "/#/home");//修改成主頁
/*response.sendRedirect(request.getContextPath() + "/skins/"+skin+"/index.jsp");*/
%>