Skip to content

用户系统

1. 通用接口

1.1 获取上传参数

  • 接口地址
POST /v1/common/file/getUploadParams
  • 说明

此接口用在上传头像,先请求此接口获取上传参数,然后请求:file/localUpload 接口上传文件。

  • 请求参数
名称类型是否必需示例描述
modulestringY"avatar"auth,lock_fingerprint,lock_identity_card,lock_keyboard_pwd,lock,lock_key,avatar
accountstringY/N"手机号码或邮箱"module=auth 时必填:手机号码或邮箱
userIdintY/N123module=avatar 时必填:用户ID
lockIdintY/N500module=lock 时必填:锁ID
fingerprintIdintY/N100module=lock_fingerprint 时必填:指纹ID
identityCardIdintY/N200module=lock_identity_card 时必填:IC卡ID
keyboardPwdIdintY/N300module=lock_keyboard_pwd 时必填:密码ID
keyIdintY/N400module=lock_key 时必填:钥匙ID
versionstringY/N"v0.0.1"module=app 时必填
platformstringY/N"ios"module=app 时必填:"ios"/"android"
filenamestringY"abc.jpg"文件名
sizeintY1024文件字节数
  • 返回结果
名称类型描述
uploadUrlstring上传地址
fileUrlstring文件地址(执行上传后可用)
formDataObject需要传递到上传地址的表单数据
fileFieldstring文件在表单中的key

1.2 验证码接口

  • 接口地址
POST /v1/common/sendValidationCode
  • 说明

登录后可使用 sendValidationCodeAuth 接口,免图片滑动验证,只需要 channelcodeType 两个参数即可。

  • 请求参数
名称类型是否必需示例描述
countryCodestringN"+86"手机号前缀
accountstringY"13410577084"手机号
channelstringY"1"1 短信,2 邮箱
codeTypestringY"3"1注册,2找回密码,3绑定手机号,4解绑手机(换绑),5删除账号,6 绑定邮箱,7解绑邮箱(换绑),8删除锁,9更改密码(无需旧密码)10删除商户 11邀请的申请用户
  • 返回结果
名称类型描述
resstringsuccess

2. 登录注册

2.1 密码登录

  • 接口地址
POST /v1/user/pwdLogin
  • 请求参数
名称类型是否必需示例描述
platIdintY1平台 1web 2app 3小程序 4pc
usernamestringY"13411111111"登录账号(手机号)
passwordstringY"12345678"账号密码
deviceInfoobjectN{}设备信息,详细如下
deviceInfo.deviceNostringN"uk06lSoK28oNmYC2"设备信息.设备唯一编号
deviceInfo.deviceNamestringN"XHJ-DM01"设备名称
deviceInfo.deviceBrandstringN"iPhone"设备品牌
deviceInfo.deviceModelstringN"23127PN0CC"设备型号
  • 返回结果
json
{
    "errorCode": 0,
    "description": "success",
    "errorMsg": "success",
    "data": {
        "token": "15|92J3hghHl9hxbsV2HfjF4LWxdXLgowzHkZjFDO4t55daac82"
    }
}
  • 异常结果

新设备不允许用密码登录,强制跳转验证码登录

json
{
    "errorCode": 441,
    "errorMsg": "您正在一台新设备登录互联,为了您的账号安全,请进行安全验证",
    "description": "",
    "data": {}
}

2.2 验证码登录

  • 接口地址
POST /v1/user/codeLogin
  • 请求参数
名称类型是否必需示例描述
platIdintY1平台 1web 2app 3小程序 4pc
phonestringY"13411111111"登录账号(手机号)
verificationCodestringY"123456"验证码
deviceInfoobjectN{}设备信息,详细如下
deviceInfo.deviceNostringN"uk06lSoK28oNmYC2"设备信息.设备唯一编号
deviceInfo.deviceNamestringN"XHJ-DM01"设备名称
deviceInfo.deviceBrandstringN"iPhone"设备品牌
deviceInfo.deviceModelstringN"23127PN0CC"设备型号
deviceInfo....stringN"1.2.4"其他设备信息
  • 返回结果
json
{
    "errorCode": 0,
    "description": "success",
    "errorMsg": "success",
    "data": {
        "token": "15|92J3hghHl9hxbsV2HfjF4LWxdXLgowzHkZjFDO4t55daac82"
    }
}

2.3 重置密码

  • 接口地址
