aozhiwei 91f03316a2 1
2022-04-26 16:35:38 +08:00

44 lines
997 B
JavaScript

const axios = require('axios').default;
const protobuf = require('protobufjs');
function get(url, params) {
return new Promise((resolve) => {
const ret = {
err: null,
response: null,
};
axios({
method: 'get',
url: url,
timeout: 1000 * 10,
params: params,
responseType: 'text'
}).then((response) => {
ret.response = response.data;
resolve(ret);
}).catch((error) => {
ret.err = error;
resolve(ret);
});
});
}
async function start() {
const fiendMsg = await protobuf.load('proto/friend/cs_proto.proto');
const fiendMsgId = await protobuf.load('proto/friend/cs_msgid.proto');
console.log(friendMsg, friendMsgId);
const {err, response} = await get(
'https://login-z2-test.cebg.games/webapp/index.php',
{
'c': 'Login',
'a': 'auth',
'gameid': 2006,
'channel': 6513,
'account': '123456',
'openid': '123456'
});
console.log(err, response);
}
start();