1. 修改权限
PUT:http://api.xdua.com/roue/{roue_id}
下面这些字段放到post的body里
字段名 | 位置 | 类型 | 字段说明 | 举例 | 可选 |
---|---|---|---|---|---|
apiv | head | string | API版本,默认是1.0.0 | 1.0.0 | 可选 |
Authorization | head | string | 客户端保存的鉴权token,登陆是获取 | Authorization字符串 | 必选 |
roue_id | path | string | 权限的id | xiU8wjsa | 必须 |
enabled | body | String | 0:关闭 1:打开 | 可选 |
返回数据
成功返回
{
"error": 0,
"result": {},
"reason": "Success"
}
失败返回
{
"error":>0,
"result": {"失败供调试的东西"},
"reason": "失败原因"
}
//--------------------------------------------------
const dua = await lovearth({
APP_KEY: "您的appkey",
APP_SECRET: "您的appsecret",
})
got_roue_id = "";
const res_login = await dua.login({
by : "tel",
ustr: '+86-15810419011',
pwd : '您的密码md5',
ugrp: "XdUaXduA",
role: "none"
})
api_name = "修改权限";
let cur_roue_id = "YI49utyP";
res = await dua.putroue(cur_roue_id,{"name":"test_role_set"+Math.random()*100})
if(res.error == 0){
console.log(api_name+"成功 "+cur_roue_id);
}else{
console.log(res)
console.log(api_name+"失败 "+res.reason);
}