diff --git a/src/api/server.js b/src/api/server.js index 974e9b6..1023f50 100644 --- a/src/api/server.js +++ b/src/api/server.js @@ -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); } })(); diff --git a/src/common/js/interceptor.js b/src/common/js/interceptor.js index b875f10..8a3d6d6 100644 --- a/src/common/js/interceptor.js +++ b/src/common/js/interceptor.js @@ -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无效 diff --git a/src/views/train/case-list.vue b/src/views/train/case-list.vue index 9eb283e..e0ea89d 100644 --- a/src/views/train/case-list.vue +++ b/src/views/train/case-list.vue @@ -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;