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
54326bf3
Commit
54326bf3
authored
Sep 28, 2021
by
beisir
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat/group-buy' of git.quantgroup.cn:ui/group-buy-ui into feat/group-buy
parents
bea9665b
1efebfd8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
12 deletions
+7
-12
httpDecorator.js
src/service/httpDecorator.js
+3
-5
init.service.js
src/service/init.service.js
+4
-7
No files found.
src/service/httpDecorator.js
View file @
54326bf3
...
@@ -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 @
54326bf3
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* Created by jialiu on 17/1/11.
* Created by jialiu on 17/1/11.
*/
*/
import
store
from
'
../store
'
;
import
store
from
'
../store
'
;
import
{
isWechat
,
isApp
}
from
'
./validation.service
'
;
import
{
isWechat
,
isApp
,
isAndroid
,
isIOS
}
from
'
./validation.service
'
;
import
Cookies
from
'
./cookieStorage.service
'
;
import
Cookies
from
'
./cookieStorage.service
'
;
import
localStorage
from
'
./localStorage.service
'
;
import
localStorage
from
'
./localStorage.service
'
;
// import { Toast } from '@qg/cherry-ui';
// import { Toast } from '@qg/cherry-ui';
...
@@ -20,16 +20,13 @@ export default {
...
@@ -20,16 +20,13 @@ export default {
// 所有自定义路由字段在此处理
// 所有自定义路由字段在此处理
const
{
meta
}
=
to
;
const
{
meta
}
=
to
;
isWechat
&&
localStorage
.
set
(
'
vccChannel
'
,
'
159913
'
);
isWechat
&&
localStorage
.
set
(
'
vccChannel
'
,
'
159913
'
);
isIOS
&&
localStorage
.
set
(
'
vccChannel
'
,
'
214
'
);
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