1. 修改应用

应用设置接口:

PUT:http://api.xdua.com/app/{app_id}

字段名 字段位置 字段类型 字段说明 举例 可选
apiv head string API版本,默认是1.0.0 1.0.0 可选
Authorization head string 客户端保存的鉴权token Authorization字符串 必选
app_id path string 应用ID md5表达的应用id 必须
secret path string 生成新的secret的kid 后端会用kid连同后台生成的随机数共同生成新的secret 必须
ugrp body string 应用绑定的户群名 examp_ugrp 可选
name body string 应用的名字 应用名字 可选
brief body String 应用的介绍 应用简介 可选
avatar body string 应用的图标url http://开头的图片地址 可选
enabled body String 使能 0:关闭 1:打开 可选

1.1. 返回数据

成功返回

{
    "error": 0,
    "reason": "Success"
    "result": {},
}

如果要重置appsecret,只需要在修改代码里,设置secret,API就会在result里返回新的secret.

失败返回

{    
    "error":>0,
    "result": {"失败供调试的东西"},
    "reason": "失败原因"
}

1.1.1. 重置appsecret

    //--------------------------------------------------
    const dua = await lovearth({
        APP_KEY: "aHEVYhE1",
        APP_SECRET: "f34b127abc7cca1862dac91db6256190",
    })

    api_name = "修改应用";
    await dua.login({
        by  :   "tel",
        ustr:   '+86-15810419011',
        pwd :   'a906449d5769fa7361d7ecc6aa3f6d28',
        ugrp:   "XdUaXduA",
        role:   "none"
    })

    const res = await dua.putApp("UmTZB0Bm",{secret:"mysecret"})
    console.log(res);
    if(res.error == 0){
        got_ugrp_id = res.result.id;
        console.log(api_name+"成功 "+got_ugrp_id);
    }else{
        got_ugrp_id = res.result.id;
        console.log(api_name+"失败 "+res.reason);
    }

返回结果


{ 
    result: { 
        secret: 'b522b09fcacd9395f7f17d15c491d92c' 
    },
    error: 0,
    reason: 'Success' 
}

results matching ""

    No results matching ""