抱歉格式贴上来乱了,我这个是嵌入到我用react和electron的启动器应用里面的,用户启动启动器以后就会自动创建这个本地服务器用来做验证,但是一直没法进行正确的验证,我去DC上问了一下主要开发者这方面的问题,他们说GET必须要留一个空字段,就可以正常调用了,我现在正在部署新的服务器准备测试一下是不是真的这样,但如果有其他方面的知识我会感激不尽。
local function verifyLauncher(callback)
print('[Debug] Starting verification process')
PerformHttpRequest('http://127.0.0.1:31429/verify', function(errorCode, resultData, resultHeaders)
print('[Debug] Response received')
print('[Debug] Error code:', errorCode)
print('[Debug] Result data:', resultData)
if errorCode ~= 200 then
print('[Debug] Request failed')
callback(false)
return
end
local success, data = pcall(json.decode, resultData)
if success and data and data.valid then
print('[Debug] Verification successful')
callback(true)
else
print('[Debug] Verification failed')
callback(false)
end
end, 'GET', '', {
['Content-Type'] = 'application/json',
['Accept'] = 'application/json'
})
end