实训管理 请求路径修改

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

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

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

Loading…
Cancel
Save