uni-id-users.schema.json 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. {
  2. "bsonType": "object",
  3. "permission":{
  4. "update":"doc.uid==auth.uid"
  5. },
  6. "required": [],
  7. "properties": {
  8. "_id": {
  9. "description": "存储文档 ID(用户 ID),系统自动生成"
  10. },
  11. "username": {
  12. "bsonType": "string",
  13. "title": "用户名",
  14. "description": "用户名,不允许重复",
  15. "trim": "both"
  16. },
  17. "password": {
  18. "bsonType": "password",
  19. "title": "密码",
  20. "description": "密码,加密存储",
  21. "trim": "both"
  22. },
  23. "password_secret_version": {
  24. "bsonType": "int",
  25. "title": "passwordSecret",
  26. "description": "密码使用的passwordSecret版本",
  27. "permission":{
  28. "write":false
  29. }
  30. },
  31. "nickname": {
  32. "bsonType": "string",
  33. "title": "昵称",
  34. "description": "用户昵称",
  35. "trim": "both"
  36. },
  37. "gender": {
  38. "bsonType": "int",
  39. "title": "性别",
  40. "description": "用户性别:0 未知 1 男性 2 女性",
  41. "defaultValue": 0,
  42. "enum": [{
  43. "text": "未知",
  44. "value": 0
  45. },
  46. {
  47. "text": "男",
  48. "value": 1
  49. },
  50. {
  51. "text": "女",
  52. "value": 2
  53. }
  54. ]
  55. },
  56. "status": {
  57. "bsonType": "int",
  58. "description": "用户状态:0 正常 1 禁用 2 审核中 3 审核拒绝",
  59. "title": "用户状态",
  60. "defaultValue": 0,
  61. "permission":{
  62. "write":false
  63. },
  64. "enum": [{
  65. "text": "正常",
  66. "value": 0
  67. },
  68. {
  69. "text": "禁用",
  70. "value": 1
  71. },
  72. {
  73. "text": "审核中",
  74. "value": 2
  75. },
  76. {
  77. "text": "审核拒绝",
  78. "value": 3
  79. }
  80. ]
  81. },
  82. "mobile": {
  83. "bsonType": "string",
  84. "title": "手机号码",
  85. "description": "手机号码",
  86. "pattern": "^\\+?[0-9-]{3,20}$",
  87. "trim": "both",
  88. "permission":{
  89. "write":false
  90. }
  91. },
  92. "mobile_confirmed": {
  93. "bsonType": "int",
  94. "description": "手机号验证状态:0 未验证 1 已验证",
  95. "title": "手机号验证状态",
  96. "defaultValue": 0,
  97. "enum": [{
  98. "text": "未验证",
  99. "value": 0
  100. },
  101. {
  102. "text": "已验证",
  103. "value": 1
  104. }
  105. ],
  106. "permission":{
  107. "write":false
  108. }
  109. },
  110. "email": {
  111. "bsonType": "string",
  112. "format": "email",
  113. "title": "邮箱",
  114. "description": "邮箱地址",
  115. "trim": "both",
  116. "permission":{
  117. "write":false
  118. }
  119. },
  120. "email_confirmed": {
  121. "bsonType": "int",
  122. "description": "邮箱验证状态:0 未验证 1 已验证",
  123. "title": "邮箱验证状态",
  124. "defaultValue": 0,
  125. "enum": [{
  126. "text": "未验证",
  127. "value": 0
  128. },
  129. {
  130. "text": "已验证",
  131. "value": 1
  132. }
  133. ],
  134. "permission":{
  135. "write":false
  136. }
  137. },
  138. "avatar": {
  139. "bsonType": "string",
  140. "title": "头像地址",
  141. "description": "头像地址",
  142. "trim": "both"
  143. },
  144. "avatar_file": {
  145. "bsonType": "file",
  146. "title": "头像文件",
  147. "description": "用file类型方便使用uni-file-picker组件"
  148. },
  149. "department_id": {
  150. "bsonType": "array",
  151. "description": "部门ID",
  152. "permission":{
  153. "write":false
  154. },
  155. "title": "部门",
  156. "enumType": "tree",
  157. "enum": {
  158. "collection": "opendb-department",
  159. "orderby": "name asc",
  160. "field": "_id as value, name as text"
  161. }
  162. },
  163. "role": {
  164. "bsonType": "array",
  165. "title": "角色",
  166. "description": "用户角色",
  167. "enum": {
  168. "collection": "uni-id-roles",
  169. "field": "role_id as value, role_name as text"
  170. },
  171. "foreignKey": "uni-id-roles.role_id",
  172. "permission": {
  173. "write": false
  174. }
  175. },
  176. "wx_unionid": {
  177. "bsonType": "string",
  178. "description": "微信unionid",
  179. "permission":{
  180. "write":false
  181. }
  182. },
  183. "wx_openid": {
  184. "bsonType": "object",
  185. "description": "微信各个平台openid",
  186. "properties": {
  187. "app-plus": {
  188. "bsonType": "string",
  189. "description": "app平台微信openid"
  190. },
  191. "mp-weixin": {
  192. "bsonType": "string",
  193. "description": "微信小程序平台openid"
  194. }
  195. },
  196. "permission":{
  197. "write":false
  198. }
  199. },
  200. "ali_openid": {
  201. "bsonType": "string",
  202. "description": "支付宝平台openid",
  203. "permission":{
  204. "write":false
  205. }
  206. },
  207. "apple_openid": {
  208. "bsonType": "string",
  209. "description": "苹果登录openid",
  210. "permission":{
  211. "write":false
  212. }
  213. },
  214. "comment": {
  215. "bsonType": "string",
  216. "title": "备注",
  217. "description": "备注",
  218. "trim": "both",
  219. "permission":{
  220. "write":false
  221. }
  222. },
  223. "realname_auth": {
  224. "bsonType": "object",
  225. "description": "实名认证信息",
  226. "required": [
  227. "type",
  228. "auth_status"
  229. ],
  230. "permission":{
  231. "write":false
  232. },
  233. "properties": {
  234. "type": {
  235. "bsonType": "int",
  236. "minimum": 0,
  237. "maximum": 1,
  238. "description": "用户类型:0 个人用户 1 企业用户"
  239. },
  240. "auth_status": {
  241. "bsonType": "int",
  242. "minimum": 0,
  243. "maximum": 3,
  244. "description": "认证状态:0 未认证 1 等待认证 2 认证通过 3 认证失败"
  245. },
  246. "auth_date": {
  247. "bsonType": "timestamp",
  248. "description": "认证通过时间"
  249. },
  250. "real_name": {
  251. "bsonType": "string",
  252. "description": "真实姓名/企业名称"
  253. },
  254. "identity": {
  255. "bsonType": "string",
  256. "description": "身份证号码/营业执照号码"
  257. },
  258. "id_card_front": {
  259. "bsonType": "string",
  260. "description": "身份证正面照 URL"
  261. },
  262. "id_card_back": {
  263. "bsonType": "string",
  264. "description": "身份证反面照 URL"
  265. },
  266. "in_hand": {
  267. "bsonType": "string",
  268. "description": "手持身份证照片 URL"
  269. },
  270. "license": {
  271. "bsonType": "string",
  272. "description": "营业执照 URL"
  273. },
  274. "contact_person": {
  275. "bsonType": "string",
  276. "description": "联系人姓名"
  277. },
  278. "contact_mobile": {
  279. "bsonType": "string",
  280. "description": "联系人手机号码"
  281. },
  282. "contact_email": {
  283. "bsonType": "string",
  284. "description": "联系人邮箱"
  285. }
  286. }
  287. },
  288. "score": {
  289. "bsonType": "int",
  290. "description": "用户积分,积分变更记录可参考:uni-id-scores表定义",
  291. "permission":{
  292. "write":false
  293. }
  294. },
  295. "register_date": {
  296. "bsonType": "timestamp",
  297. "description": "注册时间",
  298. "forceDefaultValue": {
  299. "$env": "now"
  300. },
  301. "permission":{
  302. "write":false
  303. }
  304. },
  305. "register_ip": {
  306. "bsonType": "string",
  307. "description": "注册时 IP 地址",
  308. "forceDefaultValue": {
  309. "$env": "clientIP"
  310. },
  311. "permission":{
  312. "write":false
  313. }
  314. },
  315. "last_login_date": {
  316. "bsonType": "timestamp",
  317. "description": "最后登录时间",
  318. "permission":{
  319. "write":false
  320. }
  321. },
  322. "last_login_ip": {
  323. "bsonType": "string",
  324. "description": "最后登录时 IP 地址",
  325. "permission":{
  326. "write":false
  327. }
  328. },
  329. "token": {
  330. "bsonType": "array",
  331. "description": "用户token",
  332. "permission":{
  333. "write":false
  334. }
  335. },
  336. "inviter_uid": {
  337. "bsonType": "array",
  338. "description": "用户全部上级邀请者",
  339. "trim": "both",
  340. "permission":{
  341. "write":false
  342. }
  343. },
  344. "invite_time": {
  345. "bsonType": "timestamp",
  346. "description": "受邀时间",
  347. "permission":{
  348. "write":false
  349. }
  350. },
  351. "my_invite_code": {
  352. "bsonType": "string",
  353. "description": "用户自身邀请码",
  354. "permission":{
  355. "write":false
  356. }
  357. }
  358. }
  359. }