|
|
@ -131,30 +131,32 @@ class Callback extends Controller
|
|
|
|
if (isset($userInfo['userid']) && $userInfo['userid']) {
|
|
|
|
if (isset($userInfo['userid']) && $userInfo['userid']) {
|
|
|
|
Session::set('wxuser_id', $userInfo['userid']);
|
|
|
|
Session::set('wxuser_id', $userInfo['userid']);
|
|
|
|
$adminUser = db('admin_user')->where('wxwork_id', $userInfo['userid'])->find();
|
|
|
|
$adminUser = db('admin_user')->where('wxwork_id', $userInfo['userid'])->find();
|
|
|
|
if ($adminUser) {
|
|
|
|
if($adminUser['status']==1){
|
|
|
|
Session::set('user_id', $adminUser['id']);
|
|
|
|
if ($adminUser) {
|
|
|
|
|
|
|
|
Session::set('user_id', $adminUser['id']);
|
|
|
|
|
|
|
|
|
|
|
|
$info['userInfo'] = $adminUser;
|
|
|
|
$info['userInfo'] = $adminUser;
|
|
|
|
$info['sessionId'] = session_id();
|
|
|
|
$info['sessionId'] = session_id();
|
|
|
|
// $info['_AUTH_LIST_'] = $dataList['rulesList'];
|
|
|
|
// $info['_AUTH_LIST_'] = $dataList['rulesList'];
|
|
|
|
$info['authKey'] = 'wxwork';
|
|
|
|
$info['authKey'] = 'wxwork';
|
|
|
|
if (!Cache::get('Auth_wxwork')) {
|
|
|
|
if (!Cache::get('Auth_wxwork')) {
|
|
|
|
Cache::set('Auth_wxwork', $info);
|
|
|
|
Cache::set('Auth_wxwork', $info);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return redirect('http://web.lbschem.com:8088/?authkey=wxwork&sessionid='.session_id());
|
|
|
|
|
|
|
|
} elseif (Session::get('user_id')) {
|
|
|
|
|
|
|
|
db('admin_user')->where('id', Session::get('user_id'))->update([
|
|
|
|
|
|
|
|
'wxwork_id' => $userInfo['userid']
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
$adminUser = db('admin_user')->where('id', Session::get('user_id'))->find();
|
|
|
|
|
|
|
|
$info['userInfo'] = $adminUser;
|
|
|
|
|
|
|
|
$info['sessionId'] = session_id();
|
|
|
|
|
|
|
|
// $info['_AUTH_LIST_'] = $dataList['rulesList'];
|
|
|
|
|
|
|
|
$info['authKey'] = 'wxwork';
|
|
|
|
|
|
|
|
if (!Cache::get('Auth_wxwork')) {
|
|
|
|
|
|
|
|
Cache::set('Auth_wxwork', $info);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return redirect('http://web.lbschem.com:8088/?authkey=wxwork&sessionid='.session_id());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return redirect('http://web.lbschem.com:8088/?authkey=wxwork&sessionid='.session_id());
|
|
|
|
|
|
|
|
} elseif (Session::get('user_id')) {
|
|
|
|
|
|
|
|
db('admin_user')->where('id', Session::get('user_id'))->update([
|
|
|
|
|
|
|
|
'wxwork_id' => $userInfo['userid']
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
$adminUser = db('admin_user')->where('id', Session::get('user_id'))->find();
|
|
|
|
|
|
|
|
$info['userInfo'] = $adminUser;
|
|
|
|
|
|
|
|
$info['sessionId'] = session_id();
|
|
|
|
|
|
|
|
// $info['_AUTH_LIST_'] = $dataList['rulesList'];
|
|
|
|
|
|
|
|
$info['authKey'] = 'wxwork';
|
|
|
|
|
|
|
|
if (!Cache::get('Auth_wxwork')) {
|
|
|
|
|
|
|
|
Cache::set('Auth_wxwork', $info);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return redirect('http://web.lbschem.com:8088/?authkey=wxwork&sessionid='.session_id());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return redirect('http://web.lbschem.com:8088/');
|
|
|
|
return redirect('http://web.lbschem.com:8088/');
|
|
|
|