请有人帮助我:(对不起这些初学者问题,它真的很奇怪,$stdobj
在auth和first elseif中完全正常,奇怪的是第二个elseif具有完全相同的代码,但是修改laravel错误试图获取非对象的属性。但是它在第一个elseif中起作用,为什么它说它不是最后一个对象!!!
$our_user = User::check_if_user_matches($username);
$stdobj = new \stdClass();
$stdobj = $our_user['usid'];
if (\Auth::attempt(['username' => $username, 'password' => $password])) {
$logdata = [];
$v = new Verta();
$logdata['logTime'] = $v->formatTime();
$logdata['logDate'] = $v->formatDate();
$logdata['logCode'] = '001';
$logdata['user_id'] = $stdobj->id;
$logs->insert($logdata);
return redirect()->intended('home');
} elseif ($our_user['usname'] == $username) {
$v = new Verta();
//$stdobj1 = $our_user['usid'];
$logdata = [];
$logdata['logTime'] = $v->formatTime();
$logdata['logDate'] = $v->formatDate();
$logdata['logCode'] = '003';
$logdata['user_id'] = $stdobj->id;
$logs->insert($logdata);
return redirect()->intended('login');
} elseif ($our_user['usname'] != $username) {
$v = new Verta();
//$stdobj1 = $our_user['usid'];
$logdata = [];
$logdata['logTime'] = $v->formatTime();
$logdata['logDate'] = $v->formatDate();
$logdata['logCode'] = '002';
$logdata['user_id'] = $stdobj->id;
$logs->insert($logdata);
return redirect()->intended('login');
} else {
return back()->withInput();
}
答案 0 :(得分:1)
你需要char[] result = new char[]{Information, Information, Information, Information}
对你的目标有价值。在顶部添加此行 -
var oneByteInfo = message.ReadBytes(1);
var oneByteInfo2 = message.ReadBytes(1);
var infoBitArray = new BitArray(oneByteInfo);
var info2BitArray = new BitArray(oneByteInfo2);
var arrayString = Convert.ToString(BitConverter.GetBytes(infoBitArray[0])[0]) +
Convert.ToString(BitConverter.GetBytes(infoBitArray[1])[0]) +
Convert.ToString(BitConverter.GetBytes(info2BitArray[0])[0]) +
Convert.ToString(BitConverter.GetBytes(info2BitArray[1])[0]);
var result = arrayString.ToCharArray();
答案 1 :(得分:0)
因为没有用户名时无法获取密码。您可以通过以下方式找到密码并将其与数据库中的密码进行比较:
https://www.googleapis.com/auth/drive.appdata