Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
德宏大魔王
uni-starter
提交
3de4d89e
U
uni-starter
项目概览
德宏大魔王
/
uni-starter
与 Fork 源项目一致
Fork自
DCloud / uni-starter
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-starter
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
3de4d89e
编写于
4月 10, 2021
作者:
L
linju
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
123
上级
3f548d5c
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
190 addition
and
149 deletion
+190
-149
uni_modules/uni-login-page/pages/index/index.vue
uni_modules/uni-login-page/pages/index/index.vue
+27
-27
uni_modules/uni-login-page/pages/index/pwd-login.vue
uni_modules/uni-login-page/pages/index/pwd-login.vue
+100
-100
uni_modules/uni-login-page/pages/index/pwd-retrieve.vue
uni_modules/uni-login-page/pages/index/pwd-retrieve.vue
+53
-19
uni_modules/uni-quick-login/uniCloud/cloudfunctions/user-center/index.js
...-quick-login/uniCloud/cloudfunctions/user-center/index.js
+10
-3
未找到文件。
uni_modules/uni-login-page/pages/index/index.vue
浏览文件 @
3de4d89e
...
...
@@ -56,7 +56,7 @@
currenPhoneArea
:
'
+86
'
,
formData
:
{
phone
:
'
177
77777777
'
phone
:
'
177
69516081
'
},
rules
:
{
// 对phone字段进行必填验证
...
...
uni_modules/uni-login-page/pages/index/pwd-login.vue
浏览文件 @
3de4d89e
...
...
@@ -51,7 +51,7 @@
currenPhoneArea
:
'
+86
'
,
formData
:
{
phone
:
'
177
77777777
'
,
phone
:
'
177
69516081
'
,
pwd
:
'
123456
'
},
rules
:
{
...
...
uni_modules/uni-login-page/pages/index/pwd-retrieve.vue
浏览文件 @
3de4d89e
...
...
@@ -18,7 +18,7 @@
v-model=
"formData.pwd"
placeholder=
"请输入新密码"
></uni-easyinput>
</uni-forms-item>
<button
class=
"send-btn-box"
:disabled=
"!canSubmit"
:type=
"canSubmit?'primary':'default'"
@
click=
"
submit
"
>
完成
</button>
@
click=
"
checkCode(submit)
"
>
完成
</button>
</uni-forms>
</view>
</view>
...
...
@@ -130,6 +130,54 @@ import mixin from '../../common/loginPage.mixin.js';
}
})
},
checkCode
(
callback
){
uniCloud
.
callFunction
({
//联网验证登陆
"
name
"
:
"
user-center
"
,
"
data
"
:
{
"
action
"
:
"
loginBySms
"
,
"
params
"
:{
"
mobile
"
:
this
.
phoneNumber
,
"
code
"
:
this
.
formData
.
code
}
},
success
:
async
(
e
)
=>
{
uni
.
hideLoading
()
console
.
log
(
e
.
result
);
if
(
e
.
result
.
code
===
0
){
uni
.
setStorageSync
(
'
uni_id_uid
'
,
e
.
result
.
uid
)
uni
.
setStorageSync
(
'
uni_id_token
'
,
e
.
result
.
token
)
uni
.
setStorageSync
(
'
uni_id_token_expired
'
,
e
.
result
.
tokenExpired
)
// uni.showToast({
// title: '登陆成功',
// icon: 'none'
// });
callback
()
}
else
{
uni
.
showModal
({
title
:
'
错误
'
,
content
:
e
.
result
.
msg
,
showCancel
:
false
,
confirmText
:
'
知道了
'
,
});
}
},
fail
:
(
err
)
=>
{
console
.
log
(
err
);
uni
.
showModal
({
title
:
'
错误
'
,
content
:
JSON
.
stringify
(
err
),
showCancel
:
false
,
confirmText
:
'
知道了
'
,
});
if
(
err
.
errCode
===
30002
){
}
},
complete
:
()
=>
{
uni
.
hideLoading
()
}
})
},
/**
* 完成并提交
*/
...
...
@@ -137,34 +185,20 @@ import mixin from '../../common/loginPage.mixin.js';
uniCloud
.
callFunction
({
name
:
"
user-center
"
,
"
data
"
:{
"
action
"
:
"
login
"
,
"
action
"
:
"
resetPwd
"
,
"
params
"
:{
"
username
"
:
this
.
formData
.
phone
,
"
password
"
:
this
.
formData
.
pwd
}
},
success
:
async
(
e
)
=>
{
uni
.
hideLoading
()
console
.
log
(
e
.
result
);
if
(
e
.
result
.
code
===
0
){
uni
.
setStorageSync
(
'
uni_id_uid
'
,
e
.
result
.
uid
)
uni
.
setStorageSync
(
'
uni_id_token
'
,
e
.
result
.
token
)
uni
.
setStorageSync
(
'
uni_id_token_expired
'
,
e
.
result
.
tokenExpired
)
// console.log('66666=',e.result.uid,e.result.token,e.result.tokenExpired);
delete
e
.
result
.
userInfo
.
token
this
.
setUserInfo
(
e
.
result
.
userInfo
)
uni
.
showToast
({
title
:
'
登陆成功
'
,
title
:
e
.
result
.
msg
,
icon
:
'
none
'
});
if
(
e
.
result
.
code
===
0
){
uni
.
navigateBack
()
}
else
{
uni
.
showModal
({
title
:
'
错误
'
,
content
:
e
.
result
.
msg
,
showCancel
:
false
,
confirmText
:
'
知道了
'
,
});
}
},
fail
:
(
err
)
=>
{
...
...
uni_modules/uni-quick-login/uniCloud/cloudfunctions/user-center/index.js
浏览文件 @
3de4d89e
...
...
@@ -32,6 +32,7 @@ exports.main = async (event, context) => {
'
createCaptcha
'
,
'
verifyCaptcha
'
,
'
refreshCaptcha
'
,
'
inviteLogin
'
,
'
login_by_weixin
'
,
'
login_by_univerify
'
,
'
login_by_apple
'
,
'
loginBySms
'
]
let
payload
;
console
.
log
(
event
.
action
);
if
(
!
noCheckAction
.
includes
(
event
.
action
))
{
if
(
!
event
.
uniIdToken
)
{
...
...
@@ -40,7 +41,7 @@ exports.main = async (event, context) => {
msg
:
'
缺少token
'
}
}
let
payload
=
await
uniID
.
checkToken
(
event
.
uniIdToken
)
payload
=
await
uniID
.
checkToken
(
event
.
uniIdToken
)
if
(
payload
.
code
&&
payload
.
code
>
0
)
{
return
payload
}
...
...
@@ -88,7 +89,10 @@ exports.main = async (event, context) => {
}
if
(
!
needCaptcha
||
passed
)
{
res
=
await
uniID
.
login
({...
params
,
"
queryField
"
:[
'
username
'
,
'
email
'
,
'
mobile
'
]});
res
=
await
uniID
.
login
({
...
params
,
queryField
:
[
'
username
'
,
'
email
'
,
'
mobile
'
]
});
await
loginLog
(
res
);
needCaptcha
=
await
getNeedCaptcha
();
}
...
...
@@ -124,7 +128,7 @@ exports.main = async (event, context) => {
msg
:
'
请求过于频繁
'
}
}
const
templateId
=
''
// 替换为自己申请的模板id
const
templateId
=
'
11753
'
// 替换为自己申请的模板id
if
(
!
templateId
)
{
return
{
code
:
500
,
...
...
@@ -193,6 +197,9 @@ exports.main = async (event, context) => {
case
'
refreshCaptcha
'
:
res
=
await
uniCaptcha
.
refresh
(
params
)
break
;
case
'
resetPwd
'
:
res
=
await
uniID
.
resetPwd
({...
params
,
"
uid
"
:
payload
.
uid
})
break
;
default
:
res
=
{
code
:
403
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录