jinhui.wang

请求方法调用变更,bug修复

import request from '@/utils/request'
import axios from 'axios';
import settings from "@/settings"
import { getToken } from '@/utils/auth'
//模板下载
export function downLoadTemplate(template) {
......@@ -21,17 +19,12 @@ export function importFlightDestination(file, date) {
let formData = new FormData();
formData.append("file", file);
formData.append("beginDate", date);
return axios({
return request({
method: 'post',
url: settings.baseURL + '/flightDestination/importFlightDestination',
headers: { 'Authorization': 'Bearer ' + getToken() },
// headers: { 'Authorization': 'Bearer ' + getToken() },
data: formData
})
// return request({
// url: '/flightDestination/importFlightDestination',
// method: 'post',
// data: formData
// })
}
//URSA目的地批量导入
......@@ -43,17 +36,12 @@ export function importUrsaDestination(file, date) {
let formData = new FormData();
formData.append("file", file);
formData.append("beginDate", date);
return axios({
return request({
method: 'post',
url: settings.baseURL + '/ursaDestination/importUrsaDestination',
headers: { 'Authorization': 'Bearer ' + getToken() },
// headers: { 'Authorization': 'Bearer ' + getToken() },
data: formData
})
// return request({
// url: '/ursaDestination/importUrsaDestination',
// method: 'post',
// data: formData
// })
}
//航班目的地查询
......
......@@ -23,10 +23,7 @@ router.beforeEach((to, from, next) => {
})
})
}).catch(err => {
store.dispatch('LogOut').then(() => {
Message.error(err)
next({ path: '/' })
})
})
} else {
next()
......
......@@ -42,6 +42,7 @@ module.exports = {
/**
* logout
*/
loginURL: 'http://47.103.140.98/test/login',
logoutURL: 'http://47.103.140.98/test/login',
/**
......
......@@ -24,8 +24,8 @@
<el-row>
<el-col :span="6">
<el-form-item label="生效日期" prop="beginDate" :rules="rules">
<el-date-picker class="formItem" v-model="formData.beginDate" type="date"
placeholder="选择日期" value-format="yyyy-MM-dd" clearable>
<el-date-picker class="formItem" v-model="formData.beginDate" type="date" placeholder="选择日期"
value-format="yyyy-MM-dd" clearable>
</el-date-picker>
</el-form-item>
</el-col>
......@@ -155,29 +155,18 @@ export default {
//上传excel
const file = option.file;
importFlightDestination(file, this.formData.beginDate).then((res) => {
if (res.data.code != 200) {
if (res.data.code == 603) {
if (res.code != 200) {
if (res.code == 603) {
this.$alert(res.msg, "提示", {
confirmButtonText: "确定",
type: "warning",
});
} else if (res.data.code === 201) {
this.msgWarning(res.data.msg);
} else if (res.code === 201) {
this.msgWarning(res.msg);
this.errorData = res.data.data;
this.$router.push({ name: 'UpDateResult', params: { data: this.errorData, from: 'FlightToArea' } })
} else if (res.data.code === 301) {
this.$confirm('登录状态已过期,需重新登录', '系统提示', {
closeOnClickModal: false,
showCancelButton: false,
confirmButtonText: '重新登录',
type: 'warning'
}).then(
this.$store.dispatch('LogOut').then(() => {
window.location.href = settings.loginURL;//wsso系统跳转
})
)
} else {
this.msgWarning(res.data.msg);
this.msgWarning(res.msg);
}
} else {
this.msgSuccess("导入成功");
......
......@@ -25,8 +25,8 @@
<el-row>
<el-col :span="6">
<el-form-item label="生效日期" prop="beginDate" :rules="rules">
<el-date-picker class="formItem" v-model="formData.beginDate" type="date"
placeholder="选择日期" value-format="yyyy-MM-dd" clearable>
<el-date-picker class="formItem" v-model="formData.beginDate" type="date" placeholder="选择日期"
value-format="yyyy-MM-dd" clearable>
</el-date-picker>
</el-form-item>
</el-col>
......@@ -162,29 +162,18 @@ export default {
//上传excel
const file = option.file;
importUrsaDestination(file, this.formData.beginDate).then((res) => {
if (res.data.code != 200) {
if (res.data.code == 603) {
this.$alert(res.data.msg, "提示", {
if (res.code != 200) {
if (res.code == 603) {
this.$alert(res.msg, "提示", {
confirmButtonText: "确定",
type: "warning",
});
} else if (res.data.code === 201) {
this.msgWarning(res.data.msg);
this.errorData = res.data.data;
} else if (res.code === 201) {
this.msgWarning(res.msg);
this.errorData = res.data;
this.$router.push({ name: 'UpDateResult', params: { data: this.errorData, from: 'FlightInformationImport' } })
} else if (res.data.code === 301) {
this.$confirm('登录状态已过期,需重新登录', '系统提示', {
closeOnClickModal: false,
showCancelButton: false,
confirmButtonText: '重新登录',
type: 'warning'
}).then(
this.$store.dispatch('LogOut').then(() => {
window.location.href = settings.loginURL;//wsso系统跳转
})
)
} else {
this.msgWarning(res.data.msg);
this.msgWarning(res.msg);
}
} else {
this.msgSuccess("导入成功");
......@@ -211,6 +200,7 @@ export default {
this.selection()
},
upload() {
console.log(1)
this.$refs.selectForm.validateField('beginDate')
}
},
......