实训管理 请求路径修改

zqqdev
zqq 5 years ago
parent 54a165e4ce
commit 63d066d91e
  1. 26
      src/api/server.js
  2. 2
      src/common/js/interceptor.js
  3. 14
      src/views/train/case-list.vue

@ -34,34 +34,34 @@ export const FILE_URL = app.FILE_URL_APP;
*/
export const Train = new (class {
constructor() {
this.getTrainListApi = trainApi + "/trainManage/list"; //实训管理列表
this.insertTrainApi = trainApi + "/trainManage/add";//添加
this.updTrainApi = trainApi + "/trainManage/edit";//修改
this.delTrainApi = trainApi + "/trainManage/remove";//删除
this.getCaseListApi = trainApi + "/trainCaseManage/list"; //实训管理列表
this.insertCaseApi = trainApi + "/trainCaseManage/add";//添加
this.updCaseApi = trainApi + "/trainCaseManage/edit";//修改
this.delCaseApi = trainApi + "/trainCaseManage/remove";//删除
}
//实训管理列表
getTrainList(params) {
//实训案例管理列表
getCaseList(params) {
return axios
.post(this.getTrainListApi, qs.stringify(params))
.post(this.getCaseListApi, qs.stringify(params), {headers: {requestType: "noToken"}})
.then(res => res.data);
}
//添加
insertTrain(params) {
insertCase(params) {
return axios
.post(this.insertTrainApi, qs.stringify(params))
.post(this.insertCaseApi, qs.stringify(params))
.then(res => res.data);
}
//修改
updTrain(params) {
updCase(params) {
return axios
.post(this.updTrainApi, qs.stringify(params))
.post(this.updCaseApi, qs.stringify(params))
.then(res => res.data);
}
//删除
delTrain(params) {
delCase(params) {
return axios
.post(this.delTrainApi, qs.stringify(params))
.post(this.delCaseApi, qs.stringify(params))
.then(res => res.data);
}
})();

@ -5,6 +5,7 @@ import store from '@/vuex/store.js';
axios.defaults.timeout = 10000;
axios.interceptors.request.use(
function(config){
debugger;
// return config;
// }
// config.url = process.env.BASEAPI+process.env.ROOT+config.url;
@ -29,6 +30,7 @@ axios.interceptors.request.use(
axios.interceptors.response.use(
function(response){
debugger;
let location = window.location.href.split("#")[0]+'#/login';
let code = response.data.code;
if(parseInt(code) === 101||parseInt(code) === 10){//token无效

@ -106,20 +106,14 @@
},
methods: {
initList(searchObj) {
this.searchObj.selfIsAdmin = this.$store.state.app.user.userType == 1 ? 0 : 1;
this.$http.post('/authapi/bs_projectManage/getProjectPagedList', {
skipCount: this.currentPage,
maxResultCount: this.pageSize,
searchObj: this.searchObj
}).then(response => {
if (response) {
this.listData = response.items;
this.totalCount = response.totalCount;
Train.getCaseList(searchObj).then(res => {
if (res.code == 200) {
this.listData = res.data;
this.totalCount = res.totalCount;
}
}).catch(error => {
console.info(error)
});
this.showSearchDiv = this.$store.state.app.user.showSearchDiv;
},
isShowEditOrDelBtn(row) {
let userType = this.$store.state.app.user.userType;

Loading…
Cancel
Save