Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mallapp
Project
Project
Details
Activity
Releases
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
viitto
mallapp
Commits
82a129d3
Commit
82a129d3
authored
Sep 26, 2023
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
bdb012bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
19 deletions
+37
-19
index.vue
components/auth/index.vue
+37
-19
No files found.
components/auth/index.vue
View file @
82a129d3
...
...
@@ -94,24 +94,42 @@ export default {
getUserProfile
()
{
//新的获取用户资料
var
that
=
this
;
wx
.
getUserProfile
({
desc
:
"用于完善资料"
,
// 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success
:
(
info
)
=>
{
console
.
log
(
info
);
this
.
msg
=
{
Id
:
0
,
AliasName
:
info
.
userInfo
.
nickName
,
Photo
:
info
.
userInfo
.
avatarUrl
,
};
that
.
getUserInfo
(
info
);
},
fail
:
()
=>
{
uni
.
showToast
({
title
:
"微信登录授权失败"
,
icon
:
"none"
,
});
},
});
wx
.
login
({
success
:
res
=>
{
let
obj
=
{
Source
:
1
,
OpenId
:
""
,
// Name: info.userInfo.nickName,
// Photo: info.userInfo.avatarUrl,
// Gender: info.userInfo.gender,
Moblie
:
""
,
SuperiorId
:
0
,
code
:
res
.
code
,
}
that
.
getCode
(
obj
);
},
fail
:
(
err
)
=>
{
console
.
log
(
err
,
'=====err'
);
},
})
// wx.getUserProfile({
// desc: "用于完善资料", // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
// success: (info) => {
// console.log(info);
// this.msg = {
// Id: 0,
// AliasName: info.userInfo.nickName,
// Photo: info.userInfo.avatarUrl,
// };
// that.getUserInfo(info);
// },
// fail: (err) => {
// uni.showToast({
// title: "微信登录授权失败",
// icon: "none",
// });
// },
// });
},
getUserInfo
(
info
)
{
var
that
=
this
;
...
...
@@ -119,7 +137,7 @@ export default {
uni
.
getProvider
({
service
:
"oauth"
,
success
:
function
(
res
)
{
if
(
~
res
.
provider
.
indexOf
(
"weixin"
))
{
if
(
res
.
provider
.
indexOf
(
"weixin"
))
{
uni
.
login
({
provider
:
"weixin"
,
success
:
(
res
)
=>
{
...
...
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