Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-customization-system
/
micro-trialrun
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d64e0653
authored
Mar 10, 2022
by
张杰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复bug
1 parent
02267f08
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
13 deletions
src/utils/checkStatus.js
src/utils/http.js
src/views/vehicleManage/vehicleList.vue
src/utils/checkStatus.js
View file @
d64e065
...
...
@@ -56,7 +56,7 @@ const checkStatus = (status, msg) => {
error
(
'网络请求超时!'
);
break
;
case
500
:
error
(
'服务器错误,请联系管理员!'
);
error
(
`
${
msg
||
'服务器错误,请联系管理员!'
}
`
);
break
;
case
501
:
error
(
'网络未实现!'
);
...
...
@@ -71,7 +71,7 @@ const checkStatus = (status, msg) => {
error
(
'网络超时!'
);
break
;
case
505
:
error
(
'http版本不支持该请求!'
);
error
(
`
${
msg
||
'http版本不支持该请求!'
}
`
);
break
;
case
603
:
error
(
'尚未登录或登录已过期,请重新登录'
,
'removeToken'
);
...
...
src/utils/http.js
View file @
d64e065
...
...
@@ -5,7 +5,7 @@ import store from '@/store'
import
{
checkStatus
,
showLoading
}
from
'./checkStatus'
const
instance
=
axios
.
create
({
// 创建axios实例,在这里可以设置请求的默认配置
timeout
:
10
*
60
*
1000
,
// 设置超时时间60s
timeout
:
10
*
60
*
1000
,
// 设置超时时间60s
retry
:
3
,
retryDelay
:
1000
})
...
...
@@ -34,7 +34,7 @@ instance.interceptors.response.use(response => {
}
if
(
serverCode
===
200
||
response
.
status
===
200
)
{
if
(
serverCode
!==
200
)
{
checkStatus
(
serverCode
)
checkStatus
(
serverCode
,
response
.
data
.
message
)
}
if
(
response
.
status
)
{
...
...
@@ -42,7 +42,7 @@ instance.interceptors.response.use(response => {
}
return
Promise
.
resolve
(
response
.
data
)
}
else
{
checkStatus
(
serverCode
)
checkStatus
(
serverCode
,
response
.
data
.
message
)
return
Promise
.
reject
(
response
.
data
.
message
)
}
},
error
=>
{
...
...
@@ -145,7 +145,7 @@ const HTTP_GET = (baseUrl, options) => {
}
export
default
class
HTTP
{
axiosPost
(
options
)
{
axiosPost
(
options
)
{
getBaseUrl
().
then
((
baseUrl
)
=>
{
HTTP_POST
(
baseUrl
,
options
)
},
(
err
)
=>
{
...
...
@@ -153,7 +153,7 @@ export default class HTTP {
})
}
axiosGet
(
options
)
{
axiosGet
(
options
)
{
getBaseUrl
().
then
((
baseUrl
)
=>
{
HTTP_GET
(
baseUrl
,
options
)
},
(
err
)
=>
{
...
...
src/views/vehicleManage/vehicleList.vue
View file @
d64e065
...
...
@@ -1169,21 +1169,24 @@ export default {
this
.
$refs
.
serchButton
.
$el
.
click
();
//this.$refs.vehicleForm.refreshTable();
//this.$refs.snForm.refreshTable();
}
else
{
this
.
$message
({
message
:
message
,
type
:
"error"
,
});
}
}
});
});
break
;
case
"import"
:
console
.
log
(
this
.
importForm
.
file
);
if
(
this
.
importing
)
return
;
if
(
!
this
.
importForm
.
file
)
{
this
.
$message
({
message
:
"请选择文件"
,
type
:
"error"
,
});
return
false
;
}
var
data
=
new
FormData
();
data
.
append
(
"file"
,
this
.
importForm
.
file
);
this
.
importing
=
true
;
axios
({
headers
:
{
"Content-Type"
:
"multipart/form-data"
,
...
...
@@ -1630,10 +1633,20 @@ export default {
// 校验设备
checkDevice
(
rule
,
value
,
cb
)
{
let
_this
=
this
;
let
list
=
_this
.
snForm
.
deviceInfoDtos
||
[];
if
(
!
value
)
{
cb
(
new
Error
(
"请输入设备号"
));
return
false
;
}
console
.
log
(
list
);
let
olist
=
list
.
filter
((
k
)
=>
k
.
sn
==
value
);
if
(
olist
.
length
>
1
)
{
cb
(
new
Error
(
"不能输入相同设备号"
));
return
false
;
}
let
i
=
rule
.
field
.
split
(
"."
)[
1
];
verifydevice
({
sn
:
value
}).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment