稳定、快速、高效的 数据接口服务
当前接口状态 · 正常
获取应用配置
接口地址: https://yz.rlyun.asia/api.php?api=ini
返回格式: JSON
请求方式: GET
请求示例: https://yz.rlyun.asia/api.php?api=ini&app=10000
请求参数说明:
名称 | 变量 | 必填 | 类型 | 说明 |
---|---|---|---|---|
接口 | api | 是 | GET | 填写ini |
应用 | app | 是 | GET | 填写后台应用APPID |
返回参数说明:
名称 | 类型 | 说明 |
---|---|---|
code | String | 返回状态 |
version | String | 应用版本 |
version_info | String | 版本信息 |
app_update_show | String | 更新内容 |
app_update_url | String | 更新地址 |
app_update_must | String | 开启强制更新返回"y",关闭则返回"n" |
返回示例:
{ "code": 200, "msg": { "version": "1.0", "version_info": "1.0、欢迎使用极简云验证\n2.0、船新版本正式发布", "app_update_show": "船新版本已发布,请及时更新", "app_update_url": "http://baidu.com", "app_update_must": "y" }, "time": 1614688638, "check": "cadc2878f369a5ca6f417615ffdee828" }
错误码格式说明:
名称 | 类型 | 说明 |
---|---|---|
101 | String | 应用不存在 |
102 | String | 应用已关闭 |
171 | String | 接口维护中 |
172 | String | 接口未添加或不存在 |
代码示例:
-- 该示例的应用<传输安全><应用安全配置>为关闭,否则需要进行更多操作 local HOST = 'http://yz.rlyun.asia' local APPID = '50094' local APPKEY = 'GZGL4TUU4tTDd0l3' local isSign = false ---@param api string ---@param params table | nil ---@param gets table | nil ---@return table local function postApi(api, params, gets) local data = '' if type(params) == 'table' then if params.t == nil then -- 时间戳 t 否 GET/POST 如果开启了[时间差效验]需提交此项 params.t = os.time() end if params.markcode == nil then -- 设备码 markcode 是 GET/POST 如果开启了[验证设备]需提交此项 params.markcode = '设备码' or gg.PACKAGE end if isSign and false then -- 如果开启了[数据签名]需提交此项 if type(md5) ~= 'function' then error('没有md5函数,无法生成签名(sign)', 2) end local t = {} for k, v in pairs(params) do t[#t + 1] = string.format('%s=%s', k, v) end t[#t + 1] = APPKEY local s = table.concat(t, '&') params.sign = md5(s) end local t = {} for k, v in pairs(params) do t[#t + 1] = string.format('%s=%s', k, v) end data = table.concat(t, '&') end local function match(s, k, capture) if not capture then capture = '([%w+])' end return s:match(string.format('%q', k) .. '%s*:%s*' .. capture) end local function matchNumber(s, k) return tonumber(match(s, k, '(%d+)')) end local function matchString(s, k) return match(s, k, '"(.-)"') end local function matchBoolean(s, k) return match(s, k) == 'true' end local t = {} local res = gg.makeRequest(HOST .. '/api.php?api=' .. api .. '&app=' .. APPID, nil, data) if type(res) ~= 'table' then t.code = 0 t.msg = res elseif res.code ~= 200 then t.code = res.code t.msg = res.message else local data = res.content t.code = matchNumber(data, 'code') t.msg = matchString(data, 'msg') if t.code == 200 and type(gets) == 'table' then for i, v in ipairs(gets) do t[v] = matchString(data, v) end end end return t end local function kmlogon(kami) local res = postApi('kmlogon', { kami = kami }, {'kami', 'vip'}) if res.code ~= 200 then print(res.msg) os.exit() return end print(res) end local function kmunmachine(kami) local res = postApi('kmunmachine', { kami = kami }) print(res) end local function notice() local res = postApi('notice', nil, {'app_gg'}) print(res) end local function ini() local res = postApi('ini', nil, {'version', 'version_info', 'app_update_show', 'app_update_url', 'app_update_must'}) print(res) end ini() notice() kmlogon('825fiU2U5a')