上传文件401提示登录

main
吕天方 5 months ago
parent 7296b32051
commit a263a2adb0

@ -8,7 +8,7 @@ ENV = 'development'
# VUE_APP_BASE_API = 'http://localhost:9035'
# VUE_APP_BASE_API = 'https://vue.ruoyi.vip/prod-api'
# VUE_APP_BASE_API = 'http://39.101.188.84:9035'
VUE_APP_BASE_API = 'http://192.168.0.109:9035'
VUE_APP_BASE_API = 'http://192.168.0.108:9035'

@ -41,7 +41,7 @@
<script>
import { getToken } from "@/utils/auth";
import { MessageBox } from 'element-ui'
export default {
name: "FileUpload",
props: {
@ -149,6 +149,19 @@ export default {
if (res.code === 200) {
this.uploadList.push({ name: res.originalFilename, url: res.fileName });
this.uploadedSuccessfully();
} else {
this.$modal.closeLoading();
if(res.code == 401) {
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => {
this.$store.dispatch('LogOut').then(() => {
location.href = '/tczzpc';
})
}).catch(err=>{
this.number--;
this.$refs.fileUpload.handleRemove(file);
this.uploadedSuccessfully();
})
} else {
this.number--;
this.$modal.closeLoading();
@ -156,6 +169,7 @@ export default {
this.$refs.fileUpload.handleRemove(file);
this.uploadedSuccessfully();
}
}
},
//
handleDelete(index) {

Loading…
Cancel
Save