Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
group-buy-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
group-buy-ui
Commits
1efebfd8
Commit
1efebfd8
authored
Sep 28, 2021
by
Xuguangxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 重点- 更新login
parent
bb0ef83a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
11 deletions
+4
-11
httpDecorator.js
src/service/httpDecorator.js
+3
-5
init.service.js
src/service/init.service.js
+1
-6
No files found.
src/service/httpDecorator.js
View file @
1efebfd8
...
@@ -40,15 +40,13 @@ const http = new HttpRequest(
...
@@ -40,15 +40,13 @@ const http = new HttpRequest(
return
[
null
,
error
];
return
[
null
,
error
];
},
},
request
(
cfg
)
{
request
(
cfg
)
{
const
{
method
,
hideVccChannel
}
=
cfg
;
const
{
method
}
=
cfg
;
cfg
.
headers
[
'
X-Auth-Token
'
]
=
localStorage
.
get
(
'
vccToken
'
)
||
''
;
cfg
.
headers
[
'
X-Auth-Token
'
]
=
localStorage
.
get
(
'
vccToken
'
)
||
''
;
if
(
cfg
.
customHeader
)
{
if
(
cfg
.
customHeader
)
{
Object
.
assign
(
cfg
.
headers
,
cfg
.
customHeader
);
Object
.
assign
(
cfg
.
headers
,
cfg
.
customHeader
);
}
}
if
(
!
hideVccChannel
)
{
cfg
.
headers
[
'
vccChannel
'
]
=
getVccChannel
();
cfg
.
headers
[
'
vccChannel
'
]
=
getVccChannel
();
cfg
.
headers
[
'
sonVccChannel
'
]
=
getVccChannel
(
'
sonVccChannel
'
);
cfg
.
headers
[
'
sonVccChannel
'
]
=
getVccChannel
(
'
sonVccChannel
'
);
}
if
(
method
===
'
post
'
&&
cfg
.
emulateJSON
)
{
if
(
method
===
'
post
'
&&
cfg
.
emulateJSON
)
{
cfg
.
headers
[
'
Content-Type
'
]
=
'
application/x-www-form-urlencoded
'
;
cfg
.
headers
[
'
Content-Type
'
]
=
'
application/x-www-form-urlencoded
'
;
cfg
.
data
=
getURLSearchParams
(
cfg
.
data
);
cfg
.
data
=
getURLSearchParams
(
cfg
.
data
);
...
...
src/service/init.service.js
View file @
1efebfd8
...
@@ -23,15 +23,10 @@ export default {
...
@@ -23,15 +23,10 @@ export default {
isIOS
&&
localStorage
.
set
(
'
vccChannel
'
,
'
214
'
);
isIOS
&&
localStorage
.
set
(
'
vccChannel
'
,
'
214
'
);
isAndroid
&&
localStorage
.
set
(
'
vccChannel
'
,
'
217
'
);
isAndroid
&&
localStorage
.
set
(
'
vccChannel
'
,
'
217
'
);
meta
?.
has
?.
header
&&
store
.
commit
(
'
CHANGE_HEADER
'
,
meta
.
has
.
header
);
// 改变header
meta
?.
has
?.
header
&&
store
.
commit
(
'
CHANGE_HEADER
'
,
meta
.
has
.
header
);
// 改变header
const
localParams
=
[
'
token
'
,
'
redirectUrl
'
,
'
h
'
,
'
vccToken
'
,
'
vccChannel
'
,
'
sonVccChannel
'
];
const
localParams
=
[
'
redirectUrl
'
,
'
h
'
,
'
vccToken
'
,
'
vccChannel
'
,
'
sonVccChannel
'
];
// TODO: 类似逻辑可以整合
// TODO: 类似逻辑可以整合
localParams
.
forEach
(
item
=>
{
localParams
.
forEach
(
item
=>
{
const
value
=
to
.
query
[
item
];
const
value
=
to
.
query
[
item
];
console
.
log
(
item
,
value
);
if
(
item
===
'
token
'
&&
value
===
''
)
{
localStorage
.
remove
(
'
token
'
);
Cookies
.
remove
(
'
token
'
);
}
if
(
item
===
'
vccToken
'
&&
value
===
''
)
{
if
(
item
===
'
vccToken
'
&&
value
===
''
)
{
localStorage
.
remove
(
'
vccToken
'
);
localStorage
.
remove
(
'
vccToken
'
);
Cookies
.
remove
(
'
vccToken
'
);
Cookies
.
remove
(
'
vccToken
'
);
...
...
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