修改部分问题
This commit is contained in:
@@ -34,7 +34,7 @@ class FeishuController
|
||||
if(Util::isEmpty($config)){
|
||||
return Util::fail(null,trans('sign_not_null'));
|
||||
}
|
||||
|
||||
|
||||
// 获取凭证
|
||||
$certificate = config('feishu.'.$config);
|
||||
$arr = [
|
||||
@@ -100,50 +100,27 @@ class FeishuController
|
||||
$state = explode("_", $param['state']);
|
||||
//$userId = $request->user['id'];
|
||||
$userId = $state[1];
|
||||
$user = FeishuUser::where('id', $userId)->first();
|
||||
$user = FeishuUser::create();
|
||||
// $user = FeishuUser::where('id', $userId)->first();
|
||||
// $user = FeishuUser::create();
|
||||
|
||||
//保存用户open_id
|
||||
$user->user_id = $userId;
|
||||
$user->sign = $state[0];
|
||||
$user->tenant_key = $rst['data']['tenant_key'];
|
||||
$user->open_id = $rst['data']['open_id'];
|
||||
$user->feishu_user_id = $rst['data']['user_id'];
|
||||
$user->union_id = $rst['data']['union_id'];
|
||||
$user->save();
|
||||
// //保存用户open_id
|
||||
// $user->user_id = $userId;
|
||||
// $user->sign = $state[0];
|
||||
// $user->tenant_key = $rst['data']['tenant_key'];
|
||||
// $user->open_id = $rst['data']['open_id'];
|
||||
// $user->feishu_user_id = $rst['data']['user_id'];
|
||||
// $user->union_id = $rst['data']['union_id'];
|
||||
// $user->save();
|
||||
|
||||
// var_dump($rst);
|
||||
// array(3) {
|
||||
// ["code"]=>
|
||||
// int(0)
|
||||
// ["data"]=>
|
||||
// array(11) {
|
||||
// ["avatar_big"]=>
|
||||
// string(168) "https://s1-imfile.feishucdn.com/static-resource/v1/v3_00ie_7cc82f38-0a89-43d4-8b2c-d90fc9d9176g~?image_size=640x640&cut_type=&quality=&format=image&sticker_format=.webp"
|
||||
// ["avatar_middle"]=>
|
||||
// string(168) "https://s1-imfile.feishucdn.com/static-resource/v1/v3_00ie_7cc82f38-0a89-43d4-8b2c-d90fc9d9176g~?image_size=240x240&cut_type=&quality=&format=image&sticker_format=.webp"
|
||||
// ["avatar_thumb"]=>
|
||||
// string(166) "https://s1-imfile.feishucdn.com/static-resource/v1/v3_00ie_7cc82f38-0a89-43d4-8b2c-d90fc9d9176g~?image_size=72x72&cut_type=&quality=&format=image&sticker_format=.webp"
|
||||
// ["avatar_url"]=>
|
||||
// string(166) "https://s1-imfile.feishucdn.com/static-resource/v1/v3_00ie_7cc82f38-0a89-43d4-8b2c-d90fc9d9176g~?image_size=72x72&cut_type=&quality=&format=image&sticker_format=.webp"
|
||||
// ["en_name"]=>
|
||||
// string(9) "李佳博"
|
||||
// ["mobile"]=>
|
||||
// string(14) "+8615738985690"
|
||||
// ["name"]=>
|
||||
// string(9) "李佳博"
|
||||
// ["open_id"]=>
|
||||
// string(35) "ou_37bb7cfc4311c858ea32461700fa1a43"
|
||||
// ["tenant_key"]=>
|
||||
// string(16) "14e7bc0fe5985740"
|
||||
// ["union_id"]=>
|
||||
// string(35) "on_a3fdbca48cd9477a140c7f2167a63691"
|
||||
// ["user_id"]=>
|
||||
// string(8) "481g947d"
|
||||
// }
|
||||
// ["msg"]=>
|
||||
// string(7) "success"
|
||||
// }
|
||||
$user = new FeishuUser();
|
||||
$user->firstOrCreate([
|
||||
'user_id' => $userId,
|
||||
'sign' => $state[0],
|
||||
'tenant_key' => $rst['data']['tenant_key'],
|
||||
'open_id' => $rst['data']['open_id'],
|
||||
'feishu_user_id' => $rst['data']['user_id'],
|
||||
'union_id' => $rst['data']['union_id']
|
||||
]);
|
||||
|
||||
// return json($rst);
|
||||
return Util::success($rst['data'], trans('success'));
|
||||
|
||||
Reference in New Issue
Block a user