bs-community / blessing-skin-plugins

Official plugins for Blessing Skin.
MIT License
77 stars 36 forks source link

uuid更新失败 #179

Open SkyIce0229 opened 1 year ago

SkyIce0229 commented 1 year ago

我验证完后在个人资料按更新uuid过了几秒钟出现uuid更新失败弹窗 image

vltown commented 1 year ago

我也是这种情况,请问您解决这个问题了吗,我找不到原因所在

AsColdnet commented 9 months ago

我也是,请问有解决方法没

D3adEr1c commented 8 months ago

https://github.com/bs-community/blessing-skin-plugins/issues/186#issuecomment-1824660226

Illusionika commented 8 months ago

刚从正版服转外置登录.也遇到这个问题了. API接口没了的话,感觉可以直接数据库里update 我看了下,进行完正版验证后 mojang_verifications 这个表里面是有正确的正版UUID和PID的

D3adEr1c commented 8 months ago

它 post("/mojang/update-uuid") 后 call AccountController@uuid

public function uuid()
    {
        $uuid = MojangVerification::where('user_id', auth()->id())->value('uuid');
        try{
           $response = Http::withOptions(['verify' => CaBundle::getSystemCaRootBundlePath()])
                ->get("https://api.mojang.com/user/profiles/$uuid/names");
            $name = $response->json()[0]['name'];

            DB::table('uuid')->updateOrInsert(['name' => $name], ['uuid' => $uuid]);

            return json(trans('GPlane\Mojang::uuid.success'), 0);
        }catch (\Exception $e) {
            Log::channel('mojang-verification')->error($e);
            return json(trans('GPlane\Mojang::uuid.failed'), 1);
        }
    }

目的应该是通过 uuid 获取最新名称 然后我是 AccountController.php 改成了 https://sessionserver.mojang.com/session/minecraft/profile/$uuid

Illusionika commented 8 months ago

上面的API确实能用,不过下面的$name也要去掉[0],改成这样就行了 $response = Http::withOptions(['verify' => CaBundle::getSystemCaRootBundlePath()]) ->get("https://sessionserver.mojang.com/session/minecraft/profile/$uuid"); $name = $response->json()['name'];

另外又找了个第三方的API https://minecraft-api.com/uuid/