Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
traceSourceMb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yanyanhong
traceSourceMb
Commits
38a9de52
Commit
38a9de52
authored
May 29, 2020
by
yyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
浏览器环境配置
parent
01205811
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
16 deletions
+27
-16
.env.development
.env.development
+2
-2
.env.production
.env.production
+2
-2
.env.test
.env.test
+2
-2
http.ts
src/utils/http.ts
+10
-3
ProofList.vue
src/views/ProofList.vue
+11
-7
No files found.
.env.development
View file @
38a9de52
VUE_APP_SERVER=http://172.16.101.87:46789/api
VUE_APP_BROWSER=http://www.baidu.com
\ No newline at end of file
VUE_APP_BROWSER=http://47.114.159.142:9033
\ No newline at end of file
.env.production
View file @
38a9de52
VUE_APP_SERVER=http://172.16.101.87:46789/api
VUE_APP_BROWSER=http://www.baidu.com
\ No newline at end of file
VUE_APP_BROWSER=http://47.114.159.142:9033
\ No newline at end of file
.env.test
View file @
38a9de52
NODE_ENV
=
development
VUE_APP_SERVER
=
http
://
172.16
.
101.87
:
46789
/
api
VUE_APP_BROWSER
=
http
://
www
.
baidu
.
com
\ No newline at end of file
VUE_APP_BROWSER
=
http
://
47.114
.
159.142
:
9033
\ No newline at end of file
src/utils/http.ts
View file @
38a9de52
...
...
@@ -77,6 +77,7 @@ const instance = axios.create({ timeout: 1000 * 12});
// 设置post请求头
instance
.
defaults
.
headers
.
post
[
'Content-Type'
]
=
'application/json'
;
let
loading
:
any
;
let
time
:
number
;
/**
* 请求拦截器
* 每次请求前,如果存在token则在请求头中携带token
...
...
@@ -95,6 +96,7 @@ instance.interceptors.request.use(
duration
:
0
,
forbidClick
:
true
,
});
time
=
Date
.
now
();
}
config
.
cancelToken
=
new
CancelToken
((
c
)
=>
{
removePendingAjax
(
config
,
c
);
...
...
@@ -111,9 +113,14 @@ instance.interceptors.response.use(
// 请求成功
(
res
:
any
)
=>
{
removePendingAjax
(
res
.
config
);
setTimeout
(()
=>
{
loading
.
clear
();
},
200
);
const
diff
=
200
-
(
Date
.
now
()
-
time
);
if
(
diff
)
{
setTimeout
(()
=>
{
loading
&&
loading
.
clear
();
},
diff
);
}
else
{
loading
&&
loading
.
clear
();
}
if
(
res
.
status
===
200
)
{
if
(
res
.
data
.
code
===
200
)
{
return
Promise
.
resolve
(
res
.
data
.
data
);
...
...
src/views/ProofList.vue
View file @
38a9de52
...
...
@@ -31,7 +31,7 @@
:proof=
"proof"
:key=
"proof.id"
@
show-more-action=
"showMoreAction"
@
click
.
native=
"goProofDetail(proof
.id
)"
@
click
.
native=
"goProofDetail(proof)"
></proof-item>
</van-list>
...
...
@@ -120,10 +120,10 @@ export default class ProofList extends Vue {
private
select
(
type
:
string
)
{
const
obj
:
any
=
{
blockChain
:
()
=>
{
this
.
blockChainProof
(
this
.
currentProof
);
},
edit
:
()
=>
{
this
.
goProofDetail
(
this
.
currentProof
.
id
);
},
edit
:
()
=>
{
this
.
goProofDetail
(
this
.
currentProof
);
},
del
:
()
=>
{
this
.
delProof
(
this
.
currentProof
.
id
);
},
copy
:
()
=>
{
this
.
copyProof
(
this
.
currentProof
);
},
blockquery
:
()
=>
{
this
.
goToBROWSER
();
},
blockquery
:
()
=>
{
this
.
goToBROWSER
(
this
.
currentProof
);
},
copyhash
:
()
=>
{
this
.
copyHash
(
this
.
currentProof
);
},
del2
:
()
=>
{
this
.
abandonProof
(
this
.
currentProof
.
id
);
},
};
...
...
@@ -156,8 +156,12 @@ export default class ProofList extends Vue {
});
}
private
goProofDetail
(
proofId
:
string
)
{
this
.
$router
.
push
({
name
:
'ProofDetail'
,
query
:
{
proofId
}});
private
goProofDetail
(
proof
:
any
)
{
if
([
ChainStatus
.
SUCCESS
].
includes
(
proof
.
status
)
)
{
location
.
href
=
process
.
env
.
VUE_APP_BROWSER
+
`/product?hash=0x
${
proof
.
hash
}
`
;
}
else
{
this
.
$router
.
push
({
name
:
'ProofDetail'
,
query
:
{
proofId
:
proof
.
id
}});
}
}
private
showMoreAction
(
data
:
any
)
{
this
.
show
=
true
;
...
...
@@ -246,8 +250,8 @@ export default class ProofList extends Vue {
this
.
$copyText
(
proof
.
hash
);
this
.
$toast
(
'hash地址复制成功'
);
}
private
goToBROWSER
()
{
location
.
href
=
process
.
env
.
VUE_APP_BROWSER
;
private
goToBROWSER
(
proof
:
any
)
{
location
.
href
=
process
.
env
.
VUE_APP_BROWSER
+
`/product?hash=0x
${
proof
.
hash
}
`
;
}
}
</
script
>
...
...
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