解绑卡密机械码及IP

接口地址: https://yz.rlyun.asia/api.php?api=kmunmachine

返回格式: JSON

请求方式: GET

请求示例: https://yz.rlyun.asia/api.php?api=kmunmachine&app=10000

请求参数说明:

名称 变量 必填 类型 说明
接口 api GET 填写kmunmachine
应用 app GET 填写后台应用APPID
设备码 markcode GET/POST 如果开启了[验证设备]需提交此项
时间戳 t GET/POST 如果开启了[时间差效验]需提交此项
数据签名 sign GET/POST 如果开启了[数据签名]需提交此项

返回参数说明:

名称 类型 说明
code String 返回状态
msg String 返回内容

返回示例:

{
    "code": 200,
    "msg": "卡密解绑成功",
    "time": 1614691420,
    "check": "9730a2b274084053f7e42dd5399a0b55"
}

错误码格式说明:

名称 类型 说明
101 String 应用不存在
102 String 应用已关闭
171 String 接口维护中
172 String 接口未添加或不存在
104 String 签名为空
105 String 数据过期
106 String 签名有误
112 String 请填写机械码
148 String 卡密为空
149 String 卡密不存在
151 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')