From 63d066d91ef881533254d93d76d4758da7c8dca2 Mon Sep 17 00:00:00 2001 From: zqq <1935003650@qq.com> Date: Mon, 20 Apr 2020 22:24:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E8=B7=AF=E5=BE=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/server.js | 26 +++++++++++++------------- src/common/js/interceptor.js | 2 ++ src/views/train/case-list.vue | 14 ++++---------- 3 files changed, 19 insertions(+), 23 deletions(-) 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;