Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
萌新之路
uni-starter
提交
be8c2899
U
uni-starter
项目概览
萌新之路
/
uni-starter
与 Fork 源项目一致
Fork自
DCloud / uni-starter
通知
1
Star
1
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
be8c2899
编写于
4月 21, 2021
作者:
DCloud_JSON
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新重置密码逻辑
上级
276bef28
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
57 addition
and
103 deletion
+57
-103
.gitignore
.gitignore
+1
-0
js_sdk/request.js
js_sdk/request.js
+2
-2
uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/package.json
...loud/cloudfunctions/common/uni-config-center/package.json
+2
-2
uni_modules/uni-id/changelog.md
uni_modules/uni-id/changelog.md
+4
-0
uni_modules/uni-id/package.json
uni_modules/uni-id/package.json
+1
-1
uni_modules/uni-id/uniCloud/cloudfunctions/common/uni-id/package-lock.json
...d/uniCloud/cloudfunctions/common/uni-id/package-lock.json
+5
-4
uni_modules/uni-login-page/components/login-short-code/login-short-code.vue
...gin-page/components/login-short-code/login-short-code.vue
+4
-5
uni_modules/uni-login-page/pages/pwd-retrieve/pwd-retrieve.vue
...odules/uni-login-page/pages/pwd-retrieve/pwd-retrieve.vue
+15
-84
uni_modules/uni-login-page/uniCloud/cloudfunctions/user-center/index.js
...i-login-page/uniCloud/cloudfunctions/user-center/index.js
+23
-5
未找到文件。
.gitignore
浏览文件 @
be8c2899
...
...
@@ -3,5 +3,6 @@ unpackage/
node_modules
.DS_Store
uni_modules/uni-id/uniCloud/cloudfunctions/common/uni-id/config.json
uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json
pages/grid/banner.json
pages/list/list.json
\ No newline at end of file
js_sdk/request.js
浏览文件 @
be8c2899
...
...
@@ -16,9 +16,9 @@ export default function request(name,params,callback=false,{showLoading=false,lo
name
=
routers
[
0
]
action
=
routers
[
1
]
}
console
.
log
({
name
,
data
:
{
action
,
params
}})
console
.
log
({
name
,
data
:{
action
,
params
}})
return
new
Promise
((
resolve
,
reject
)
=>
{
uniCloud
.
callFunction
({
name
,
data
:
{
action
,
params
},
uniCloud
.
callFunction
({
name
,
data
:{
action
,
params
},
success
(
e
){
// console.log(e);
const
{
result
:{
data
,
code
}}
=
e
...
...
uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/package.json
浏览文件 @
be8c2899
{
"name"
:
"uni-config-center"
,
"version"
:
"0.0.
1
"
,
"version"
:
"0.0.
2
"
,
"description"
:
"配置中心"
,
"main"
:
"index.js"
,
"keywords"
:
[],
"author"
:
"
fxy060608
"
,
"author"
:
"
DCloud
"
,
"license"
:
"Apache-2.0"
}
\ No newline at end of file
uni_modules/uni-id/changelog.md
浏览文件 @
be8c2899
## 3.1.0(2021-04-19)
-
增加对用户名、邮箱、密码字段的两端去空格
-
默认忽略用户名、邮箱的大小写
[
详情
](
https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=case-sensitive
)
-
修复 customToken导出async方法报错的Bug
## 3.0.12(2021-04-13)
-
调整bindTokenToDevice默认值为false
## 3.0.11(2021-04-12)
...
...
uni_modules/uni-id/package.json
浏览文件 @
be8c2899
{
"id"
:
"uni-id"
,
"displayName"
:
"uni-id"
,
"version"
:
"3.
0.12
"
,
"version"
:
"3.
1.0
"
,
"description"
:
"简单、统一、可扩展的用户中心"
,
"keywords"
:
[
"uniid"
,
...
...
uni_modules/uni-id/uniCloud/cloudfunctions/common/uni-id/package-lock.json
浏览文件 @
be8c2899
{
"name"
:
"uni-id"
,
"version"
:
"3.0.12"
,
"lockfileVersion"
:
1
,
"lockfileVersion"
:
2
,
"requires"
:
true
,
"dependencies"
:
{
"uni-config-center"
:
{
"version"
:
"file:../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
"packages"
:
{
""
:
{
"version"
:
"3.0.12"
,
"license"
:
"Apache-2.0"
}
}
}
uni_modules/uni-login-page/components/login-short-code/login-short-code.vue
浏览文件 @
be8c2899
...
...
@@ -46,7 +46,7 @@
computed
:
{
innerText
()
{
if
(
this
.
reverseNumber
==
0
)
return
'
获取验证码
'
;
return
this
.
reverseNumber
;
return
'
重新发送(
'
+
this
.
reverseNumber
+
'
s)
'
;
}
},
created
()
{
...
...
@@ -136,11 +136,10 @@
justify-content
:
center
;
align-items
:
center
;
}
.inner-text
{
font-size
:
28
rpx
;
.inner-text
{
font-size
:
28
rpx
;
color
:
#AAAAAA
;
}
.inner-text-active
{
color
:
#007aff
;
}
...
...
uni_modules/uni-login-page/pages/pwd-retrieve/pwd-retrieve.vue
浏览文件 @
be8c2899
...
...
@@ -9,7 +9,7 @@
<uni-forms
ref=
"form"
:value=
"formData"
:rules=
"rules"
>
<uni-forms-item
name=
"phone"
>
<uni-easyinput
type=
"number"
class=
"phone-input-box"
:inputBorder=
"false"
v-model=
"formData.phone"
placeholder=
"请输入手机号"
></uni-easyinput>
v-model=
"formData.phone"
maxlength=
"11"
placeholder=
"请输入手机号"
></uni-easyinput>
<uni-easyinput
type=
"number"
class=
"phone-input-box"
:inputBorder=
"false"
v-model=
"formData.code"
maxlength=
"6"
placeholder=
"请输入验证码"
>
<template
slot=
"right"
>
...
...
@@ -20,7 +20,7 @@
v-model=
"formData.pwd"
placeholder=
"请输入新密码"
></uni-easyinput>
</uni-forms-item>
<button
class=
"send-btn-box"
:disabled=
"!canSubmit"
:type=
"canSubmit?'primary':'default'"
@
click=
"
checkCode(submit)
"
>
完成
</button>
@
click=
"
submit
"
>
完成
</button>
</uni-forms>
</view>
</view>
...
...
@@ -33,7 +33,7 @@ import mixin from '../../common/loginPage.mixin.js';
mixins
:[
mixin
],
data
()
{
return
{
currenPhoneArea
:
''
,
currenPhoneArea
:
''
}
},
computed
:
{
...
...
@@ -56,91 +56,22 @@ import mixin from '../../common/loginPage.mixin.js';
}
},
methods
:
{
checkCode
(
callback
){
uniCloud
.
callFunction
({
//联网验证登陆
"
name
"
:
"
user-center
"
,
"
data
"
:
{
"
action
"
:
"
loginBySms
"
,
"
params
"
:{
"
mobile
"
:
this
.
formData
.
phone
,
"
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
()
}
})
},
/**
* 完成并提交
*/
submit
(){
uniCloud
.
callFunction
({
name
:
"
user-center
"
,
"
data
"
:{
"
action
"
:
"
resetPwd
"
,
"
params
"
:{
"
password
"
:
this
.
formData
.
pwd
}
},
success
:
async
(
e
)
=>
{
uni
.
hideLoading
()
console
.
log
(
e
.
result
);
uni
.
showToast
({
title
:
e
.
result
.
msg
,
icon
:
'
none
'
});
if
(
e
.
result
.
code
===
0
){
uni
.
navigateBack
()
}
},
fail
:
(
err
)
=>
{
console
.
log
(
err
);
uni
.
showModal
({
title
:
'
错误
'
,
content
:
JSON
.
stringify
(
err
),
showCancel
:
false
,
confirmText
:
'
知道了
'
,
});
if
(
err
.
errCode
===
30002
){
}
},
complete
:
()
=>
{
uni
.
hideLoading
()
this
.
request
(
'
user-center/resetPwdBySmsCode
'
,{
"
mobile
"
:
this
.
formData
.
phone
,
"
code
"
:
this
.
formData
.
code
,
"
password
"
:
this
.
formData
.
pwd
},(
data
,
result
)
=>
{
console
.
log
(
result
);
uni
.
showToast
({
title
:
result
.
msg
,
icon
:
'
none
'
});
if
(
result
.
code
===
0
){
uni
.
navigateBack
()
}
})
}
...
...
uni_modules/uni-login-page/uniCloud/cloudfunctions/user-center/index.js
浏览文件 @
be8c2899
...
...
@@ -36,7 +36,7 @@ exports.main = async (event, context) => {
let
noCheckAction
=
[
'
register
'
,
'
checkToken
'
,
'
login
'
,
'
logout
'
,
'
sendSmsCode
'
,
'
createCaptcha
'
,
'
verifyCaptcha
'
,
'
refreshCaptcha
'
,
'
inviteLogin
'
,
'
login_by_weixin
'
,
'
login_by_univerify
'
,
'
login_by_apple
'
,
'
loginBySms
'
'
login_by_weixin
'
,
'
login_by_univerify
'
,
'
login_by_apple
'
,
'
loginBySms
'
,
'
resetPwdBySmsCode
'
]
let
payload
;
console
.
log
(
event
.
action
);
...
...
@@ -83,7 +83,7 @@ exports.main = async (event, context) => {
let
res
=
{}
switch
(
event
.
action
)
{
case
'
register
'
:
let
{
username
,
password
,
gender
,
nickname
,
password
}
=
params
let
{
username
,
password
,
gender
,
nickname
}
=
params
if
(
/^1
\d{10}
$/
.
test
(
username
)){
return
{
code
:
401
,
...
...
@@ -195,6 +195,27 @@ exports.main = async (event, context) => {
...
params
,
type
:
'
register
'
})
break
;
case
'
resetPwdBySmsCode
'
:
if
(
!
params
.
code
)
{
return
{
code
:
500
,
msg
:
'
请填写验证码
'
}
}
if
(
!
/^1
\d{10}
$/
.
test
(
params
.
mobile
))
{
return
{
code
:
500
,
msg
:
'
手机号码填写错误
'
}
}
let
loginBySmsRes
=
await
uniID
.
loginBySms
(
params
)
console
.
log
(
loginBySmsRes
);
if
(
loginBySmsRes
.
code
===
0
){
res
=
await
uniID
.
resetPwd
({
password
:
params
.
password
,
"
uid
"
:
loginBySmsRes
.
uid
})
}
else
{
return
loginBySmsRes
}
break
;
case
'
getInviteCode
'
:
res
=
await
uniID
.
getUserInfo
({
...
...
@@ -221,9 +242,6 @@ 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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录