Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello-uniCloud
提交
d8a6385f
H
hello-uniCloud
项目概览
DCloud
/
hello-uniCloud
通知
294
Star
3
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello-uniCloud
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
d8a6385f
编写于
10月 23, 2023
作者:
DCloud_JSON
提交者:
Anne_LXM
10月 24, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
comment表改为opendb-notice-comment
上级
b4273151
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
491 addition
and
55 deletion
+491
-55
manifest.json
manifest.json
+2
-33
pages/clientDB/demo/demo.vue
pages/clientDB/demo/demo.vue
+19
-16
uniCloud-aliyun/cloudfunctions/uni-clientDB-actions/up_comment.js
...-aliyun/cloudfunctions/uni-clientDB-actions/up_comment.js
+1
-1
uniCloud-aliyun/database/db_init.json
uniCloud-aliyun/database/db_init.json
+5
-1
uniCloud-aliyun/database/opendb-notice-comment.schema.json
uniCloud-aliyun/database/opendb-notice-comment.schema.json
+8
-4
uni_modules/uni-id-pages/uniCloud/database/uni-id-users.schema.json
...s/uni-id-pages/uniCloud/database/uni-id-users.schema.json
+456
-0
未找到文件。
manifest.json
浏览文件 @
d8a6385f
{
"name"
:
"hello uniCloud"
,
"appid"
:
""
,
"appid"
:
"
__UNI__8113B5C
"
,
"description"
:
"为开发者提供的基于 serverless 模式和 js 编程的云开发平台。示例代码"
,
"versionName"
:
"1.0.2"
,
"versionCode"
:
102
,
...
...
@@ -51,38 +51,7 @@
"payment"
:
{},
"oauth"
:
{}
},
"icons"
:
{
"android"
:
{
"hdpi"
:
"unpackage/res/icons/72x72.png"
,
"xhdpi"
:
"unpackage/res/icons/96x96.png"
,
"xxhdpi"
:
"unpackage/res/icons/144x144.png"
,
"xxxhdpi"
:
"unpackage/res/icons/192x192.png"
},
"ios"
:
{
"appstore"
:
"unpackage/res/icons/1024x1024.png"
,
"ipad"
:
{
"app"
:
"unpackage/res/icons/76x76.png"
,
"app@2x"
:
"unpackage/res/icons/152x152.png"
,
"notification"
:
"unpackage/res/icons/20x20.png"
,
"notification@2x"
:
"unpackage/res/icons/40x40.png"
,
"proapp@2x"
:
"unpackage/res/icons/167x167.png"
,
"settings"
:
"unpackage/res/icons/29x29.png"
,
"settings@2x"
:
"unpackage/res/icons/58x58.png"
,
"spotlight"
:
"unpackage/res/icons/40x40.png"
,
"spotlight@2x"
:
"unpackage/res/icons/80x80.png"
},
"iphone"
:
{
"app@2x"
:
"unpackage/res/icons/120x120.png"
,
"app@3x"
:
"unpackage/res/icons/180x180.png"
,
"notification@2x"
:
"unpackage/res/icons/40x40.png"
,
"notification@3x"
:
"unpackage/res/icons/60x60.png"
,
"settings@2x"
:
"unpackage/res/icons/58x58.png"
,
"settings@3x"
:
"unpackage/res/icons/87x87.png"
,
"spotlight@2x"
:
"unpackage/res/icons/80x80.png"
,
"spotlight@3x"
:
"unpackage/res/icons/120x120.png"
}
}
}
"icons"
:
{}
}
},
"quickapp"
:
{},
...
...
pages/clientDB/demo/demo.vue
浏览文件 @
d8a6385f
...
...
@@ -10,20 +10,20 @@
</view>
<text
@
click=
"options.selfId?$refs.dialog.open():tipLogin()"
class=
"comment-btn"
>
写留言
</text>
</view>
<unicloud-db
ref=
"udb"
v-slot:default=
"
{data, loading, error, options}" :options="options" page-data="replace"
collection="
comment,uni-id-users" field="uid{user
name,_id},text,_id,state" :where="options.where">
<unicloud-db
v-if=
"noticeData._id"
ref=
"udb"
v-slot:default=
"
{data, loading, error, options}" :options="options" page-data="replace"
collection="
opendb-notice-comment,uni-id-users" field="user_id{nick
name,_id},text,_id,state" :where="options.where">
<scroll-view
:show-scrollbar=
"true"
scroll-y
v-if=
"data.length"
class=
"comment-list"
>
<view
class=
"comment-item"
v-for=
"(item,index) in data"
:key=
"item._id"
>
<image
class=
"userImg"
:src=
"'../../../static/userImg/'+item.u
id[0].user
name+'.png'"
mode=
""
></image>
<image
class=
"userImg"
:src=
"'../../../static/userImg/'+item.u
ser_id[0].nick
name+'.png'"
mode=
""
></image>
<view
class=
"content"
>
<view
style=
"flex-direction: column;"
>
<text
style=
"color: #666;font-size: 14px;font-weight:700;"
>
{{
item
.
u
id
[
0
].
user
name
}}
</text>
<text
style=
"color: #666;font-size: 14px;font-weight:700;"
>
{{
item
.
u
ser_id
[
0
].
nick
name
}}
</text>
<text
style=
"color: #888;font-size: 14px;"
>
{{
item
.
text
}}
</text>
</view>
<view
style=
"flex-direction: row;"
>
<switch
v-if=
"options.role.index>1"
class=
"switch"
:checked=
"item.state==1"
@
change=
"updateState($event,item._id)"
/>
<template
v-if=
"options.selfId == item.uid[0]._id || options.role.index>1"
>
<template
v-if=
"options.selfId == item.u
ser_
id[0]._id || options.role.index>1"
>
<text
class=
"in-review"
v-if=
"options.role.index===1&&item.state==0"
>
审核中
</text>
<uni-icons
v-else
color=
"#cdcfd4"
class=
"ico"
size=
"16"
type=
"compose"
@
click=
"clickIcon(0,item)"
></uni-icons>
...
...
@@ -50,7 +50,7 @@
<uni-list-item
title=
"敏感词过滤"
note=
"发表留言内容含test会被拦截请求"
/>
<uni-list-item
title=
"编辑/删除留言"
note=
"限用户编辑或删除自己发表的留言.管理员可以删除/编辑任何人的留言"
/>
<uni-list-item
title=
"公告的阅读量"
note=
"1.读取,限登陆用户查看文章阅读量; \n 2.自增,阅读量自动增加由特殊的云函数add_view_count完成"
/>
<uni-list-item
title=
"数据查询"
note=
"完整留言数据,由comment,uni-id-users连张表,通过foreignKey联查获取"
/>
<uni-list-item
title=
"数据查询"
note=
"完整留言数据,由
opendb-notice-
comment,uni-id-users连张表,通过foreignKey联查获取"
/>
</uni-popup>
<set-permission
@
change=
"changePermission"
></set-permission>
</view>
...
...
@@ -64,17 +64,17 @@
},
data
()
{
return
{
noticeData
:
{
"
_id
"
:
null
},
currentRole
:
0
,
options
:
{
"
selfId
"
:
""
,
"
where
"
:
"
state==1
"
,
"
where
"
:
"
"
,
// 默认为空,在查到公告内容后设置
role
:
{
index
:
0
},
},
noticeData
:
{
"
_id
"
:
null
},
activeNoticeId
:
false
,
defaultText
:
""
,
fields
:
"
data
"
,
...
...
@@ -110,16 +110,16 @@
this
.
options
.
selfId
=
role
.
uid
switch
(
role
.
index
)
{
case
0
:
this
.
options
.
where
=
"
state==1
"
this
.
options
.
where
=
`state == 1 && notice_id == "
${
this
.
noticeData
.
_id
}
"`
break
;
case
1
:
this
.
options
.
where
=
"
state==1 || uid._id==$env.uid
"
this
.
options
.
where
=
`state == 1 && notice_id == "
${
this
.
noticeData
.
_id
}
" || user_id._id==$env.uid`
break
;
case
2
:
this
.
options
.
where
=
{}
this
.
options
.
where
=
{
"
notice_id
"
:
this
.
noticeData
.
_id
}
break
;
case
3
:
this
.
options
.
where
=
{}
this
.
options
.
where
=
{
"
notice_id
"
:
this
.
noticeData
.
_id
}
break
;
default
:
break
;
...
...
@@ -131,10 +131,12 @@
async
getNoticeData
()
{
let
res
=
await
db
.
action
(
'
add_view_count
'
)
.
collection
(
'
opendb-notice
'
)
.
doc
(
"
65365ac355b3379a66170144
"
)
.
field
(
'
data,_id,update_time,view_count
'
)
.
get
();
console
.
log
(
"
res:
"
,
res
);
this
.
noticeData
=
res
.
result
.
data
[
0
]
this
.
options
.
where
=
`state == 1 && notice_id == "
${
this
.
noticeData
.
_id
}
"`
},
async
clickIcon
(
e
,
item
)
{
if
(
e
)
{
...
...
@@ -150,7 +152,7 @@
uni
.
showLoading
({
mask
:
true
});
return
await
db
.
collection
(
'
comment
'
)
return
await
db
.
collection
(
'
opendb-notice-
comment
'
)
.
doc
(
_id
)
.
update
({
"
state
"
:
e
.
detail
.
value
/
1
...
...
@@ -228,7 +230,8 @@
return
false
}
this
.
$refs
.
dialog
.
close
()
return
await
db
.
collection
(
'
comment
'
).
add
({
return
await
db
.
collection
(
'
opendb-notice-comment
'
).
add
({
notice_id
:
this
.
noticeData
.
_id
,
text
}).
then
(
res
=>
{
console
.
log
(
res
);
...
...
uniCloud-aliyun/cloudfunctions/uni-clientDB-actions/up_comment.js
浏览文件 @
d8a6385f
// 开发文档:https://uniapp.dcloud.io/uniCloud/clientdb?id=action
const
db
=
uniCloud
.
database
()
const
commentDb
=
db
.
collection
(
'
comment
'
)
const
commentDb
=
db
.
collection
(
'
opendb-notice-
comment
'
)
module
.
exports
=
{
before
:
async
(
state
,
event
)
=>
{
if
(
state
.
auth
.
role
.
includes
(
'
USER
'
)){
...
...
uniCloud-aliyun/database/db_init.json
浏览文件 @
d8a6385f
...
...
@@ -143,10 +143,11 @@
"permission-test-7"
:
{
"data"
:
[{
"state"
:
0
,
"text"
:
"该用户比较懒啥也没写!"
}]
},
"comment"
:
{},
"
opendb-notice-
comment"
:
{},
"opendb-notice"
:
{
"data"
:
[{
"view_count"
:
0
,
"_id"
:
"65365ac355b3379a66170144"
,
"data"
:
"这是一个由clientDB实现的留言板示例;权限部分由DBschema和action云函数控制。
\n
规则如下:
\n
1.未登陆的游客,只能看到审核通过的留言。
\n
2.登陆的用户还可以:发表留言,会进入审核状态,期间支持查看和删除。审核通过后可以重新编辑留言。但在重新编辑后会自动再次进入审核状态。
\n
3.审核员和管理员可以:查看所有状态的留言,操作:审核、编辑、删除。"
}]
},
...
...
@@ -154,16 +155,19 @@
"uni-id-users"
:
{
"data"
:
[{
"username"
:
"admin"
,
"nickname"
:
"admin"
,
"password"
:
"03caebb36670995fc261a275d212cad65e4bbebd"
,
"role"
:
[
"admin"
]
},
{
"username"
:
"user"
,
"nickname"
:
"user"
,
"password"
:
"03caebb36670995fc261a275d212cad65e4bbebd"
,
"role"
:
[
"USER"
]
},
{
"username"
:
"auditor"
,
"nickname"
:
"auditor"
,
"password"
:
"03caebb36670995fc261a275d212cad65e4bbebd"
,
"role"
:
[
"AUDITOR"
]
}
...
...
uniCloud-aliyun/database/comment.schema.json
→
uniCloud-aliyun/database/
opendb-notice-
comment.schema.json
浏览文件 @
d8a6385f
...
...
@@ -3,20 +3,24 @@
"bsonType"
:
"object"
,
"required"
:
[],
"permission"
:
{
"read"
:
"doc.state == 1 || auth.uid == doc.uid || 'AUDITOR' in auth.role"
,
"read"
:
"doc.state == 1 || auth.uid == doc.u
ser_
id || 'AUDITOR' in auth.role"
,
"create"
:
"auth.uid != null"
,
"update"
:
"(auth.uid == doc.uid && 'up_comment' in action) || 'AUDITOR' in auth.role"
,
"delete"
:
"auth.uid == doc.uid"
"update"
:
"(auth.uid == doc.u
ser_
id && 'up_comment' in action) || 'AUDITOR' in auth.role"
,
"delete"
:
"auth.uid == doc.u
ser_
id"
},
"properties"
:
{
"_id"
:
{
"description"
:
"ID,系统自动生成"
},
"notice_id"
:
{
"description"
:
"通知的id"
,
"foreignKey"
:
"opendb-notice._id"
},
"text"
:
{
"bsonType"
:
"string"
,
"validateFunction"
:
"word_filter"
},
"uid"
:
{
"u
ser_
id"
:
{
"forceDefaultValue"
:
{
"$env"
:
"uid"
},
...
...
uni_modules/uni-id-pages/uniCloud/database/uni-id-users.schema.json
0 → 100644
浏览文件 @
d8a6385f
{
"bsonType"
:
"object"
,
"permission"
:
{
"read"
:
true
,
"create"
:
"'CREATE_UNI_ID_USERS' in auth.permission"
,
"update"
:
"doc._id == auth.uid || 'UPDATE_UNI_ID_USERS' in auth.permission"
,
"delete"
:
"'DELETE_UNI_ID_USERS' in auth.permission"
},
"properties"
:
{
"_id"
:
{
"description"
:
"存储文档 ID(用户 ID),系统自动生成"
},
"ali_openid"
:
{
"bsonType"
:
"string"
,
"description"
:
"支付宝平台openid"
,
"permission"
:
{
"read"
:
"'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"apple_openid"
:
{
"bsonType"
:
"string"
,
"description"
:
"苹果登录openid"
,
"permission"
:
{
"read"
:
"'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"avatar"
:
{
"bsonType"
:
"string"
,
"description"
:
"头像地址"
,
"title"
:
"头像地址"
,
"trim"
:
"both"
,
"permission"
:
{
"read"
:
"doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"doc._id == auth.uid || 'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"avatar_file"
:
{
"bsonType"
:
"file"
,
"description"
:
"用file类型方便使用uni-file-picker组件"
,
"title"
:
"头像文件"
,
"permission"
:
{
"read"
:
"doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"doc._id == auth.uid || 'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"comment"
:
{
"bsonType"
:
"string"
,
"description"
:
"备注"
,
"title"
:
"备注"
,
"trim"
:
"both"
,
"permission"
:
{
"read"
:
"'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"dcloud_appid"
:
{
"bsonType"
:
"array"
,
"description"
:
"允许登录的客户端的appid列表"
,
"foreignKey"
:
"opendb-app-list.appid"
,
"permission"
:
{
"read"
:
"'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"department_id"
:
{
"bsonType"
:
"array"
,
"description"
:
"部门ID"
,
"enum"
:
{
"collection"
:
"opendb-department"
,
"field"
:
"_id as value, name as text"
,
"orderby"
:
"name asc"
},
"enumType"
:
"tree"
,
"title"
:
"部门"
,
"permission"
:
{
"read"
:
"doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"email"
:
{
"bsonType"
:
"string"
,
"description"
:
"邮箱地址"
,
"format"
:
"email"
,
"title"
:
"邮箱"
,
"trim"
:
"both"
,
"permission"
:
{
"read"
:
"doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"email_confirmed"
:
{
"bsonType"
:
"int"
,
"defaultValue"
:
0
,
"description"
:
"邮箱验证状态:0 未验证 1 已验证"
,
"enum"
:
[{
"text"
:
"未验证"
,
"value"
:
0
},
{
"text"
:
"已验证"
,
"value"
:
1
}
],
"title"
:
"邮箱验证状态"
,
"permission"
:
{
"read"
:
"doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"gender"
:
{
"bsonType"
:
"int"
,
"defaultValue"
:
0
,
"description"
:
"用户性别:0 未知 1 男性 2 女性"
,
"enum"
:
[{
"text"
:
"未知"
,
"value"
:
0
},
{
"text"
:
"男"
,
"value"
:
1
},
{
"text"
:
"女"
,
"value"
:
2
}
],
"title"
:
"性别"
,
"permission"
:
{
"read"
:
"doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"invite_time"
:
{
"bsonType"
:
"timestamp"
,
"description"
:
"受邀时间"
,
"permission"
:
{
"read"
:
"doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"inviter_uid"
:
{
"bsonType"
:
"array"
,
"description"
:
"用户全部上级邀请者"
,
"trim"
:
"both"
,
"permission"
:
{
"read"
:
"doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"last_login_date"
:
{
"bsonType"
:
"timestamp"
,
"description"
:
"最后登录时间"
,
"permission"
:
{
"read"
:
"doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"last_login_ip"
:
{
"bsonType"
:
"string"
,
"description"
:
"最后登录时 IP 地址"
,
"permission"
:
{
"read"
:
"doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"mobile"
:
{
"bsonType"
:
"string"
,
"description"
:
"手机号码"
,
"pattern"
:
"^
\\
+?[0-9-]{3,20}$"
,
"title"
:
"手机号码"
,
"trim"
:
"both"
,
"permission"
:
{
"read"
:
"doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"mobile_confirmed"
:
{
"bsonType"
:
"int"
,
"defaultValue"
:
0
,
"description"
:
"手机号验证状态:0 未验证 1 已验证"
,
"enum"
:
[{
"text"
:
"未验证"
,
"value"
:
0
},
{
"text"
:
"已验证"
,
"value"
:
1
}
],
"title"
:
"手机号验证状态"
,
"permission"
:
{
"read"
:
"doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"my_invite_code"
:
{
"bsonType"
:
"string"
,
"description"
:
"用户自身邀请码"
,
"permission"
:
{
"read"
:
"doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"nickname"
:
{
"bsonType"
:
"string"
,
"description"
:
"用户昵称"
,
"title"
:
"昵称"
,
"trim"
:
"both"
,
"permission"
:
{
"read"
:
true
,
"write"
:
"doc._id == auth.uid || 'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"password"
:
{
"bsonType"
:
"password"
,
"description"
:
"密码,加密存储"
,
"title"
:
"密码"
,
"trim"
:
"both"
},
"password_secret_version"
:
{
"bsonType"
:
"int"
,
"description"
:
"密码使用的passwordSecret版本"
,
"title"
:
"passwordSecret"
,
"permission"
:
{
"read"
:
false
,
"write"
:
false
}
},
"realname_auth"
:
{
"bsonType"
:
"object"
,
"description"
:
"实名认证信息"
,
"permission"
:
{
"read"
:
"doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
},
"properties"
:
{
"auth_date"
:
{
"bsonType"
:
"timestamp"
,
"description"
:
"认证通过时间"
},
"auth_status"
:
{
"bsonType"
:
"int"
,
"description"
:
"认证状态:0 未认证 1 等待认证 2 认证通过 3 认证失败"
,
"maximum"
:
3
,
"minimum"
:
0
},
"contact_email"
:
{
"bsonType"
:
"string"
,
"description"
:
"联系人邮箱"
},
"contact_mobile"
:
{
"bsonType"
:
"string"
,
"description"
:
"联系人手机号码"
},
"contact_person"
:
{
"bsonType"
:
"string"
,
"description"
:
"联系人姓名"
},
"id_card_back"
:
{
"bsonType"
:
"string"
,
"description"
:
"身份证反面照 URL"
},
"id_card_front"
:
{
"bsonType"
:
"string"
,
"description"
:
"身份证正面照 URL"
},
"identity"
:
{
"bsonType"
:
"string"
,
"description"
:
"身份证号码/营业执照号码"
},
"in_hand"
:
{
"bsonType"
:
"string"
,
"description"
:
"手持身份证照片 URL"
},
"license"
:
{
"bsonType"
:
"string"
,
"description"
:
"营业执照 URL"
},
"real_name"
:
{
"bsonType"
:
"string"
,
"description"
:
"真实姓名/企业名称"
},
"type"
:
{
"bsonType"
:
"int"
,
"description"
:
"用户类型:0 个人用户 1 企业用户"
,
"maximum"
:
1
,
"minimum"
:
0
}
},
"required"
:
[
"type"
,
"auth_status"
]
},
"register_date"
:
{
"bsonType"
:
"timestamp"
,
"description"
:
"注册时间"
,
"forceDefaultValue"
:
{
"$env"
:
"now"
},
"permission"
:
{
"read"
:
"doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"register_ip"
:
{
"bsonType"
:
"string"
,
"description"
:
"注册时 IP 地址"
,
"forceDefaultValue"
:
{
"$env"
:
"clientIP"
},
"permission"
:
{
"read"
:
"doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"role"
:
{
"bsonType"
:
"array"
,
"description"
:
"用户角色"
,
"enum"
:
{
"collection"
:
"uni-id-roles"
,
"field"
:
"role_id as value, role_name as text"
},
"foreignKey"
:
"uni-id-roles.role_id"
,
"permission"
:
{
"read"
:
"doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
},
"title"
:
"角色"
},
"score"
:
{
"bsonType"
:
"int"
,
"description"
:
"用户积分,积分变更记录可参考:uni-id-scores表定义"
,
"permission"
:
{
"read"
:
"doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"status"
:
{
"bsonType"
:
"int"
,
"defaultValue"
:
0
,
"description"
:
"用户状态:0 正常 1 禁用 2 审核中 3 审核拒绝"
,
"permission"
:
{
"read"
:
"doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
},
"enum"
:
[{
"text"
:
"正常"
,
"value"
:
0
},
{
"text"
:
"禁用"
,
"value"
:
1
},
{
"text"
:
"审核中"
,
"value"
:
2
},
{
"text"
:
"审核拒绝"
,
"value"
:
3
}
],
"title"
:
"用户状态"
},
"token"
:
{
"bsonType"
:
"array"
,
"description"
:
"用户token"
,
"permission"
:
{
"read"
:
"'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"username"
:
{
"bsonType"
:
"string"
,
"description"
:
"用户名,不允许重复"
,
"title"
:
"用户名"
,
"trim"
:
"both"
,
"permission"
:
{
"read"
:
"doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"wx_openid"
:
{
"bsonType"
:
"object"
,
"description"
:
"微信各个平台openid"
,
"properties"
:
{
"app"
:
{
"bsonType"
:
"string"
,
"description"
:
"app平台微信openid"
},
"mp"
:
{
"bsonType"
:
"string"
,
"description"
:
"微信小程序平台openid"
},
"h5"
:
{
"bsonType"
:
"string"
,
"description"
:
"微信公众号登录openid"
},
"web"
:
{
"bsonType"
:
"string"
,
"description"
:
"PC页面扫码登录openid"
}
},
"permission"
:
{
"read"
:
"'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"wx_unionid"
:
{
"bsonType"
:
"string"
,
"description"
:
"微信unionid"
,
"permission"
:
{
"read"
:
"'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"qq_openid"
:
{
"bsonType"
:
"object"
,
"description"
:
"QQ各个平台openid"
,
"properties"
:
{
"app"
:
{
"bsonType"
:
"string"
,
"description"
:
"app平台QQ openid"
},
"mp"
:
{
"bsonType"
:
"string"
,
"description"
:
"QQ小程序平台openid"
}
},
"permission"
:
{
"read"
:
"'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"qq_unionid"
:
{
"bsonType"
:
"string"
,
"description"
:
"QQ unionid"
,
"permission"
:
{
"read"
:
"'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
},
"third_party"
:
{
"bsonType"
:
"object"
,
"description"
:
"三方平台凭证"
,
"permission"
:
{
"read"
:
false
,
"write"
:
false
}
}
},
"required"
:
[]
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录