更改京东用户角色

This commit is contained in:
苏尹岚
2019-12-02 16:59:58 +08:00
parent 9c0c7f187f
commit b5a7f0b967
2 changed files with 18 additions and 1 deletions

View File

@@ -655,3 +655,16 @@ func (a *API) PrivilegeUpdateJdUserStatus(id int64, status int) (err error) {
_, err = a.AccessStorePage(url, nil, true)
return err
}
// 更改商家中心账号角色接口
// https://login-o2o.jddj.com/jpuser/binduserrole/346568/update?appCode=lsp-store
//roleIds: 28926拣货员
func (a *API) UpdateJdUserRoles(id int64, roleIDs []string) (err error) {
url := "https://login-o2o.jddj.com/jpuser/binduserrole/" + utils.Int64ToStr(id) + "/update"
jdParams := map[string]interface{}{
"appCode": "lsp-store",
"roleIds": strings.Join(roleIDs, ","),
}
_, err = a.AccessStorePage(url, jdParams, true)
return err
}

View File

@@ -207,5 +207,9 @@ func TestPrivilegeSearchUser(t *testing.T) {
}
func TestPrivilegeUpdateJdUserStatus(t *testing.T) {
api.PrivilegeUpdateJdUserStatus(346408, 0)
api.PrivilegeUpdateJdUserStatus(346415, 0)
}
func TestUpdateJdUserRoles(t *testing.T) {
api.UpdateJdUserRoles(346568, []string{"28926", "28924"})
}