首先有一个 jsp 页面,也配置相关路径 就叫他 one.jsp 吧
这个页面大概长这样:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="root" value="<%=request.getContextPath()%>"></c:set>
<!DOCTYPE html>
<html class="orl">
<head>
<meta charset="UTF-8">
<title>title</title>
<%@include file="/WEB-INF/view/wechat/wxInclude.jsp"%>
</head>
<body>
这里还有 jsp 的东西,
<div id="app">
引入的 vue 引入了路由,做了好几个组件
</div>
<script>
console.log('${root}') //这个打印出来是项目的根径
</script>
各种 js 引入
</body>
</html>
本地调试的时候
我给 vue 的 axios 配置
axios.defaults.baseURL = 'http://127.0.0.1:8087/';
//axios.defaults.baseURL = './';
Vue.prototype.$http = axios;
然后请求
var url = 'jxe/wechat/queryEmployeesByDepartmentId';
this.$http.post(url,{
'id': 492
}).then(function(res){
})
就可以愉快的玩耍了,
那么我现在要上线,
该怎么办了?我犯了什么错么?求打醒 求指导
这个页面大概长这样:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="root" value="<%=request.getContextPath()%>"></c:set>
<!DOCTYPE html>
<html class="orl">
<head>
<meta charset="UTF-8">
<title>title</title>
<%@include file="/WEB-INF/view/wechat/wxInclude.jsp"%>
</head>
<body>
这里还有 jsp 的东西,
<div id="app">
引入的 vue 引入了路由,做了好几个组件
</div>
<script>
console.log('${root}') //这个打印出来是项目的根径
</script>
各种 js 引入
</body>
</html>
本地调试的时候
我给 vue 的 axios 配置
axios.defaults.baseURL = 'http://127.0.0.1:8087/';
//axios.defaults.baseURL = './';
Vue.prototype.$http = axios;
然后请求
var url = 'jxe/wechat/queryEmployeesByDepartmentId';
this.$http.post(url,{
'id': 492
}).then(function(res){
})
就可以愉快的玩耍了,
那么我现在要上线,
该怎么办了?我犯了什么错么?求打醒 求指导