1. 描述

查询神角。

2. 调用场景

开发者登录http://consolex.xdua.com后,可以以Root角色查询属于自己名下的所有神角。

3. 配置参数

参数意义参考接口参数

参数名 参数值 说明
Name QryRolex
URL https://api.xdua.com/rolex
Method GET
XduaApiHttpSchema HTTPS 只走HTTPS
XduaApiMethod QRY
XduaApiColor X 只有持有神令牌,才可以创建神角
XduaApiAudience ConsoleX 只有app_id为ConsoleX的应用,也就是consolex.xdua.com才可以发起本请求
XduaApiShop XdUaXduA 神角直辖店铺,只有这个店铺的登录人员才可以访问
XduaApiSubject u 所有注册用户均可以使用
XduaApiRoles Root 必须是Root才可以查询角色
XduaApiResource role
XduaApiKparam where 常量where
XduaApiAction QueryRolex
XduaApiRule QueryRolex
XduaApiAstates 0 按序app,zone,corp,shop,user,token,login的状态都必须是0(STATE_ENABLED)
XduaApiEnable true 接口使能

4. URL

GET:https://api.xdua.com/rolex

5. 请求参数

参考标准查询接口请求参数

6. 返回参数

参考标准查询接口返回参数

result.list部分

名称 位置 类型 示例 说明
id result string rYub4wrT 详情的神角ID
name result.list[] string 神角的名称
avatar result.list[] string 神角图标
brief result.list[] string 神角的描述
state result.list[] int 0 神角的状态
stato result.list[] string "冻服更新" 神角的状态说
expire result.list[] int 0 神角状态过期时间(UNIX时间戳)
creator_id result.list[] string Dmtv7TrE 神角创建者ID
creator_name result.list[] string 辣椒帅 神角创建者名字
updator_id result.list[] string XiyRvUp3 神角最近一次更新者ID
updator_name result.list[] string 周海潮 神角最近一次更新者名字
cstamp result.list[] string 2020-01-20 02:19:55 神角创建时间
ustamp result.list[] string 2020-01-20 02:23:24 神角最近更新时间

7. 错误码

8. 返回result


{
    "limit": 20,
    "total": 22,
    "sort": {
        "inc": "DESC"
    },
    "count": 20,
    "page": 1,
    "pages": 2,
    "list": [{
        "id": "BesterBe",
        "cstamp": "2020-01-20 15:18:37",
        "name": "B测官",
        "state": 0,
        "creator_name": "辣椒帅",
        "code": "Bester",
        "avatar": "http://avatar.xdua.com/role/default.png?x-oss-process=style/avatarp64",
        "granter": "Butler",
        "brief": "店铺测试官",
        "creator_id": "Dt5mvrtU"
    },{
        "id": "NoneNone",
        "cstamp": "2019-03-03 22:14:21",
        "name": "民",
        "state": 0,
        "creator_name": "辣椒帅",
        "code": "None",
        "avatar": "http://avatar.xdua.com/role/defaultrolenone.png?x-oss-process=style/avatarp64",
        "granter": "God",
        "brief": "民",
        "creator_id": "Dt5mvrtU"
    }],
    "format": "raw",
    "where": {
        "zone_id": "XdUaXduA",
        "state": 0
    },
    "offset": 0
}

9. SDK调用

const XduaClient = require('../lib')

const xduaClient = await XduaClient({
    LOGIN_TOKEN:"eyJhbGciOiJSUzI1NiIsImtpZCI6ImI1MGIxZWZmZGMwMzVlMjg2OWI2YzQ1ZjMzYmRmNWQ3In0.eyJpYXQiOjE1ODQ5NzUwNDMsIm5iZiI6MTU4NDk3NTA0MywiaXNzIjoieGR1YS5jb20iLCJleHAiOjE5MDAzMzUwNDMsImF1ZCI6IkJyb3dTZGtUIiwic3ViIjoiQW5vTnltdVMiLCJqdGkiOiIxMjM0NTY3OCIsImlwbSI6IioiLCJkdm0iOiIqIiwic2FwIjoiU3ZLZXJuZUwiLCJhcGkiOiJBZGRMb2dpbiIsImNsciI6IlgiLCJvd24iOiJEdDVtdnJ0VSIsInRpZCI6InhzQUZGNmpHIiwiYnVnIjoiREUiLCJsZ24iOiJOdWxsTnVsbCIsInR5cCI6IkwiLCJ0YWciOiJQcmltYXJ5Iiwiem9uZSI6IlhkVWFYZHVBIiwiY29ycCI6IlhkVWFYZHVBIiwic2hvcCI6IlhkVWFYZHVBIiwicm9sZSI6IioiLCJydWxlIjoiKiJ9.b_KQVug-D83hsfzHVoOvyJZUjjnWhr1UiRCLOBcUSFCLfh3ZoP5GE7m98s6H3QsDpYs20hFkFecj0xiyxzQKy5DOq9XbroXffDmBgg5y45WYnW3P8iqB2WQBtBwEU3VAWk_Vx6UwnGmpb_juu7KsFK33rWswFx3odbw7xe2iMdReywc6bYHf0P7s7kNYqYF_n-odiO6UsZd7yeNos8Hn7XtzE2igD7DhTbB0oxqEzVHoMtFcVAdstsLi3aAcJOK2Gp-XhWHSuiGqd9kTPmghk5cmIDcN7KOOZ6y1GQevM2Qc_7tfebP3Ev-bAZEPAyUA77zRrQMrpwJouejR_sNd3g",
})
const loginres = await xduaClient.addToginx({
    ustr:   '+86-15810419011',
    pwd :   'a906449d5769fa7361d7ecc6aa3f6d28',
    afs :   "ignore"
})

//--------------------------------------------------
let api_name = "查询角色";
query = {
    where:{state:0}
}
const res = await xduaClient.qryRolex(query);
console.log(res);
if(res.error == 0){
    console.log(api_name+"成功 ");
}else{
    console.log(api_name+"失败 "+res.reason);
}

results matching ""

    No results matching ""