Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
myphone
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
尹烁恒
myphone
Commits
088c8bca
Commit
088c8bca
authored
Jun 07, 2018
by
尹烁恒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
02b214b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
index.vue
src/pages/counter/index.vue
+15
-9
No files found.
src/pages/counter/index.vue
View file @
088c8bca
...
...
@@ -96,7 +96,7 @@ export default {
success
(
res
)
{
that
.
_jscode
=
res
.
code
wx
.
setStorageSync
(
'hasLogin'
,
true
)
resolve
()
resolve
(
res
.
code
)
},
fail
()
{
console
.
log
(
'login fail'
)
...
...
@@ -124,10 +124,11 @@ export default {
console
.
log
(
e
)
if
(
e
.
target
.
errMsg
===
'getUserInfo:ok'
)
{
if
(
wx
.
getStorageSync
(
'hasLogin'
))
{
this
.
getUserInfo
(
e
.
target
)
const
code
=
await
this
.
login
()
this
.
getUserInfo
(
e
.
target
,
code
)
}
else
{
await
this
.
login
()
this
.
getUserInfo
(
e
.
target
)
const
code
=
await
this
.
login
()
this
.
getUserInfo
(
e
.
target
,
code
)
}
}
else
{
wx
.
showModal
({
...
...
@@ -137,11 +138,15 @@ export default {
})
}
},
async
getUserInfo
(
res
)
{
async
getUserInfo
(
res
,
code
=
''
)
{
console
.
log
(
code
,
'userinfo code'
)
if
(
!
code
)
{
code
=
this
.
_jscode
}
fly
.
post
(
'auth_login'
,
{
encrypted_data
:
res
.
encryptedData
,
iv
:
res
.
iv
,
js_code
:
this
.
_js
code
js_code
:
code
})
.
then
(
res
=>
{
console
.
log
(
res
.
data
.
token
,
'token'
)
...
...
@@ -150,8 +155,9 @@ export default {
this
.
handleSubmit
()
})
.
catch
(
async
res
=>
{
await
this
.
login
()
this
.
getUserInfo
(
res
)
const
code
=
await
this
.
login
()
console
.
log
(
'code is 11111'
,
code
)
this
.
getUserInfo
(
res
,
code
)
})
},
getConfig
()
{
...
...
@@ -230,7 +236,7 @@ export default {
const
contentType
=
res
.
header
[
'content-type'
]
store
.
commit
(
'setImage'
,
'data:'
+
contentType
+
';base64,'
+
base64
)
wx
.
hideLoading
()
wx
.
redirect
To
({
wx
.
navigate
To
({
url
:
`/pages/logs/main`
})
}
else
{
...
...
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