NutzCN Logo
问答 NutzWK vue部署到linux服务器,登录成功后home页面样式全没了
发布于 2060天前 作者 neuf9gh 1643 次浏览 复制 上一个帖子 下一个帖子
标签: nutzwk

NutzWK vue部署到linux服务器,打包,启动,浏览器访问,登录页面显示正常,登录成功后home页面样式全没了。
chrome F12 能见到的错误只有:

home:140 Uncaught ReferenceError: Vue is not defined
    at home:140

请帮忙分析下原因

17 回复

可用信息太少,看看js可都加载了,可能是nginx配置问题?或者给个网址看看

js 未加载。没有使用nginx。目前不能外网访问。这里不能发截图。

右击查看网页源代码,看看js路径

看不到js路径
下面是右键源码:
view-source:http://192.168.22.35:8070/platform/home#


<!--# layout("/layouts/platform.html"){ #--> <div id="app" class="sys_home" v-cloak style="padding: 0 180px 200px"> <el-row> <h3>快捷入口</h3> </el-row> <el-row> <el-col class="home_col_box"> <a href="/platform/console/open_card/index"> <div class="home_box first_shadow"> <div class="bg_yellow icon_box"> <img src="/assets/platform/img/home/open_card_logo.png" alt=""> </div> <el-row> <span class="home_box_title">开成卡</span> </el-row> </div> </a> </el-col> <el-col class="home_col_box"> <a href="#"> <div class="home_box first_shadow"> <div class="bg_red icon_box"> <img src="/assets/platform/img/home/pay_logo.png" alt=""> </div> <el-row> <span class="home_box_title">充值缴费</span> </el-row> </div> </a> </el-col> <el-col class="home_col_box"> <a href="#"> <div class="home_box first_shadow"> <div class="bg_blue icon_box"> <img src="/assets/platform/img/home/real_name_logo.png" alt=""> </div> <el-row> <span class="home_box_title">实名补录</span> </el-row> </div> </a> </el-col> <el-col class="home_col_box home_col_box_last mb_50px"> <a href="/platform/console/changeprod/index"> <div class="home_box first_shadow"> <div class="bg_green icon_box"> <img src="/assets/platform/img/home/handle_logo.png" alt=""> </div> <el-row> <span class="home_box_title">套餐变更</span> </el-row> </div> </a> </el-col> <!-- 换行 --> <el-col class="home_col_box"> <a href="/platform/console/changecust/index"> <div class="home_box first_shadow"> <div class="bg_yellow icon_box"> <img src="/assets/platform/img/home/transfer_logo.png" alt=""> </div> <el-row> <span class="home_box_title">过户</span> </el-row> </div> </a> </el-col> <el-col class="home_col_box"> <a href="/platform/console/changecard/index"> <div class="home_box first_shadow"> <div class="bg_red icon_box"> <img src="/assets/platform/img/home/reapply_logo.png" alt=""> </div> <el-row> <span class="home_box_title">补换卡</span> </el-row> </div> </a> </el-col> <el-col class="home_col_box"> <a href="#"> <div class="home_box first_shadow"> <div class="bg_blue icon_box"> <img src="/assets/platform/img/home/activate_points_logo.png" alt=""> </div> <el-row> <span class="home_box_title">激活积分</span> </el-row> </div> </a> </el-col> <el-col class="home_col_box home_col_box_last"> <a href="#"> <div class="home_box first_shadow"> <div class="bg_green icon_box"> <img src="/assets/platform/img/home/charge_points_logo.png" alt=""> </div> <el-row> <span class="home_box_title">话费分成积分</span> </el-row> </div> </a> </el-col> </el-row> <el-row> <h3 class="second_title" style="width: 49%;margin-right: 2%;">激活排名</h3> <h3 class="second_title" style="width: 48%">话费佣金排名</h3> </el-row> <el-row> <el-col style="width: 49%;margin-right: 2%"> <el-table class="home_table" :data="tableData6" :span-method="objectSpanMethod"> <el-table-column prop="time" label="" width="180"> </el-table-column> <el-table-column prop="range" label="范围"> </el-table-column> <el-table-column prop="ranking" label="排名"> </el-table-column> <el-table-column prop="gap" label="和前一名相差"> </el-table-column> </el-table> </el-col> <el-col style="width: 48%;"> <el-table class="home_table" :data="tableData6" :span-method="objectSpanMethod"> <el-table-column prop="time" label="" width="180"> </el-table-column> <el-table-column prop="range" label="范围"> </el-table-column> <el-table-column prop="ranking" label="排名"> </el-table-column> <el-table-column prop="gap" label="和前一名相差"> </el-table-column> </el-table> </el-col> </el-table> </el-row> </div> <script> new Vue({ el: '#app', data: function () { return { showDialog: false, loading: false, tableData6: [{ time: '当月', range: '全公司', ranking: '第一', gap: '0', }, { time: '当月', range: '全国', ranking: '第三', gap: '50', }, { time: '累计', range: '全公司', ranking: '第一', gap: '0', }, { time: '累计', range: '全国', ranking: '第二', gap: '97', }], } }, methods: { open: function () { this.showDialog = true }, arraySpanMethod({ row, column, rowIndex, columnIndex }) { if (rowIndex % 2 === 0) { if (columnIndex === 0) { return [1, 2]; } else if (columnIndex === 1) { return [0, 0]; } } }, objectSpanMethod({ row, column, rowIndex, columnIndex }) { if (columnIndex === 0) { if (rowIndex % 2 === 0) { return { rowspan: 2, colspan: 1 }; } else { return { rowspan: 0, colspan: 0 }; } } }, }, created: function () {} }) </script> <style scoped> .sys_home .home_box { border-radius: 6px; width: 100%; display: inline-block; padding-top: 15px; padding-bottom: 15px; text-align: center; transition-duration: .3s; } .home_col_box { width: 23%; margin-right: 2.6666666666667%; } .home_col_box_last { margin-right: 0; } .home_box_title { font-size: 16px; color: #909399; } .mb_50px { margin-bottom: 50px; } .icon_box { width: 80px; height: 80px; margin-bottom: 30px; border-radius: 80px; text-align: center; line-height: 75px; display: inline-block; } .home_box:hover { box-shadow: 1px 1px 15px 3px #DCDFE6; transform: scale(1.06); } .second_title { display: inline-block; } .elRowPadding { padding: 20px 20px 20px 20px; } .home_table { width: 100%; margin-top: 20px; box-shadow: 1px 1px 15px 3px #EBEEF5; } .home_table:hover { box-shadow: 1px 1px 15px 3px #DCDFE6; } </style> <!--# } #-->

