Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello_uni-id-pages
提交
7ac62e65
H
hello_uni-id-pages
项目概览
DCloud
/
hello_uni-id-pages
通知
1065
Star
33
Fork
43
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
2
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello_uni-id-pages
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
7ac62e65
编写于
6月 23, 2022
作者:
雪洛
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: getAccountInfo
上级
363e64e4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
84 addition
and
2 deletion
+84
-2
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/config/permission.js
...es/uniCloud/cloudfunctions/uni-id-co/config/permission.js
+3
-0
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/index.obj.js
...i-id-pages/uniCloud/cloudfunctions/uni-id-co/index.obj.js
+12
-1
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/get-account-info.js
...oudfunctions/uni-id-co/module/account/get-account-info.js
+67
-0
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/index.js
...uniCloud/cloudfunctions/uni-id-co/module/account/index.js
+2
-1
未找到文件。
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/config/permission.js
浏览文件 @
7ac62e65
...
...
@@ -56,5 +56,8 @@ module.exports = {
},
setPushCid
:
{
auth
:
true
},
getAccountInfo
:
{
auth
:
true
}
}
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/index.obj.js
浏览文件 @
7ac62e65
...
...
@@ -41,7 +41,8 @@ const {
const
{
updatePwd
,
resetPwdBySms
,
closeAccount
closeAccount
,
getAccountInfo
}
=
require
(
'
./module/account/index
'
)
const
{
createCaptcha
,
...
...
@@ -136,6 +137,15 @@ module.exports = {
}
return
Object
.
assign
(
this
.
response
,
result
)
},
/**
* 注册管理员
* @tutorial https://dcloud.io
* @param {Object} params
* @param {String} params.username 用户名
* @param {String} params.password 密码
* @param {String} params.nickname 昵称
* @returns
*/
registerAdmin
,
addUser
,
authorizeAppLogin
,
...
...
@@ -160,6 +170,7 @@ module.exports = {
updatePwd
,
resetPwdBySms
,
closeAccount
,
getAccountInfo
,
createCaptcha
,
refreshCaptcha
,
sendSmsCode
,
...
...
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/get-account-info.js
0 → 100644
浏览文件 @
7ac62e65
const
{
userCollection
}
=
require
(
'
../../common/constants
'
)
const
{
ERROR
}
=
require
(
'
../../common/error
'
)
function
isUsernameSet
(
userRecord
)
{
return
!!
userRecord
.
username
}
function
isNicknameSet
(
userRecord
)
{
return
!!
userRecord
.
nickname
}
function
isPasswordSet
(
userRecord
)
{
return
!!
userRecord
.
password
}
function
isMobileBound
(
userRecord
)
{
return
!!
(
userRecord
.
mobile
&&
userRecord
.
mobile_confirmed
)
}
function
isEmailBound
(
userRecord
)
{
return
!!
(
userRecord
.
email
&&
userRecord
.
email_confirmed
)
}
function
isWeixinBound
(
userRecord
)
{
return
!!
(
userRecord
.
wx_unionid
||
Object
.
keys
(
userRecord
.
wx_openid
||
{}).
length
)
}
function
isQQBound
(
userRecord
)
{
return
!!
(
userRecord
.
qq_unionid
||
Object
.
keys
(
userRecord
.
qq_openid
||
{}).
length
)
}
function
isAlipayBound
(
userRecord
)
{
return
!!
userRecord
.
ali_openid
}
function
isAppleBound
(
userRecord
)
{
return
!!
userRecord
.
apple_openid
}
/**
* 获取账户账户简略信息
*/
module
.
exports
=
async
function
()
{
const
{
uid
}
=
this
.
authInfo
const
getUserRes
=
await
userCollection
.
doc
(
uid
).
get
()
const
userRecord
=
getUserRes
&&
getUserRes
.
data
&&
getUserRes
.
data
[
0
]
if
(
!
userRecord
)
{
throw
{
errCode
:
ERROR
.
ACCOUNT_NOT_EXISTS
}
}
return
{
isUsernameSet
:
isUsernameSet
(
userRecord
),
isNicknameSet
:
isNicknameSet
(
userRecord
),
isPasswordSet
:
isPasswordSet
(
userRecord
),
isMobileBound
:
isMobileBound
(
userRecord
),
isEmailBound
:
isEmailBound
(
userRecord
),
isWeixinBound
:
isWeixinBound
(
userRecord
),
isQQBound
:
isQQBound
(
userRecord
),
isAlipayBound
:
isAlipayBound
(
userRecord
),
isAppleBound
:
isAppleBound
(
userRecord
)
}
}
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/index.js
浏览文件 @
7ac62e65
module
.
exports
=
{
updatePwd
:
require
(
'
./update-pwd
'
),
resetPwdBySms
:
require
(
'
./reset-pwd-by-sms
'
),
closeAccount
:
require
(
'
./close-account
'
)
closeAccount
:
require
(
'
./close-account
'
),
getAccountInfo
:
require
(
'
./get-account-info
'
)
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录