|
|
|
@ -131,30 +131,32 @@ class Callback extends Controller
|
|
|
|
|
if (isset($userInfo['userid']) && $userInfo['userid']) {
|
|
|
|
|
Session::set('wxuser_id', $userInfo['userid']);
|
|
|
|
|
$adminUser = db('admin_user')->where('wxwork_id', $userInfo['userid'])->find();
|
|
|
|
|
if ($adminUser) {
|
|
|
|
|
Session::set('user_id', $adminUser['id']);
|
|
|
|
|
if($adminUser['status']==1){
|
|
|
|
|
if ($adminUser) {
|
|
|
|
|
Session::set('user_id', $adminUser['id']);
|
|
|
|
|
|
|
|
|
|
$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);
|
|
|
|
|
$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());
|
|
|
|
|
} 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/');
|
|
|
|
|