POST /v1/user/resetPassword
  • 请求参数
名称类型是否必需示例描述
countryCodestringN"+86"区号,默认86
accountstringY"13411111111"手机号
verificationCodeintY123456验证码
newPasswordstringY"12345678"新密码
  • 返回结果
json
{
    "errorCode": 0,
    "description": "success",
    "errorMsg": "success",
    "data": {}
}

3. 用户信息

3.1 修改密码

  • 接口地址
POST /v1/user/changePassword
  • 请求参数
名称类型是否必需示例描述
verificationCodeintY123456验证码
passwordstringY"12345678"新密码
  • 返回结果
json
{
    "errorCode": 0,
    "description": "success",
    "errorMsg": "success",
    "data": {}
}

3.2 更新个人信息

  • 接口地址
POST /v1/user/updateUserInfo
  • 请求参数
名称类型是否必需示例描述
headUrlstringY"fdafdaf"新头像
namestringY"biaobiao"新名称
  • 返回结果
json
{
    "errorCode": 0,
    "description": "success",
    "errorMsg": "success",
    "data": {}
}

3.3 用户信息接口

  • 接口地址
POST /v1/user/detail
  • 请求参数

  • 返回结果
名称类型示例描述
idint2用户ID
accountNostring"ZHA1866730228303548448"编号
phonestring"13411111111"手机号
nicknamestring"啊啊"姓名
headUrlstring"https://sdaf.com/daa.png"头像
createdAtstring"2024-12-30"注册时间
lastLoginTimestring"2024-12-30"最后登录时间
currentTeamNostring"ZHA1866730228303548448"当前团队编号
teamListarray[]所在的团队列表
teamList.*.teamNostring"ZHA1866730228303548448"团队编号
teamList.*.teamNamestring"啊啊啊"团队名称
teamList.*.teamCodestring"SDFDAF"团队码

备注

团队系统功能暂未完成,teamList暂时只返回空数组

  • 返回示例
json
{
    "errorCode": 0,
    "description": "success",
    "errorMsg": "success",
    "data": {
        "id": 2,
        "accountNo": "YH208389499689214",
        "countryCode": "+86",
        "phone": "13410577084",
        "nickname": "biaobiao",
        "headUrl": "http://local.work.star-lock.cn/storage/https://ui-avatars.com/api/?name=StW_fdafd&color=7F9CF5&background=EBF4FF",
        "createdAt": "2024-12-25 17:08:19",
        "lastLoginTime": "2025-01-11 14:32:00",
        "currentTeamNo": "",
        "teamList": [
            {
                "id": 1,
                "teamNo": "TD20661036",
                "teamName": "biaobiao1",
                "teamCode": "KPQOVTHP",
                "owner": "YH208389499689214",
                "createdAt": "2025-01-08 11:29:12",
                "scene": 0,
                "sceneCustomName": "",
                "personNo": "CY29810012",
                "personName": "biaobiao",
                "isOwner": true
            }
        ]
    }
}

3.4 修改手机号

  • 接口地址
POST /v1/user/updateUserInfo
  • 请求参数
名称类型是否必需示例描述
verificationCodestringY"123456"验证码
phonestringY"13411111111"新手机
  • 返回结果
json
{
    "errorCode": 0,
    "description": "success",
    "errorMsg": "success",
    "data": {}
}

4. 终端设备

4.1 终端设备列表

  • 接口地址
POST /v1/user/getBindMobileDevice
  • 请求参数
名称类型是否必需示例描述
currentDeviceNostringN"AXD1123"当前设备编号
  • 返回结果
json
{
    "errorCode": 0,
    "description": "success",
    "errorMsg": "success",
    "data": [
        {
            "id": 1,
            "deviceNo": "12121212",
            "deviceName": "设备1",
            "platId": 2,
            "lastLoginTime": "2024-12-30 11:40:35"
        },
        {
            "id": 2,
            "deviceNo": "AXH_1121212",
            "deviceName": "设备2",
            "platId": 4,
            "lastLoginTime": "2024-12-30 11:41:15"
        }
    ]
}

4.2 解绑终端设备

  • 接口地址
POST /v1/user/unbindMobileDevice
  • 请求参数
名称类型是否必需示例描述
idintY2设备ID
  • 返回结果
json
{
    "errorCode": 0,
    "description": "success",
    "errorMsg": "success",
    "data": {}
}

鑫泓佳智能硬件通信协议文档