修改用户的信息

1.视口

视口: /v/auth/editinfo.json

参数:username,phonenumber,email,password,desc,nickname,gender,province,city,year,birthday,idcardnum,address,telephone,country,relatedid,relatedid2,otherinfo,id,role

调用方式: public_json

  • 以上参数为信息结构图中用户可更改的部分,其中部分参数由api中的设置页面控制
  • 包含时修改指定id的信息,但会判断是否为admin,role同样会判断是否为admin
  • 2.api

    api名称:edituserinfo

    调用:auth.edituserinfo(req,res,param,id,role)

    参数:param,id,role

    id 修改指定用户的信息

    role 修改用户的角色

    param 为对象,包含以下部分

    {
    "username":"",
    "phonenumber":"",
    "email":"",
    "password":"",
    "desc":"",
    "nickname":"",
    "gender":"",
    "province":"",
    "city":"",
    "year":"",
    "birthday":"",
    "idcardnum":"",
    "address":"",
    "telephone":"",
    "country":"",
    "relatedid":"",
    "relatedid2":"",
    "otherinfo":"",
    "hasnext":"yes"//特殊参数
    }
      
  • hasnext为特殊参数,如果是通过验证后才能注册请添加该参数,不需验证时添加hasnext会报错
  • 返回值:

    {
    "success": true,
    "message": "资料更新成功",
    "updateinfo":{
    "_index": "setting.com",
    "_type": "user",
    "_id": "25449deaa4531d3fa4531d3fa4531d3f",
    "_version": 8,
    "_shards":{
    "total": 2,
    "successful": 1,
    "failed": 0
    }
    }
    }