53 lines
1.5 KiB
PHP
53 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace app\controller;
|
|
|
|
use support\Request;
|
|
use support\Redis;
|
|
use support\Db;
|
|
|
|
class Account
|
|
{
|
|
public function loginCallback(Request $request)
|
|
{
|
|
$rd=$request->input('rd','null');
|
|
$sum=$request->input('sum','null');
|
|
$uid=$request->input('id','null');
|
|
if($rd=='null'||$sum=='null'||$sum!=md5($rd.$uid.getenv('aeskey'))){
|
|
return view('404');
|
|
}
|
|
$session = $request->session();
|
|
$session->set('ACCOUNT_CALLBACK_rd', $rd);
|
|
$session->set('ACCOUNT', $uid);
|
|
$user = Db::table('User')->where('ID', $uid)->first();
|
|
$requireFields = array();
|
|
$i=0;
|
|
foreach($user as $key=>$value){
|
|
if(in_array($key, ['name','sex','email','phone','address','sfz','birthday','avatar','realname'])&&($value==null||$value==''||$value=='null')){
|
|
array_push($requireFields,$key);
|
|
$i++;
|
|
}
|
|
}
|
|
if($i>0){
|
|
return view('account/extend', ['userid'=>$user->ID,'username'=>$user->name,'requireFields'=>$requireFields]);
|
|
}else{
|
|
$session->set('ACCOUNT_ve', 1);
|
|
$session->forget(['ACCOUNT_CALLBACK_rd']);
|
|
return redirect($rd);
|
|
}
|
|
|
|
|
|
}
|
|
|
|
public function view(Request $request)
|
|
{
|
|
return view('index/view', ['name' => 'webman']);
|
|
}
|
|
|
|
public function json(Request $request)
|
|
{
|
|
return json(['code' => 0, 'msg' => 'ok']);
|
|
}
|
|
|
|
}
|