takayama-lily / mjsoul

majsoul client
MIT License
70 stars 10 forks source link

请问这个api现在还可以使用吗 #9

Open RikaShiro opened 2 years ago

RikaShiro commented 2 years ago

替换了liqi.json 用qq邮箱和登录密码替换了test.js中的account和password 尝试直接用node ./test.js启动项目 但是一直未成功登录 mjsoul中url是'wss://gateway-v2.maj-soul.com/gateway'

testjs

dss886 commented 1 year ago

可以用,开着Chrome的开发者工具,扒一下liqi.json、gateway的url和登陆的请求字段,填好就行了。README里面的登录填的字段少了很多,会被拒绝

brqs commented 1 year ago

我通过抓包也获取了gateway的信息,替换了新的liqi.json,但是反复尝试依旧不能成功运行。下面是我的代码 "use strict" const MJSoul = require("./mjsoul") const mjsoul = new MJSoul({ url: "wss://gateway-hw.maj-soul.com/gateway" } )

let login = async () => {

try {
    //登陆
    let data = await mjsoul.sendAsync(
        "login",
        {
            account: "xxxxxx@xxxx",
            password: mjsoul.hash("xxxxxx"),
            client_version_string: "web-0.10.227b",
        }
    )
    console.log(data)

    //获取好友列表cd
    data = await mjsoul.sendAsync("fetchFriendList")
    console.log(data)
} catch (e) {
    console.log(e)
}

}

//绑定事件 mjsoul.on("NotifyAccountLogout", login)

mjsoul.open(login)

我的错误信息 ResLogin { logined_version: [], rewarded_version: [], error: Error { u32_params: [], str_params: [], code: 151 } } 我猜测是缺少了什么信息但是我并不知道缺少了什么。

可以用,开着Chrome的开发者工具,扒一下liqi.json、gateway的url和登陆的请求字段,填好就行了。README里面的登录填的字段少了很多,会被拒绝

dss886 commented 1 year ago

扒一下网页登录的请求,所有的字段都填上就行。我有几个月没试过了,之前用下面这些字段是ok的:

let data = {
    "type": 0,
    "reconnect": false,
    "device": {
        "platform": "pc",
        "hardware": "pc",
        "os": "mac",
        "is_browser": true,
        "software": "Chrome",
        "sale_platform": "web",
        "screen_width": 1920,
        "screen_height": 1080,
    },
    "random_key": "xxxx",
    "client_version": {
        "resource": "0.10.210.w"
    },
    "currency_platforms": [
        2,
        6,
        8,
        10,
        11
    ],
    "client_version_string": "web-0.10.210",
    "tag": "cn"
};