Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
thinkApp
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
游洁
thinkApp
Commits
d79b8da5
Commit
d79b8da5
authored
May 25, 2022
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
b08bdf30
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
106 deletions
+5
-106
accountLogin.vue
src/pages/login/accountLogin.vue
+5
-106
No files found.
src/pages/login/accountLogin.vue
View file @
d79b8da5
...
...
@@ -26,7 +26,7 @@
</view>
<view
class=
"login-bottom"
>
<view
class=
"login-bottom-text"
@
click=
"back"
>
返回
</view>
<
view
class=
"login-bottom-text"
>
忘记密码
</view
>
<
!--
<view
class=
"login-bottom-text"
>
忘记密码
</view>
--
>
</view>
</view>
</view>
...
...
@@ -65,15 +65,12 @@
let
msg
=
reactive
({
Account
:
""
,
Password
:
""
,
// openId:"",
// uniunId:"",
});
let
data
=
reactive
({
phoneNum
:
""
,
openid
:
""
,
code
:
""
,
show
:
false
,
showVisitor
:
false
,
});
let
methods
=
{
...
...
@@ -94,8 +91,6 @@
});
clearTimeout
();
},
async
login
()
{
if
(
msg
.
Account
==
""
||
!
msg
.
Account
)
{
Toast
.
fail
(
"请输入账号"
);
...
...
@@ -119,102 +114,6 @@
}
})
},
login2
()
{
uni
.
login
({
provider
:
'weixin'
,
success
:
async
(
loginRes
)
=>
{
let
code
=
loginRes
.
code
data
.
code
=
code
}
});
},
//获取手机号
getphonenumber
(
e
)
{
if
(
e
.
detail
.
encryptedData
&&
e
.
detail
.
iv
)
{
let
encryptedData
=
e
.
detail
.
encryptedData
;
let
iv
=
e
.
detail
.
iv
;
that
.
parsePhoneNum
(
encryptedData
,
iv
,
data
.
code
)
}
else
{
Toast
.
fail
(
"授权失败,请重新授权"
)
}
},
//解密手机号
async
parsePhoneNum
(
encryptedData
,
iv
,
code
)
{
let
res
=
await
parsePhone
({
encryptedData
,
iv
,
code
})
if
(
res
&&
res
.
Data
.
phoneNumber
)
{
data
.
phoneNum
=
res
.
Data
.
phoneNumber
data
.
openid
=
res
.
Data
.
openid
that
.
phoneNumLogin
()
}
else
{
Toast
.
fail
(
"授权失败,请重新授权"
)
}
},
//手机号授权登录
async
phoneNumLogin
()
{
let
res
=
await
phoneLogin
({
Account
:
data
.
phoneNum
,
OpenId
:
data
.
openid
})
if
(
res
)
{
res
.
Data
.
Account
=
data
.
phoneNum
;
uni
.
setStorageSync
(
"userInfo"
,
res
.
Data
);
Toast
.
success
(
"登录成功"
);
setTimeout
(()
=>
{
let
data
=
uni
.
getStorageSync
(
"userInfo"
);
if
(
data
)
{
that
.
jumpPage
();
}
},
1000
);
}
},
async
login3
()
{
//游客登录
data
.
show
=
false
let
temporarydh
=
uni
.
getStorageSync
(
"temporarydh"
)
if
(
temporarydh
)
{
let
msg
=
{
Account
:
temporarydh
.
Account
,
OpenId
:
temporarydh
.
OpenId
,
unionid
:
temporarydh
.
unionid
,
WeChatName
:
temporarydh
.
WeChatName
,
WeChatPhoto
:
temporarydh
.
WeChatPhoto
,
IsVisitor
:
1
,
}
let
res
=
await
phoneLogin
(
msg
)
if
(
res
)
{
res
.
Data
.
Account
=
data
.
phoneNum
;
uni
.
setStorageSync
(
"userInfo"
,
res
.
Data
);
Toast
.
success
(
"登录成功"
);
setTimeout
(()
=>
{
let
data
=
uni
.
getStorageSync
(
"userInfo"
);
if
(
data
)
{
that
.
jumpPage
();
}
},
1000
);
}
}
else
{
uni
.
showToast
({
icon
:
"none"
,
title
:
"未授权电话,请先点击授权按钮"
,
duration
:
2000
,
})
// setTimeout(()=>{
// uni.reLaunch({
// url: '/pages/index/index' //没有授权登录
// });
// },1500)
}
},
againdata
()
{
uni
.
reLaunch
({
url
:
'/pages/index/index'
});
},
};
onMounted
(()
=>
{});
let
that
=
methods
;
...
...
@@ -225,8 +124,7 @@
};
},
onLoad
()
{
//审核用
this
.
showVisitor
=
new
Date
().
getTime
()
>
new
Date
(
'2022-03-16'
).
getTime
()
}
};
</
script
>
...
...
@@ -259,8 +157,9 @@
top
:
-261
rpx
;
}
.login-bottom
.login-bottom-text
:first-child
{
border-right
:
1
rpx
solid
#E1E1E1
;
padding
:
0
110
rpx
0
0
;
/* border-right: 1rpx solid #E1E1E1;
padding: 0 110rpx 0 0; */
padding
:
0
110
rpx
;
}
.login-bottom-text
{
padding
:
0
0
0
110
rpx
;
...
...
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