Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
I
install.web
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Script
install.web
Commits
2a3297c6
Commit
2a3297c6
authored
Mar 16, 2020
by
黄贤军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
本机id
parent
0479101a
Pipeline
#20859
passed with stage
in 1 minute and 3 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
16 deletions
+55
-16
system.vue
src/app/HsEdi/system.vue
+49
-10
HSHttpClient.js
src/utils/sha256/HSHttpClient.js
+2
-2
myHttpClient.js
src/utils/sha256/myHttpClient.js
+4
-4
No files found.
src/app/HsEdi/system.vue
View file @
2a3297c6
...
@@ -153,6 +153,7 @@
...
@@ -153,6 +153,7 @@
<
script
>
<
script
>
import
axios
from
'axios'
import
axios
from
'axios'
import
utilSingeUc
from
'@basicClass/util_singe_uc.js'
import
utilSingeUc
from
'@basicClass/util_singe_uc.js'
import
API
from
'@/utils/sha256/myHttpClient'
import
{
Loading
}
from
'element-ui'
import
{
Loading
}
from
'element-ui'
export
default
{
export
default
{
mixins
:
[
utilSingeUc
],
mixins
:
[
utilSingeUc
],
...
@@ -199,7 +200,6 @@ export default {
...
@@ -199,7 +200,6 @@ export default {
// 安装runner
// 安装runner
install_runner
()
{
install_runner
()
{
this
.
openFullScreen
(
'正在安装runner,请稍等'
)
this
.
openFullScreen
(
'正在安装runner,请稍等'
)
this
.
percentage
=
5
axios
.
get
(
`mesAPI/install/runner/step1/`
).
then
(
res
=>
{
axios
.
get
(
`mesAPI/install/runner/step1/`
).
then
(
res
=>
{
this
.
percentage
=
33
this
.
percentage
=
33
this
.
install_runner2
()
this
.
install_runner2
()
...
@@ -210,6 +210,7 @@ export default {
...
@@ -210,6 +210,7 @@ export default {
},
},
install_runner2
()
{
install_runner2
()
{
axios
.
get
(
`mesAPI/install/runner/step2/`
).
then
(
res
=>
{
axios
.
get
(
`mesAPI/install/runner/step2/`
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
percentage
=
66
this
.
percentage
=
66
this
.
install_runner3
()
this
.
install_runner3
()
}).
catch
(
res
=>
{
}).
catch
(
res
=>
{
...
@@ -234,7 +235,6 @@ export default {
...
@@ -234,7 +235,6 @@ export default {
this
.
openFullScreen
(
'正在推送升级,请稍等'
)
this
.
openFullScreen
(
'正在推送升级,请稍等'
)
this
.
percentage
=
5
this
.
percentage
=
5
axios
.
get
(
`mesAPI/upgrade/remote/step1/`
).
then
(
res
=>
{
axios
.
get
(
`mesAPI/upgrade/remote/step1/`
).
then
(
res
=>
{
this
.
percentage
=
33
this
.
upgrade2
()
this
.
upgrade2
()
}).
catch
(
res
=>
{
}).
catch
(
res
=>
{
this
.
percentage
=
0
this
.
percentage
=
0
...
@@ -243,21 +243,57 @@ export default {
...
@@ -243,21 +243,57 @@ export default {
},
},
upgrade2
()
{
upgrade2
()
{
axios
.
get
(
`mesAPI/upgrade/remote/step2/`
).
then
(
res
=>
{
axios
.
get
(
`mesAPI/upgrade/remote/step2/`
).
then
(
res
=>
{
this
.
percentage
=
66
this
.
percentage
=
10
this
.
upgrade3
()
this
.
upgrade3
(
res
.
data
.
app_cout
)
}).
catch
(
res
=>
{
}).
catch
(
res
=>
{
this
.
percentage
=
0
this
.
percentage
=
0
this
.
closeFullScreen
(
this
.
openFullScreen
())
this
.
closeFullScreen
(
this
.
openFullScreen
())
})
})
},
},
upgrade3
()
{
async
upgrade3
(
app_count
)
{
axios
.
get
(
`mesAPI/upgrade/remote/step3/`
).
then
(
res
=>
{
for
(
let
i
=
1
;
i
<=
app_count
;
i
++
)
{
this
.
percentage
=
100
console
.
log
(
i
)
await
axios
.
get
(
`mesAPI/upgrade/remote/step3/
${
i
}
`
).
then
(
res
=>
{
if
(
app_count
>
10
)
{
this
.
percentage
=
this
.
percentage
+
2
}
else
{
this
.
percentage
=
this
.
percentage
+
4
}
}).
catch
(
res
=>
{
this
.
percentage
=
0
this
.
closeFullScreen
(
this
.
openFullScreen
())
})
}
this
.
upgrade4
()
},
upgrade4
()
{
axios
.
get
(
`mesAPI/upgrade/remote/step4/`
).
then
(
res
=>
{
this
.
percentage
=
this
.
percentage
+
5
this
.
upgrade5
(
res
.
data
.
app_cout
)
}).
catch
(
res
=>
{
this
.
percentage
=
0
this
.
closeFullScreen
(
this
.
openFullScreen
())
})
},
async
upgrade5
(
app_count
)
{
for
(
let
i
=
1
;
i
<=
app_count
;
i
++
)
{
await
axios
.
get
(
`mesAPI/upgrade/remote/step5/
${
i
}
`
).
then
(
res
=>
{
if
(
app_count
>
10
)
{
this
.
percentage
=
this
.
percentage
+
2
}
else
{
this
.
percentage
=
this
.
percentage
+
4
}
}).
catch
(
res
=>
{
this
.
percentage
=
0
this
.
closeFullScreen
(
this
.
openFullScreen
())
})
}
this
.
upgrade6
()
},
upgrade6
()
{
API
.
get
(
`mesAPI/upgrade/remote/step6/`
).
then
(
res
=>
{
setTimeout
(
_
=>
{
setTimeout
(
_
=>
{
this
.
percentage
=
100
this
.
closeFullScreen
(
this
.
openFullScreen
())
this
.
closeFullScreen
(
this
.
openFullScreen
())
this
.
$message
.
success
(
'
推送
成功'
)
this
.
$message
.
success
(
'
安装
成功'
)
this
.
percentage
=
0
this
.
percentage
=
0
},
1
0
00
)
},
1
5
00
)
}).
catch
(
res
=>
{
}).
catch
(
res
=>
{
this
.
percentage
=
0
this
.
percentage
=
0
this
.
closeFullScreen
(
this
.
openFullScreen
())
this
.
closeFullScreen
(
this
.
openFullScreen
())
...
@@ -271,7 +307,9 @@ export default {
...
@@ -271,7 +307,9 @@ export default {
updata
()
{
updata
()
{
},
},
test
(
str
)
{
test
(
str
)
{
console
.
log
(
11
)
if
(
!
this
.
ruleForm
.
id
)
{
this
.
$message
.
error
(
'请先系统配置'
)
}
var
url
=
`
${
this
.
ruleForm
.
project_no
}
/
${
str
}
`
var
url
=
`
${
this
.
ruleForm
.
project_no
}
/
${
str
}
`
this
.
$API
.
get
(
`mesAPI/connection/
${
url
}
/`
).
then
(
res
=>
{
this
.
$API
.
get
(
`mesAPI/connection/
${
url
}
/`
).
then
(
res
=>
{
if
(
res
.
data
.
message
===
'连接成功'
)
{
this
.
$message
.
success
(
res
.
data
.
message
)
}
else
{
if
(
res
.
data
.
message
===
'连接成功'
)
{
this
.
$message
.
success
(
res
.
data
.
message
)
}
else
{
...
@@ -317,6 +355,7 @@ export default {
...
@@ -317,6 +355,7 @@ export default {
this
.
$API
.
post
(
`mesAPI/connection/`
,
{},
{},
this
.
ruleForm
).
then
(
res
=>
{
this
.
$API
.
post
(
`mesAPI/connection/`
,
{},
{},
this
.
ruleForm
).
then
(
res
=>
{
if
(
res
.
data
.
message
===
'保存成功'
)
{
this
.
$message
.
success
(
res
.
data
.
message
)
}
else
{
if
(
res
.
data
.
message
===
'保存成功'
)
{
this
.
$message
.
success
(
res
.
data
.
message
)
}
else
{
this
.
$message
.
error
(
res
.
data
.
message
)
this
.
$message
.
error
(
res
.
data
.
message
)
this
.
get_project
()
}
}
})
})
},
},
...
...
src/utils/sha256/HSHttpClient.js
View file @
2a3297c6
...
@@ -102,7 +102,7 @@ class HSHttpClient {
...
@@ -102,7 +102,7 @@ class HSHttpClient {
baseURL
:
process
.
env
.
BASE_API
,
baseURL
:
process
.
env
.
BASE_API
,
url
,
url
,
data
:
qs
.
stringify
(
params
),
data
:
qs
.
stringify
(
params
),
timeout
:
15
000
,
timeout
:
600
000
,
headers
:
{
headers
:
{
// 'X-Requested-With': 'XMLHttpRequest',
// 'X-Requested-With': 'XMLHttpRequest',
'Content-Type'
:
'application/x-www-form-urlencoded; charset=UTF-8'
'Content-Type'
:
'application/x-www-form-urlencoded; charset=UTF-8'
...
@@ -139,7 +139,7 @@ const clint = {
...
@@ -139,7 +139,7 @@ const clint = {
baseURL
:
process
.
env
.
BASE_API
,
baseURL
:
process
.
env
.
BASE_API
,
url
,
url
,
data
:
qs
.
stringify
(
data
),
data
:
qs
.
stringify
(
data
),
timeout
:
15
000
,
timeout
:
600
000
,
headers
:
{
headers
:
{
// 'X-Requested-With': 'XMLHttpRequest',
// 'X-Requested-With': 'XMLHttpRequest',
'Content-Type'
:
'application/x-www-form-urlencoded; charset=UTF-8'
'Content-Type'
:
'application/x-www-form-urlencoded; charset=UTF-8'
...
...
src/utils/sha256/myHttpClient.js
View file @
2a3297c6
...
@@ -6,7 +6,7 @@ const _getHeaderUrl = Symbol('_getHeaderUrl')
...
@@ -6,7 +6,7 @@ const _getHeaderUrl = Symbol('_getHeaderUrl')
// import { Loading } from 'element-ui'
// import { Loading } from 'element-ui'
import
axios
from
'axios'
import
axios
from
'axios'
import
store
from
'../../store/storeAll'
import
store
from
'../../store/storeAll'
import
NProgress
from
'nprogress'
// 引入nprogress插件
//
import NProgress from 'nprogress' // 引入nprogress插件
import
'nprogress/nprogress.css'
// 这个nprogress样式必须引入
import
'nprogress/nprogress.css'
// 这个nprogress样式必须引入
axios
.
defaults
.
timeout
=
600000
// 超时时间
axios
.
defaults
.
timeout
=
600000
// 超时时间
// 生成一个时间戳
// 生成一个时间戳
...
@@ -54,7 +54,7 @@ axios.interceptors.request.use(
...
@@ -54,7 +54,7 @@ axios.interceptors.request.use(
}
else
{
}
else
{
config
.
url
=
config
.
url
.
replace
(
'//'
,
'/'
)
config
.
url
=
config
.
url
.
replace
(
'//'
,
'/'
)
}
}
NProgress
.
start
()
//
NProgress.start()
show_full_screen_loading
()
show_full_screen_loading
()
}
}
return
config
return
config
...
@@ -97,7 +97,7 @@ function response_error_del(error) {
...
@@ -97,7 +97,7 @@ function response_error_del(error) {
let
error_detail
=
''
let
error_detail
=
''
if
(
!
response
&&
!
code
)
{
if
(
!
response
&&
!
code
)
{
// 没网的情况
// 没网的情况
error_title
=
'网络连接失败,请检查网络!'
error_title
=
'网络连接
网络连接
失败,请检查网络!'
error_detail
=
'尝试关闭网站重新登陆!'
error_detail
=
'尝试关闭网站重新登陆!'
}
else
if
(
code
===
'ECONNABORTED'
)
{
}
else
if
(
code
===
'ECONNABORTED'
)
{
error_title
=
'请求超时ECONNABORTED'
error_title
=
'请求超时ECONNABORTED'
...
@@ -157,7 +157,7 @@ axios.interceptors.response.use(
...
@@ -157,7 +157,7 @@ axios.interceptors.response.use(
}
}
}
}
}
}
NProgress
.
done
()
// 设置加载进度条(结束..)
//
NProgress.done() // 设置加载进度条(结束..)
return
response
return
response
},
},
function
(
error
)
{
function
(
error
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment