Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
7333aca6
Commit
7333aca6
authored
Nov 17, 2021
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改登录功能
parent
78f973bc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
src/api/login.js
+1
-1
src/pages/login/index.vue
+12
-4
No files found.
src/api/login.js
View file @
7333aca6
...
...
@@ -6,7 +6,7 @@ console.log(process.env,'-----------------config------')
export
default
{
//登录
miniLogin
(
options
){
return
request
GE
T
(
`
${
process
.
env
.
OLSHOP_URL
}
/wx/mini_login`
,
options
)
return
request
POS
T
(
`
${
process
.
env
.
OLSHOP_URL
}
/wx/mini_login`
,
options
)
},
//绑定
bindUser
(
options
){
...
...
src/pages/login/index.vue
View file @
7333aca6
...
...
@@ -80,7 +80,8 @@ export default {
test_unionId
:
""
,
fromType
:
''
,
//来源类型 mini:小程序跳转到当前登录页
scene
:
''
,
//场景
ossLink
:
''
//第三方点击进入链接
ossLink
:
''
,
//第三方点击进入链接
wxUserInfo
:{},
};
},
onShow
()
{
...
...
@@ -165,12 +166,15 @@ export default {
}
},
init
()
{
let
_this
=
this
;
return
new
Promise
((
resolve
,
reject
)
=>
{
login
.
miniLogin
({
code
:
this
.
code
,
spokesmanRelId
:
''
,
spokesmanGroupId
:
''
,
spokesmanShopId
:
''
spokesmanShopId
:
''
,
nickname
:
_this
.
wxUserInfo
.
nickName
,
headImgUrl
:
_this
.
wxUserInfo
.
avatarUrl
})
.
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
...
...
@@ -204,6 +208,7 @@ export default {
}
},
getUserProfile
()
{
let
_this
=
this
;
if
(
this
.
content
&&!
this
.
checked
)
{
wx
.
showToast
({
title
:
'您还未同意协议'
,
...
...
@@ -220,6 +225,7 @@ export default {
wx
.
getUserProfile
({
desc
:
'用于完善会员资料'
,
// 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success
:
(
e
)
=>
{
_this
.
wxUserInfo
=
e
.
userInfo
;
this
.
init
()
.
then
(
res
=>
{
//存入openid
...
...
@@ -250,8 +256,10 @@ export default {
});
}
}
else
{
if
(
res
.
data
.
data
.
isHaveUnion
==
"true"
)
{
//有账号
// haveBindUserPhone
// 是否必须绑定手机号(0必须绑定,1不需要绑定
//有账号或不需要绑定手机号
if
(
res
.
data
.
data
.
isHaveUnion
==
"true"
||
this
.
mpApp
.
globalData
.
shopInfo
.
haveBindUserPhone
==
'1'
)
{
this
.
backParams
+=
`&sessionid=
${
res
.
data
.
data
.
sessionId
}
&needCertified=
${
res
.
data
.
data
.
NEED_CERTIFIED
}
`
;
...
...
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