用户管理

本节讲解用户管理相关API

查看用户列表

GET /api/portal/user?limit=10&p=1

返回样例

  1. {
  2. "dat": {
  3. "list": [
  4. {
  5. "id": 1,
  6. "username": "root",
  7. "dispname": "超管",
  8. "phone": "18888888888",
  9. "email": "",
  10. "im": "",
  11. "is_root": 1
  12. }
  13. ],
  14. "total": 1
  15. },
  16. "err": ""
  17. }

新增用户

POST /api/portal/user

请求样例

  1. {
  2. "username": "nightingale",
  3. "password": "nightingale",
  4. "dispname": "nightingale",
  5. "phone": "18888888888",
  6. "email": "nightingale@didiglobal.com",
  7. "im": "nightingale",
  8. }

查看用户组列表

GET /api/portal/team?limit=10&p=1

  • mgmt 管理种类 1为管理员管理制,0为成员管理制

返回样例

  1. {
  2. "dat": {
  3. "list": [
  4. {
  5. "id": 6,
  6. "ident": "nightingale",
  7. "name": "nightingale",
  8. "mgmt": 0,
  9. "admin_objs": null,
  10. "member_objs": [
  11. {
  12. "id": 11,
  13. "username": "nightingale",
  14. "dispname": "nightingale",
  15. "phone": "18888888888",
  16. "email": "nightingale@didiglobal.com",
  17. "im": "18888888888",
  18. "is_root": 0
  19. }
  20. ]
  21. }
  22. ],
  23. "total": 1
  24. },
  25. "err": ""
  26. }

创建用户组

POST /api/portal/team

请求样例

  1. {
  2. "ident": "nightingale",
  3. "name": "nightingale",
  4. "mgmt": 1,
  5. "members": [
  6. 11
  7. ],
  8. "admins": [
  9. 1
  10. ]
  11. }

修改用户组

PUT /api/portal/team

请求样例

  1. {
  2. "ident": "nightingale",
  3. "name": "nightingale",
  4. "mgmt": 0,
  5. "members": [
  6. 10
  7. ]
  8. }