网页右键查看,能看到

<!--#
layout("/layouts/platform.html"){
#-->

???

没部署在根?

部署在这里。 l

[vno@essapp webapps]$ cd vno
[vno@essapp vno]$ ls
ams  api  jdk  sbin  sys  task  vue  wx
[vno@essapp vno]$ pwd
/opt/webapps/vno
[vno@essapp vno]$ cd vue
[vno@essapp vue]$ ls
vno-nb-web-vue-1.0.0.jar
[vno@essapp vue]$ pwd
/opt/webapps/vno/vue
[vno@essapp vue]$ 

那不行吧, nutzwk默认只能部署在根

@Wizzercn Ctrl+U 和查看源码看到的一样。
@wendal 这个服务器有其他的项目。root的JDK版本是1.7,我不能改。 还有一个用户是oracle, jdk版本是1.6。 于是我新建了一个用户vno,装了1.8 jdk。 我应该把项目放在vno的什么路径下能满足nutzwk的要求?

部署有问题吧,你只是把html模板拷贝过去了,而不是可运行的项目,查看源码应该没有模板标签的

加工成war文件,供传统模式下的部署


mvn clean package nutzboot:shade nutzboot:war

@Wizzercn 现在我是用jar部署的。我试试 在tomcat下部署。

好折腾啊,QQ:11624317 我来看看,jar包方式直接启动就可以了啊

好久不登QQ 已发送请求 谢谢

结贴,原因是配置文件下面内容被删:

beetl.DELIMITER_STATEMENT_START=<!--#
beetl.DELIMITER_STATEMENT_END=#-->
添加回复
请先登陆
回到顶部