Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 68155df3
authored
Feb 26, 2022
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
--no commit message
1 parent
ddc1e70c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
15 deletions
linkwe-mobile/src/utils/index.js
linkwe-mobile/src/views/redPacket/receive.vue
linkwe-mobile/src/utils/index.js
View file @
68155df
...
...
@@ -59,14 +59,14 @@ export function getQueryValue(name) {
export
async
function
getWxCode
()
{
let
userinfo
=
localStorage
.
getItem
(
'userinfo'
)
//取缓存中的用户信息
//
if (userinfo) {
//
try {
//
userinfo = JSON.parse(userinfo)
//
} catch (error) {
//
alert(error)
//
}
//
return userinfo.openId
//
}
if
(
userinfo
)
{
try
{
userinfo
=
JSON
.
parse
(
userinfo
)
}
catch
(
error
)
{
alert
(
error
)
}
return
userinfo
.
openId
}
//缓存中没有用户信息,进入授权流程
let
appid
=
window
.
CONFIG
.
appId
// 公众号appid
...
...
linkwe-mobile/src/views/redPacket/receive.vue
View file @
68155df
...
...
@@ -45,14 +45,18 @@ export default {
duration
:
0
,
forbidClick
:
true
,
})
getWxCode
().
then
((
openId
)
=>
{
if
(
openId
)
{
this
.
openId
=
openId
this
.
getRedPacketInfo
()
}
else
{
getWxCode
()
.
then
((
openId
)
=>
{
if
(
openId
)
{
this
.
openId
=
openId
this
.
getRedPacketInfo
()
}
else
{
this
.
$toast
.
clear
()
}
})
.
catch
(()
=>
{
this
.
$toast
(
'授权异常,请刷新重试'
)
}
})
})
},
getRedPacketInfo
()
{
getRedPacketInfo
().
then
(({
data
})
=>
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment