Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
techbook
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
front-end-dev
techbook
Commits
de1a1bdf
Commit
de1a1bdf
authored
Mar 29, 2021
by
anxixi
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
0b8cea22
c6c322b0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
api.js
src/api/api.js
+32
-0
commonApi.js
src/common/commonApi.js
+1
-1
No files found.
src/api/api.js
View file @
de1a1bdf
...
...
@@ -460,6 +460,38 @@ export default {
}
},
fetchNoCancelLoadingPost
(
url
,
params
,
method
=
'POST'
)
{
var
langVal
=
url
.
indexOf
(
'?'
)
==
-
1
?
'?lang='
+
lang
:
'&lang='
+
lang
,
_this
=
this
;
return
new
Promise
((
resolve
,
reject
)
=>
{
axios
({
method
:
method
,
url
:
base
+
url
+
langVal
+
"&t="
+
Date
.
parse
(
new
Date
()),
data
:
params
,
headers
:
{
accessToken
:
publicFun
.
getCookie
(
publicFun
.
judgeBrand
()
+
"userInfo"
)
?
JSON
.
parse
(
require
(
'js-base64'
).
Base64
.
decode
(
publicFun
.
getCookie
(
publicFun
.
judgeBrand
()
+
"userInfo"
))).
accessToken
:
''
,
deviceId
:
publicFun
.
getCookie
(
"getGuid32"
),
clientCode
:
clientCode
,
'Content-Security-Policy'
:
"script-src 'self'; object-src 'none'; style-src cdn.example.org third-party.org;"
},
},
{
// 单独配置
withCredentials
:
true
}).
then
((
response
)
=>
{
if
(
response
.
headers
.
loginstatus
==
2
)
{
publicFun
.
removeCookie
(
"userInfo"
);
}
_this
.
getCodeFunc
(
response
.
data
.
code
,
resolve
,
response
)
}).
catch
((
error
)
=>
{
if
(
axios
.
isCancel
(
error
))
{
console
.
log
(
'Rquest canceled'
,
error
.
message
);
//请求如果被取消,这里是返回取消的message
}
else
{
reject
(
error
)
}
})
})
},
//导出
fetchLoadingPostex
(
url
,
params
,
method
=
'POST'
)
{
var
langVal
=
url
.
indexOf
(
'?'
)
==
-
1
?
'?lang='
+
lang
:
'&lang='
+
lang
,
_this
=
this
;
...
...
src/common/commonApi.js
View file @
de1a1bdf
...
...
@@ -241,6 +241,6 @@ export default {
//获取用户浏览轨迹
getUserTrajectory
(
params
){
return
api
.
fetch
Login
(
"/business/log/viewLog"
,
params
);
return
api
.
fetch
NoCancelLoadingPost
(
"/business/log/viewLog"
,
params
);
}
}
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