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
16432f73
Commit
16432f73
authored
Sep 28, 2021
by
Xuguangxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: login
parent
ff35bbf5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
groupShare.vue
src/components/groupShare.vue
+2
-2
goodsCheck.mixin.js
src/mixins/goodsCheck.mixin.js
+1
-0
init.service.js
src/service/init.service.js
+10
-4
No files found.
src/components/groupShare.vue
View file @
16432f73
...
@@ -163,8 +163,8 @@ export default {
...
@@ -163,8 +163,8 @@ export default {
'
pages/groupbuy/webview
'
'
pages/groupbuy/webview
'
)}
&terminal=1`
;
)}
&terminal=1`
;
const
linkParams
=
encodeURIComponent
(
JSON
.
stringify
({
url
:
linkPath
}));
const
linkParams
=
encodeURIComponent
(
JSON
.
stringify
({
url
:
linkPath
}));
alert
(
linkPrve
);
//
alert(linkPrve);
alert
(
`
${
linkPrve
}
&extraInfo=
${
linkParams
}
`
);
//
alert(`${linkPrve}&extraInfo=${linkParams}`);
return
`
${
linkPrve
}
&extraInfo=
${
linkParams
}
`
;
return
`
${
linkPrve
}
&extraInfo=
${
linkParams
}
`
;
}
}
return
linkPath
;
return
linkPath
;
...
...
src/mixins/goodsCheck.mixin.js
View file @
16432f73
...
@@ -30,6 +30,7 @@ export default {
...
@@ -30,6 +30,7 @@ export default {
},
},
checkLogin
()
{
checkLogin
()
{
const
vccToken
=
localStorage
.
get
(
'
vccToken
'
);
const
vccToken
=
localStorage
.
get
(
'
vccToken
'
);
this
.
$toast
(
vccToken
);
const
needLogin
=
vccToken
?
false
:
true
;
const
needLogin
=
vccToken
?
false
:
true
;
if
(
needLogin
)
{
if
(
needLogin
)
{
if
(
isApp
)
this
.
nativeBridge
=
new
Bridge
();
if
(
isApp
)
this
.
nativeBridge
=
new
Bridge
();
...
...
src/service/init.service.js
View file @
16432f73
...
@@ -5,14 +5,17 @@ import store from '../store';
...
@@ -5,14 +5,17 @@ import store from '../store';
import
{
isWechat
,
isApp
}
from
'
./validation.service
'
;
import
{
isWechat
,
isApp
}
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';
export
default
{
export
default
{
// token校验,整个流程都是登陆后的
// token校验,整个流程都是登陆后的
init
:
router
=>
{
init
:
router
=>
{
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
if
(
!
to
.
query
.
vccToken
)
{
console
.
log
(
!
to
.
query
.
vccToken
);
to
.
query
.
vccToken
=
Cookies
.
get
(
'
vccToken
'
)
||
''
;
// if (!to.query.vccToken) {
}
// to.query.vccToken = Cookies.get('vccToken') || '';
// }
localStorage
.
remove
(
'
vccToken
'
);
Cookies
.
set
(
'
h
'
,
0
);
Cookies
.
set
(
'
h
'
,
0
);
// 所有自定义路由字段在此处理
// 所有自定义路由字段在此处理
const
{
meta
}
=
to
;
const
{
meta
}
=
to
;
...
@@ -22,6 +25,7 @@ export default {
...
@@ -22,6 +25,7 @@ export default {
// 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
===
''
)
{
if
(
item
===
'
token
'
&&
value
===
''
)
{
localStorage
.
remove
(
'
token
'
);
localStorage
.
remove
(
'
token
'
);
}
}
...
@@ -29,11 +33,13 @@ export default {
...
@@ -29,11 +33,13 @@ export default {
localStorage
.
remove
(
'
vccToken
'
);
localStorage
.
remove
(
'
vccToken
'
);
}
}
if
(
value
&&
value
!==
'
{token}
'
&&
value
!==
'
{vccToken}
'
)
{
if
(
value
&&
value
!==
'
{token}
'
&&
value
!==
'
{vccToken}
'
)
{
console
.
log
(
item
,
value
);
localStorage
.
set
(
item
,
value
);
localStorage
.
set
(
item
,
value
);
Cookies
.
set
(
item
,
value
);
Cookies
.
set
(
item
,
value
);
}
}
});
});
// alert(Cookies.get('vccToken'));
localStorage
.
set
(
'
vccToken
'
,
Cookies
.
get
(
'
vccToken
'
)
||
''
);
(
isWechat
||
isApp
||
Cookies
.
get
(
'
h
'
)
===
'
0
'
)
&&
store
.
commit
(
'
CHANGE_HEADER
'
,
false
);
// 改变header
(
isWechat
||
isApp
||
Cookies
.
get
(
'
h
'
)
===
'
0
'
)
&&
store
.
commit
(
'
CHANGE_HEADER
'
,
false
);
// 改变header
document
.
body
.
className
=
store
.
state
.
pay
.
header
?
'
has-header
'
:
''
;
document
.
body
.
className
=
store
.
state
.
pay
.
header
?
'
has-header
'
:
''
;
store
.
commit
(
'
CHANGE_TITLE
'
,
meta
?.
title
);
// 改变title
store
.
commit
(
'
CHANGE_TITLE
'
,
meta
?.
title
);
// 改变title
...
...
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