$this->user = json_decode($result); 在php7.4是正常的,php8.2就報錯這個錯誤:Cannot assign stdClass to property app\api\controller\v1\Base::$user
不支持對象類型隱式轉(zhuǎn)換。 你可以序列化再反序列化曲線救國。 例如之前在PHP5.6的時代經(jīng)常能看見這樣的代碼json_decode(json_encode($data),true);
json_decode(json_encode($data),true);