VersionUpdate TimeStatusAuthorDescription

1.0.0

2022-05-13 11:15

create

Serenity

初始化

1. 用户相关接口

1.1. 获取公钥

Type: GET

Author: Serenity SerenitySir@outlook.com

Content-Type: application/x-www-form-urlencoded;charset=utf-8

Description: 原api:http://{server}/user/getErpPublicKey

Response-fields:

FieldTypeDescriptionSince

code

int32

No comments found.

-

status

boolean

No comments found.

-

msg

string

No comments found.

-

data

object

No comments found.

-

└─code

int32

状态码

-

└─sourceCode

int32

原api code

-

└─status

boolean

请求状态

-

└─msg

string

请求信息

-

└─data

string

数据体

-

sourceCode

int32

No comments found.

-

Response-example:

{
  "code": 265,
  "status": true,
  "msg": "eom0tw",
  "data": {
    "code": 741,
    "sourceCode": 281,
    "status": true,
    "msg": "46wy27",
    "data": "nw97f0"
  },
  "sourceCode": 400
}

Curl-example:

curl -X GET -i http://10.1.7.118:8989/user/public-key

1.2. 用户登录

Type: POST

Author: Serenity SerenitySir@outlook.com

Content-Type: application/x-www-form-urlencoded;charset=utf-8

Description: 原api:http://{server}/user/login

Query-parameters:

ParameterValueTypeRequiredDescription

account

string

false

登录名

password

string

false

使用公钥加密后的密码

Response-fields:

FieldTypeDescriptionSince

code

int32

No comments found.

-

status

boolean

No comments found.

-

msg

string

No comments found.

-

data

object

No comments found.

-

└─code

int32

状态码

-

└─sourceCode

int32

原api code

-

└─status

boolean

请求状态

-

└─msg

string

请求信息

-

└─data

object

数据体

-

     └─roleName

string

角色名

-

     └─userName

string

用户名称

-

     └─token

string

令牌

-

     └─userInfo

object

当前用户的信息

-

          └─id

int32

用户ID

-

          └─account

string

账户名

-

          └─password

string

密码

-

          └─roleId

int32

角色ID

-

          └─agencyId

int64

代理商ID

-

          └─agencyName

string

代理商名称

-

          └─merchantId

int64

商家ID

-

          └─merchantName

string

商家名称

-

          └─storeId

string

门店ID

-

          └─storeName

string

门店名称

-

          └─enable

int32

是否启用

-

          └─flag

int32

是否有效

-

          └─name

string

姓名

-

          └─phone

string

电话

-

          └─email

string

邮箱

-

          └─createTime

string

创建时间

-

          └─lastLoginTime

string

最后登录时间

-

sourceCode

int32

No comments found.

-

Response-example:

{
  "code": 874,
  "status": true,
  "msg": "xmwa57",
  "data": {
    "code": 516,
    "sourceCode": 120,
    "status": true,
    "msg": "fqdod8",
    "data": {
      "roleName": "johnathan.purdy",
      "userName": "johnathan.purdy",
      "token": "df2lbo",
      "userInfo": {
        "id": 565,
        "account": "cyvswf",
        "password": "hvzfb1",
        "roleId": 708,
        "agencyId": 157,
        "agencyName": "johnathan.purdy",
        "merchantId": 491,
        "merchantName": "johnathan.purdy",
        "storeId": "128",
        "storeName": "johnathan.purdy",
        "enable": 164,
        "flag": 5,
        "name": "johnathan.purdy",
        "phone": "903-914-1213",
        "email": "alberto.funk@hotmail.com",
        "createTime": "2022-05-17 09:38:23",
        "lastLoginTime": "2022-05-17 09:38:23"
      }
    }
  },
  "sourceCode": 798
}

Curl-example:

curl -X POST -i http://10.1.7.118:8989/user/login

2. 错误码列表

Error codeDescription

200

OK

201

created

202

accepted

204

No content

301

Moved permanently

302

Moved temporary

303

See other

304

Not modified

400

Invalid request

401

Unauthorized

402

Token has expired

403

Forbidden

404

Not found

406

Not acceptable

409

Conflict

410

Gone

412

Precondition failed

415

Unsupported media type

422

Can’t handle entity

500

Internal Server Error

503

Service unavailable

Top