this_username = $this->GetUserInfoByToken(MY_TOKEN)["username"]; $this->this_roleid = $this->this_username == MANAGE_USER ? 1 : 2; } //根据token获取用户信息 final function GetUserInfoByToken($token) { $explode = explode('.', $token); $data = array( "username" => $explode[0] ); return $data; } }