jinhui.wang

请求方法变更,超时时间修正,文本修正

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,11 @@ 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() },
data: formData
})
// return request({
// url: '/flightDestination/importFlightDestination',
// method: 'post',
// data: formData
// })
}
//URSA目的地批量导入
......@@ -43,17 +35,11 @@ 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() },
data: formData
})
// return request({
// url: '/ursaDestination/importUrsaDestination',
// method: 'post',
// data: formData
// })
}
//航班目的地查询
......
......@@ -25,10 +25,10 @@ router.beforeEach((to, from, next) => {
})
}).catch(err => {
Message.error(err)
store.dispatch('LogOut').then(() => {
// next({ path: '/' })
window.location.href = settings.logoutURL;//wsso系统跳转
})
// store.dispatch('LogOut').then(() => {
// // next({ path: '/' })
// window.location.href = settings.loginURL;//wsso系统跳转
// })
})
} else {
next()
......@@ -47,7 +47,7 @@ router.beforeEach((to, from, next) => {
// 在免登录白名单,直接进入
next()
} else {
window.location.href = settings.logoutURL;//wsso系统跳转
window.location.href = settings.loginURL;//wsso系统跳转
}
}
}
......
......@@ -11,7 +11,7 @@ const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分
baseURL: settings.baseURL,
// 超时
timeout: 30000,
timeout: 90000,
})
// request拦截器
......@@ -59,8 +59,10 @@ service.interceptors.response.use(res => {
// 获取错误信息
const msg = errorCode[code] || res.data.msg || errorCode['default']
if (code === 301) {
MessageBox.confirm('登录状态已过期,需重新登录', '系统提示', {
confirmButtonText: '确定',
MessageBox.confirm('登录状态已过期,需重新登录!msg:' + msg, '系统提示', {
closeOnClickModal: false,
showCancelButton: false,
confirmButtonText: '重新登录',
type: 'warning'
}
).then(() => {
......
......@@ -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,17 +155,17 @@ 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);
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: 'FlightToArea' } })
} else if (res.data.code === 301) {
} else if (res.code === 301) {
this.$confirm('登录状态已过期,需重新登录', '系统提示', {
closeOnClickModal: false,
showCancelButton: false,
......@@ -177,7 +177,7 @@ export default {
})
)
} else {
this.msgWarning(res.data.msg);
this.msgWarning(res.msg);
}
} else {
this.msgSuccess("导入成功");
......
......@@ -30,10 +30,8 @@
</el-col>
<el-col :span="5">
<el-form-item label="URSA">
<el-select v-model="formData.ursas" class="formItem" filterable multiple clearable
placeholder="不限">
<el-option v-for="item in selectOptionList.ursaList" :label="item" :value="item"
:key="item">
<el-select v-model="formData.ursas" class="formItem" filterable multiple clearable placeholder="不限">
<el-option v-for="item in selectOptionList.ursaList" :label="item" :value="item" :key="item">
</el-option>
</el-select>
</el-form-item>
......@@ -56,7 +54,7 @@
</div>
<div style="padding:10px">
<el-form label-position="right" label-width="auto" size="small">
<el-form-item label="坐标系切换">
<el-form-item label="类型">
<el-radio-group v-model="formData.dimensionName" @change="typeChange">
<el-radio label="region">区域</el-radio>
<el-radio label="area">地区</el-radio>
......@@ -66,10 +64,9 @@
</el-form-item>
</el-form>
<div v-for="(item, index) in barChartData" :key="index">
<Chart :className="'chart' + index.toString()" :chartData="item" height="350px"
style="margin-bottom:10px" :loading="loading" />
<Chart :className="'chart' + index.toString()" :chartData="item" height="350px" style="margin-bottom:10px"
:loading="loading" />
</div>
</div>
</div>
</template>
......@@ -224,6 +221,4 @@ export default {
}
</script>
<style>
</style>
\ No newline at end of file
<style></style>
\ No newline at end of file
......
......@@ -162,17 +162,17 @@ 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) {
} else if (res.code === 301) {
this.$confirm('登录状态已过期,需重新登录', '系统提示', {
closeOnClickModal: false,
showCancelButton: false,
......@@ -184,7 +184,7 @@ export default {
})
)
} else {
this.msgWarning(res.data.msg);
this.msgWarning(res.msg);
}
} else {
this.msgSuccess("导入成功");
......