Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
h5-front
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
yimu
h5-front
Commits
8565b353
Commit
8565b353
authored
Mar 25, 2022
by
verestrasz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
328da2b2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
App.vue
src/App.vue
+3
-2
No files found.
src/App.vue
View file @
8565b353
...
@@ -36,6 +36,7 @@ export default {
...
@@ -36,6 +36,7 @@ export default {
mounted
()
{
mounted
()
{
var
local
=
window
.
location
.
href
// 获取页面url
var
local
=
window
.
location
.
href
// 获取页面url
var
appid
=
'wxbdddd81913c795e9'
var
appid
=
'wxbdddd81913c795e9'
let
url
=
window
.
location
.
host
+
"/"
+
window
.
location
.
hash
this
.
timeTask
=
setInterval
(()
=>
{
this
.
timeTask
=
setInterval
(()
=>
{
this
.
setCurrentTime
(
+
new
Date
())
this
.
setCurrentTime
(
+
new
Date
())
},
1000
);
},
1000
);
...
@@ -43,7 +44,7 @@ export default {
...
@@ -43,7 +44,7 @@ export default {
if
(
this
.
code
==
null
||
this
.
code
===
''
){
if
(
this
.
code
==
null
||
this
.
code
===
''
){
// 没有code去拿code;
// 没有code去拿code;
if
(
sysInfo
.
isWechat
)
{
if
(
sysInfo
.
isWechat
)
{
window
.
location
.
href
=
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=
${
appid
}
&redirect_uri=
${
encodeURIComponent
(
loca
l
)}
&response_type=code&scope=snsapi_base&state=1#wechat_redirect`
;
window
.
location
.
href
=
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=
${
appid
}
&redirect_uri=
${
encodeURIComponent
(
ur
l
)}
&response_type=code&scope=snsapi_base&state=1#wechat_redirect`
;
}
}
}
else
{
}
else
{
// 获取得code
// 获取得code
...
@@ -61,7 +62,7 @@ export default {
...
@@ -61,7 +62,7 @@ export default {
error
:
()
=>
{
error
:
()
=>
{
// console.log(error)
// console.log(error)
if
(
sysInfo
.
isWechat
)
{
if
(
sysInfo
.
isWechat
)
{
window
.
location
.
href
=
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=
${
appid
}
&redirect_uri=
${
encodeURIComponent
(
loca
l
)}
&response_type=code&scope=snsapi_base&state=1#wechat_redirect`
;
window
.
location
.
href
=
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=
${
appid
}
&redirect_uri=
${
encodeURIComponent
(
ur
l
)}
&response_type=code&scope=snsapi_base&state=1#wechat_redirect`
;
}
}
this
.
code
=
''
this
.
code
=
''
},
},
...
...
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