Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
dev
/
marubi-wish-list-mp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
a422d568
authored
2019-08-07 10:22:27 +0800
by
simon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
no message
1 parent
29013641
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
src/component/authorize-comp/authorize-comp.js
src/http/fetch-api.js
src/component/authorize-comp/authorize-comp.js
View file @
a422d56
...
...
@@ -31,7 +31,7 @@ Component({
getUserInfo
(
e
)
{
let
_this
=
this
;
app
.
globalData
.
userInfo
=
e
.
userInfo
;
console
.
log
(
"before register : code = "
,
app
.
store
.
getItem
(
"wxcode"
)
)
console
.
log
(
"before register : code = "
,
app
.
store
.
getItem
(
"wxcode"
))
app
.
post
({
url
:
app
.
api
.
register
,
sid
:
false
,
...
...
@@ -43,6 +43,13 @@ Component({
}
}).
then
((
res2
)
=>
{
wx
.
hideLoading
();
if
(
res2
&&
res2
.
sessionId
)
{
app
.
store
.
setItem
(
'sessionId'
,
res2
.
sessionId
);
// wx.showToast({
// title: '授权成功',
// icon: 'none'
// })
}
_this
.
hideMask
();
}).
catch
((
err
)
=>
{})
},
...
...
src/http/fetch-api.js
View file @
a422d56
...
...
@@ -3,21 +3,17 @@ let Store = require('./../utils/stroage');
let
Router
=
require
(
'./../router/index'
);
const
errMsg
=
'服务异常,请稍后重试'
;
let
isWxLogin
=
false
;
//
let isWxLogin = false;
function
wxLogin
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
isWxLogin
)
{
resolve
();
}
else
{
wx
.
login
({
success
:
function
(
res
)
{
isWxLogin
=
true
;
//
isWxLogin = true;
Store
.
setItem
(
'wxcode'
,
res
.
code
);
resolve
();
}
});
}
});
}
...
...
Please
register
or
sign in
to post a comment