商家端PC端OA接口.md 4.56 KB

----接口说明----

以下相关接口为北京侧Java服务

文档原始地址: http://git.yoho.cn/YOHOERP/erp-gateway/wikis/oa系统

测试环境联调地址示例: http://192.168.13.180/erp-gateway-web/account/profile/login

线上环境地址示例: 待定

1、登录

add by Tina, 2016/7/19

/erp-ams-web/account/profile/login

名称 类型 是否必须 示例值 默认值 描述
account String Y "mhh" 账户名称
password String Y "0.123456" 密码
platform Integer Y 2 平台标识:1平台端 2商家端

微服务调用 Service Node

ams:account_profile.login

业务处理

  1. 账号获取用户信息
  2. 验证
    • 账号是否存在(201)
    • 账号是否过期(201)
    • 账号是否关闭(201)
    • 是否有权限登录当前站点(201)
    • 验证密码(407)
  3. 更新当前账号登录时间
  4. 获取供应商id,无则置为0;置空密码信息;设置create_time的可读格式(yyyy-mm-dd HH:ii:ss)为create_date
  5. 返回结果

Request

{
    "account" : "fengjb",
    "password" : "0.123456",
    "platform" : 1
}

Result

{
  "account": "ad",
  "auth_site": "1,2", //1-运营平台 2-商家平台
  "create_date": "2016-03-29 14:44:01",
  "create_id": 2793,
  "create_time": 1459233841,
  "dept_id": 1,
  "email": "123",
  "expires": 1484841600,
  "login_time": 1468568505,
  "logout_time": 0,
  "phone": "15101660386",
  "pid": 100083,
  "role_id": 1,
  "staff_code": "000",
  "status": 1, //0关闭 1开启
  "supplier_id": 0,
  "truename": "超级管理员"
}

2、获取账户有权限访问的菜单列表

add by mhh, 2016/7/19

/erp-ams-web/account/menu/query_by_pid

名称 类型 是否必须 示例值 默认值 描述
pid Integer Y 100083 用户id
platform_id Integer Y 1 平台标识:1平台端 2商家端

微服务调用 Service Node

ams:account_menu.getMenuByPid

Request

{
    "pid" : 10,
    "platform_id" : 1
}

Result

[
    {
        "id": "1",
        "menu_name": "基本设置",
        "menu_img": "",
        "description": "基本设置",
        "menu_url": "",
        "parent_id": "0",
        "platform": "1",
        "order_by": "1110",
        "create_time": "1455614805",
        "status": "1",
        "sub": [
            {
                "id": "3",
                "menu_name": "权限管理",
                "menu_img": "",
                "description": "权限管理",
                "menu_url": "/account/action/index",
                "parent_id": "1",
                "platform": "1",
                "order_by": "99",
                "create_time": "1455614928",
                "status": "1",
                "sub": []
            },
            {
                "id": "2",
                "menu_name": "菜单管理",
                "menu_img": "",
                "description": "菜单管理",
                "menu_url": "/account/menu/index",
                "parent_id": "1",
                "platform": "1",
                "order_by": "98",
                "create_time": "1455614851",
                "status": "1",
                "sub": []
            },
            {
                "id": "282",
                "menu_name": "数据权限管理",
                "menu_img": "",
                "description": "数据权限管理",
                "menu_url": "/account/datarole/index",
                "parent_id": "1",
                "platform": "1",
                "order_by": "0",
                "create_time": "1467268023",
                "status": "1",
                "sub": []
            }
        ]
    }
]

3、验证权限

add by mhh, 2016/7/19

/erp-ams-web/account/action/verify_auth

名称 类型 是否必须 示例值 默认值 描述
pid Integer Y 10 账户id
role_id Integer Y 10 角色id
path String Y "/default/index/index" 路径
platform_id Integer Y 1 平台标识:1平台端 2商家端

微服务调用 Service Node

ams:account_action.verifyAuth

Request

{
    "pid" : 10,
    "role_id" : 19,
    "path" : "/default/index/index",
    "platform_id" : 1
}

Result

{
    "code":200
    "errmsg":"验证成功!"
}