Userauth.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. <?php
  2. namespace app\api\controller;
  3. use app\common\controller\Api;
  4. use think\Db;
  5. use think\Cache;
  6. use TencentCloud\Common\Credential;
  7. use TencentCloud\Common\Profile\ClientProfile;
  8. use TencentCloud\Common\Profile\HttpProfile;
  9. use TencentCloud\Common\Exception\TencentCloudSDKException;
  10. //use TencentCloud\Faceid\V20180301\FaceidClient;
  11. //use TencentCloud\Faceid\V20180301\Models\IdCardVerificationRequest;
  12. use TencentCloud\Iai\V20200303\IaiClient;
  13. use TencentCloud\Iai\V20200303\Models\CompareFaceRequest;
  14. /**
  15. * 实名认证,真人认证相关
  16. */
  17. class Userauth extends Api
  18. {
  19. protected $noNeedLogin = [];
  20. protected $noNeedRight = '*';
  21. //实名认证信息
  22. public function idcard_info(){
  23. $check = Db::name('user_idconfirm')->where('user_id',$this->auth->id)->order('id desc')->find();
  24. $this->success('success',$check);
  25. }
  26. //申请实名认证
  27. public function apply_idcard_confirm(){
  28. $truename = input('truename','');
  29. $idcard = input('idcard' ,'');
  30. if(empty($truename) || empty($idcard)){
  31. $this->error('实名认证信息必填');
  32. }
  33. if($this->auth->idcard_status == 1){
  34. $this->error('您已经完成实名认证');
  35. }
  36. if($this->auth->idcard_status == 0){
  37. $this->error('您已经提交实名认证,请等待审核');
  38. }
  39. Db::startTrans();
  40. $check = Db::name('user_idconfirm')->where('user_id',$this->auth->id)->lock(true)->find();
  41. if(!empty($check)){
  42. if($check['status'] == 0){
  43. Db::rollback();
  44. $this->error('您已经提交实名认证,请等待审核');
  45. }
  46. if($check['status'] == 1){
  47. Db::rollback();
  48. $this->error('您已经完成实名认证');
  49. }
  50. }
  51. $count = Db::name('user_idconfirm')->where(['idcard' => $idcard, 'user_id' => ['neq', $this->auth->id]])->count('id');
  52. if ($count) {
  53. $this->error('该身份证号已被他人使用');
  54. }
  55. //限制每日请求次数
  56. $time = time();
  57. $today_end = strtotime(date('Y-m-d 23:59:59', $time));
  58. $cache_time = $today_end - $time; //缓存时间
  59. $time_count = Cache::get('fourauth' . $this->auth->id);
  60. if (!$time_count) {
  61. Cache::set('fourauth' . $this->auth->id, 1, $cache_time);
  62. } else {
  63. Cache::set('fourauth' . $this->auth->id, $time_count + 1, $cache_time);
  64. if ($time_count > 5) {
  65. $this->error('今日实名次数已到上限,明天再来吧');
  66. }
  67. }
  68. if($this->auth->gender == 0){
  69. //阿里云身份证二要素认证
  70. $auth_restult = $this->userauth_aliyun_two($idcard, $truename);
  71. if($auth_restult == false){
  72. $this->error('身份证信息与姓名不符');
  73. }
  74. }
  75. $data = [
  76. 'user_id' => $this->auth->id,
  77. 'truename' => $truename,
  78. 'idcard' => $idcard,
  79. 'status' => 1, //不需要人工刚审核了,直接过审
  80. 'createtime' => time(),
  81. 'updatetime' => time(),
  82. ];
  83. if($this->auth->gender == 1){
  84. $data['status'] = 0;//男性待审
  85. }
  86. //更新
  87. $update_rs = Db::name('user')->where('id',$this->auth->id)->update(['idcard_status'=>$data['status']]);
  88. if(!empty($check)){
  89. $rs = Db::name('user_idconfirm')->where('id',$check['id'])->update($data);
  90. }else{
  91. $rs = Db::name('user_idconfirm')->insertGetId($data);
  92. }
  93. if($this->auth->gender == 0){
  94. //task任务
  95. //实名认证
  96. $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,5);
  97. if($task_rs === false){
  98. Db::rollback();
  99. $this->error('完成任务失败');
  100. }
  101. //系统消息
  102. $msg_id = \app\common\model\Message::addMessage($this->auth->id,'实名认证','实名认证已经审核通过');
  103. }
  104. if(!$rs || !$update_rs){
  105. Db::rollback();
  106. $this->error('提交失败');
  107. }
  108. Db::commit();
  109. $this->success('认证通过');
  110. }
  111. //产品链接:https://market.aliyun.com/products/57000002/cmapi026109.html#sku=yuncode20109000025
  112. //阿里云-数脉api
  113. //姓名+身份证号
  114. private function userauth_aliyun_two($cardNo = '',$realname = ''){
  115. if(!$cardNo || !$realname){
  116. return false;
  117. }
  118. $config = config('aliyun_auth_shumai_two');
  119. $host = "https://eid.shumaidata.com";
  120. $path = "/eid/check";
  121. $method = "POST";
  122. $appcode = $config['app_code'];
  123. $headers = array();
  124. array_push($headers, "Authorization:APPCODE " . $appcode);
  125. $querys = "idcard=".$cardNo."&name=".urlencode($realname);
  126. $bodys = '';
  127. $url = $host . $path . "?" . $querys;
  128. $curl = curl_init();
  129. curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
  130. curl_setopt($curl, CURLOPT_URL, $url);
  131. curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
  132. curl_setopt($curl, CURLOPT_FAILONERROR, false);
  133. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  134. //设定返回信息中是否包含响应信息头,启用时会将头文件的信息作为数据流输出,true 表示输出信息头, false表示不输出信息头
  135. //如果需要将字符串转成json,请将 CURLOPT_HEADER 设置成 false
  136. curl_setopt($curl, CURLOPT_HEADER, false);
  137. if (1 == strpos("$".$host, "https://"))
  138. {
  139. curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  140. curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
  141. }
  142. $returnRes = curl_exec($curl);
  143. //var_dump($returnRes);
  144. curl_close($curl);
  145. $result = json_decode($returnRes,true);
  146. //dump($result);
  147. if(is_array($result) && isset($result['code']) && $result['code'] == 0){
  148. if(isset($result['result']) && isset($result['result']['res'])){
  149. if($result['result']['res'] == 1){
  150. //实名过了
  151. return true;
  152. }
  153. }
  154. }
  155. return false;
  156. }
  157. //产品链接:https://market.aliyun.com/products/57000002/cmapi026100.html?spm=5176.730005.result.8.1dbc123e8ArY19&innerSource=search#sku=yuncode2010000006
  158. //阿里云-数脉api
  159. //姓名+手机号+身份证号
  160. private function userauth_aliyun_three($cardNo = '',$realname = '',$mobile = ''){
  161. if(!$cardNo || !$realname || !$mobile){
  162. return false;
  163. }
  164. $config = config('aliyun_auth_shumai');
  165. $host = "https://mobile3elements.shumaidata.com";
  166. $path = "/mobile/verify_real_name";
  167. $method = "POST";
  168. $appcode = $config['app_code'];
  169. $headers = array();
  170. array_push($headers, "Authorization:APPCODE " . $appcode);
  171. //根据API的要求,定义相对应的Content-Type
  172. array_push($headers, "Content-Type".":"."application/x-www-form-urlencoded; charset=UTF-8");
  173. $querys = "";
  174. $bodys = "idcard=".$cardNo."&mobile=".$mobile."&name=".urlencode($realname);
  175. $url = $host . $path;
  176. $curl = curl_init();
  177. curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
  178. curl_setopt($curl, CURLOPT_URL, $url);
  179. curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
  180. curl_setopt($curl, CURLOPT_FAILONERROR, false);
  181. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  182. //设定返回信息中是否包含响应信息头,启用时会将头文件的信息作为数据流输出,true 表示输出信息头, false表示不输出信息头
  183. //如果需要将字符串转成json,请将 CURLOPT_HEADER 设置成 false
  184. curl_setopt($curl, CURLOPT_HEADER, false);
  185. if (1 == strpos("$".$host, "https://"))
  186. {
  187. curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  188. curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
  189. }
  190. curl_setopt($curl, CURLOPT_POSTFIELDS, $bodys);
  191. $returnRes = curl_exec($curl);
  192. curl_close($curl);
  193. $result = json_decode($returnRes,true);
  194. if(is_array($result) && isset($result['code']) && $result['code'] == 0){
  195. if(isset($result['result']) && isset($result['result']['res'])){
  196. if($result['result']['res'] == 1){
  197. //实名过了
  198. return true;
  199. }
  200. }
  201. }
  202. return false;
  203. }
  204. ///////////////////////////////////////////真人认证,来自知音////////////
  205. //申请真人认证
  206. public function realauth() {
  207. if ($this->auth->real_status == 1) {
  208. $this->error('您已经真人认证过了~');
  209. }
  210. if ($this->auth->avatar == config('avatar_boy') || $this->auth->avatar == config('avatar_girl')) {
  211. $this->error('请先上传真人头像~');
  212. }
  213. //获取token
  214. $token_url = 'https://miniprogram-kyc.tencentcloudapi.com/api/oauth2/access_token?app_id='.config('tencent_yun')['secret_id'].'&secret='.config('tencent_yun')['secret_key'].'&grant_type=client_credential&version=1.0.0';
  215. $token_result = file_get_contents($token_url);
  216. if (!$token_result) {
  217. $this->error('您的网络开小差啦1~');
  218. }
  219. $token_result = json_decode($token_result, true);
  220. if ($token_result['code'] != 0) {
  221. $this->error('您的网络开小差啦2~');
  222. }
  223. $token = $token_result['access_token'];
  224. //获取签名鉴权参数ticket
  225. $ticket_url = 'https://miniprogram-kyc.tencentcloudapi.com/api/oauth2/api_ticket?app_id='.config('tencent_yun')['secret_id'].'&access_token='.$token.'&type=SIGN&version=1.0.0';
  226. $ticket_result = file_get_contents($ticket_url);
  227. if (!$ticket_result) {
  228. $this->error('您的网络开小差啦3~');
  229. }
  230. $ticket_result = json_decode($ticket_result, true);
  231. if ($ticket_result['code'] != 0) {
  232. $this->error('您的网络开小差啦4~');
  233. }
  234. $ticket = $ticket_result['tickets'][0]['value'];
  235. //获取签名
  236. $sign_data = [
  237. 'wbappid' => config('tencent_yun')['secret_id'],
  238. 'userId' => (string)$this->auth->id,
  239. 'version' => '1.0.0',
  240. 'ticket' => $ticket,
  241. 'nonce' => Random::alnum(32)
  242. ];//p($sign_data);
  243. asort($sign_data); //p($sign_data);//排序
  244. $sign_string = join('', $sign_data);//p($sign_string);
  245. $sign = sha1($sign_string);//p($sign);
  246. //上传身份信息
  247. $orderNo = getMillisecond() . $this->auth->id . mt_rand(1, 1000); //商户请求的唯一标识
  248. $url = 'https://miniprogram-kyc.tencentcloudapi.com/api/server/getAdvFaceId?orderNo=' . $orderNo;
  249. $avatar = one_domain_image($this->auth->avatar);
  250. $avatar = str_replace('https', 'http', $avatar);
  251. $img = file_get_contents($avatar);
  252. $img = str_replace('data:image/jpg;base64', '', $img);
  253. $img = str_replace('\n', '', $img);
  254. $sourcePhotoStr = base64_encode($img);
  255. $data = [
  256. 'webankAppId' => config('tencent_yun')['secret_id'],
  257. 'orderNo' => $orderNo,
  258. 'userId' => (string)$this->auth->id,
  259. 'sourcePhotoStr' => $sourcePhotoStr,
  260. 'sourcePhotoType' => 2,
  261. 'version' => '1.0.0',
  262. 'sign' => $sign,
  263. 'nonce' => $sign_data['nonce']
  264. ];
  265. $rs = curl_post($url,json_encode($data, 320), ['Content-Type: application/json']);
  266. if (!$rs) {
  267. $this->error('您的网络开小差啦5~');
  268. }
  269. $rs = json_decode($rs, true);
  270. if (!$rs || $rs['code'] != 0) {
  271. $this->error('您的网络开小差啦6~');
  272. }
  273. $user_auth = [
  274. 'user_id' => $this->auth->id,
  275. 'certify_id' => $rs['result']['faceId'],
  276. 'out_trade_no' => $data['orderNo'],
  277. 'status' => 0,
  278. 'createtime' => time(),
  279. 'updatetime' => time()
  280. ];
  281. //开启事务
  282. Db::startTrans();
  283. //查询是否认证过
  284. $info = Db::name('user_auth')->where(['user_id' => $this->auth->id])->find();
  285. if ($info) {
  286. $auth_rs = Db::name('user_auth')->where(['id' => $info['id']])->setField($user_auth);
  287. } else {
  288. $auth_rs = Db::name('user_auth')->insertGetId($user_auth);
  289. }
  290. if (!$auth_rs) {
  291. Db::rollback();
  292. $this->error('您的网络开小差啦7~');
  293. }
  294. //修改用户表认证状态
  295. $user_rs = Db::name('user')->where(['id' => $this->auth->id])->setField('real_status', 0);
  296. if ($user_rs === false) {
  297. Db::rollback();
  298. $this->error('您的网络开小差啦8~');
  299. }
  300. Db::commit();
  301. $return_data = [
  302. 'face_id' => $user_auth['certify_id'],
  303. 'order_no' => $user_auth['out_trade_no'],
  304. 'user_id' => (string)$this->auth->id,
  305. 'nonce' => $sign_data['nonce'],
  306. 'sign' => $sign
  307. ];
  308. $this->success('success', $return_data);
  309. }
  310. //查询真人认证结果
  311. public function getrealauthresult() {
  312. $user_auth = Db::name('user_auth')->where(['user_id' => $this->auth->id])->find();
  313. if (!$user_auth) {
  314. $this->success('尚未认证');
  315. }
  316. if ($user_auth['status'] == 1) {
  317. $this->success('真人认证通过');
  318. }
  319. if (!$user_auth['certify_id']) {
  320. $this->success('请先进行真人认证');
  321. }
  322. //获取token
  323. $token_url = 'https://miniprogram-kyc.tencentcloudapi.com/api/oauth2/access_token?app_id='.config('tencent_yun')['secret_id'].'&secret='.config('tencent_yun')['secret_key'].'&grant_type=client_credential&version=1.0.0';
  324. $token_result = file_get_contents($token_url);
  325. if (!$token_result) {
  326. $this->error('您的网络开小差啦1~');
  327. }
  328. $token_result = json_decode($token_result, true);
  329. if ($token_result['code'] != 0) {
  330. $this->error('您的网络开小差啦2~');
  331. }
  332. $token = $token_result['access_token'];
  333. //获取签名鉴权参数ticket
  334. $ticket_url = 'https://miniprogram-kyc.tencentcloudapi.com/api/oauth2/api_ticket?app_id='.config('tencent_yun')['secret_id'].'&access_token='.$token.'&type=SIGN&version=1.0.0';
  335. $ticket_result = file_get_contents($ticket_url);
  336. if (!$ticket_result) {
  337. $this->error('您的网络开小差啦3~');
  338. }
  339. $ticket_result = json_decode($ticket_result, true);
  340. if ($ticket_result['code'] != 0) {
  341. $this->error('您的网络开小差啦4~');
  342. }
  343. $ticket = $ticket_result['tickets'][0]['value'];
  344. //获取签名
  345. $sign_data = [
  346. 'wbappid' => config('tencent_yun')['secret_id'],
  347. 'orderNo' => $user_auth['out_trade_no'],
  348. 'version' => '1.0.0',
  349. 'ticket' => $ticket,
  350. 'nonce' => Random::alnum(32)
  351. ];//p($sign_data);
  352. asort($sign_data); //p($sign_data);//排序
  353. $sign_string = join('', $sign_data);//p($sign_string);
  354. $sign = sha1($sign_string);//p($sign);
  355. //人脸核身结果查询
  356. $url = 'https://miniprogram-kyc.tencentcloudapi.com/api/v2/base/queryfacerecord?orderNo=' . $user_auth['out_trade_no'];
  357. $data = [
  358. 'appId' => config('tencent_yun')['secret_id'],
  359. 'version' => '1.0.0',
  360. 'nonce' => $sign_data['nonce'],
  361. 'orderNo' => $user_auth['out_trade_no'],
  362. 'sign' => $sign
  363. ];
  364. $rs = curl_post($url,json_encode($data, 320), ['Content-Type: application/json']);
  365. if (!$rs) {
  366. $this->error('您的网络开小差啦5~');
  367. }
  368. $rs = json_decode($rs, true);
  369. if (!$rs || $rs['code'] != 0) {
  370. $this->error($rs['msg']);
  371. }
  372. if ($rs['result']['liveRate'] >= 90 && $rs['result']['similarity'] >= 90) {
  373. $edit_data['status'] = 1;
  374. $msg = '真人认证成功';
  375. } else {
  376. $edit_data['status'] = 2;
  377. $edit_data['certify_id'] = '';
  378. $edit_data['out_trade_no'] = '';
  379. $msg = '真人认证失败';
  380. }
  381. $edit_data['updatetime'] = time();
  382. //开启事务
  383. Db::startTrans();
  384. //修改认证信息
  385. $result = Db::name('user_auth')->where(['user_id' => $this->auth->id, 'status' => $user_auth['status']])->setField($edit_data);
  386. if (!$result) {
  387. Db::rollback();
  388. $this->error('查询认证结果失败2');
  389. }
  390. //修改用户信息
  391. $rs = Db::name('user')->where(['id' => $this->auth->id])->setField('real_status', $edit_data['status']);
  392. if (!$rs) {
  393. Db::rollback();
  394. $this->error('查询认证结果失败3');
  395. }
  396. if ($edit_data['status'] == 1) { //通过
  397. //tag任务赠送金币
  398. //真人认证奖励
  399. $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,6);
  400. if($task_rs === false){
  401. Db::rollback();
  402. $this->error('完成任务赠送奖励失败');
  403. }
  404. //系统消息
  405. $msg_id = \app\common\model\Message::addMessage($this->auth->id,'真人认证','真人认证已经审核通过');
  406. } else {
  407. //系统消息
  408. $msg_id = \app\common\model\Message::addMessage($this->auth->id,'真人认证','真人认证审核不通过');
  409. }
  410. Db::commit();
  411. $this->success($msg);
  412. }
  413. //真人认证后修改头像
  414. public function editrealavatar() {
  415. if ($this->auth->real_status != 1) {
  416. $this->error('尚未通过真人认证');
  417. }
  418. $avatar = input('avatar', '', 'trim'); //头像地址
  419. if ($avatar === '') {
  420. $this->error('参数缺失');
  421. }
  422. $avatar = one_domain_image($avatar);
  423. $now_avatar = one_domain_image($this->auth->avatar);
  424. if ($avatar == $now_avatar) {
  425. $this->error('头像未改变');
  426. }
  427. //腾讯云人脸识别
  428. $auit_result = $this->face_tencent($now_avatar, $avatar); //1通过 0拒绝
  429. if ($auit_result != 1) {
  430. $this->success('提示', ['code' => 2]);
  431. }
  432. $data['avatar'] = $avatar;
  433. $user_result = Db::name('user')->where(['id' => $this->auth->id])->setField($data);
  434. if (!$user_result) {
  435. $this->error('修改失败');
  436. }
  437. $this->success('修改成功');
  438. }
  439. //真人认证后修改头像并取消真人认证
  440. public function editrealavatarcancelauit() {
  441. if ($this->auth->real_status != 1) {
  442. $this->error('尚未通过真人认证');
  443. }
  444. $avatar = input('avatar', '', 'trim'); //头像地址
  445. if ($avatar === '') {
  446. $this->error('参数缺失');
  447. }
  448. $avatar = one_domain_image($avatar);
  449. $now_avatar = one_domain_image($this->auth->avatar);
  450. if ($avatar == $now_avatar) {
  451. $this->error('头像未改变');
  452. }
  453. $data['avatar'] = $avatar;
  454. $data['real_status'] = -1;
  455. //开启事务
  456. Db::startTrans();
  457. $user_result = Db::name('user')->where(['id' => $this->auth->id])->setField($data);
  458. if (!$user_result) {
  459. Db::rollback();
  460. $this->error('修改失败');
  461. }
  462. $user_auth_result = Db::name('user_auth')->where(['user_id' => $this->auth->id])->delete();
  463. if (!$user_auth_result) {
  464. Db::rollback();
  465. $this->error('修改失败');
  466. }
  467. Db::commit();
  468. $this->success('修改成功');
  469. }
  470. //腾讯云人脸识别
  471. public function face_tencent($urla = '', $urlb = '') {
  472. // require_once 'vendor/autoload.php';
  473. try {
  474. // 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey,此处还需注意密钥对的保密
  475. // 密钥可前往https://console.cloud.tencent.com/cam/capi网站进行获取
  476. $config = config('tencent_realauth');
  477. $cred = new Credential($config['SecretId'], $config['SecretKey']);
  478. // 实例化一个http选项,可选的,没有特殊需求可以跳过
  479. $httpProfile = new HttpProfile();
  480. $httpProfile->setEndpoint("iai.tencentcloudapi.com");
  481. // 实例化一个client选项,可选的,没有特殊需求可以跳过
  482. $clientProfile = new ClientProfile();
  483. $clientProfile->setHttpProfile($httpProfile);
  484. // 实例化要请求产品的client对象,clientProfile是可选的
  485. $client = new IaiClient($cred, "ap-beijing", $clientProfile);
  486. // 实例化一个请求对象,每个接口都会对应一个request对象
  487. $req = new CompareFaceRequest();
  488. $params = array(
  489. "UrlA" => $urla,
  490. "UrlB" => $urlb,
  491. "FaceModelVersion" => "3.0"
  492. );
  493. $req->fromJsonString(json_encode($params));
  494. // 返回的resp是一个CompareFaceResponse的实例,与请求对象对应
  495. $resp = $client->CompareFace($req);
  496. // 输出json格式的字符串回包
  497. // print_r($resp->toJsonString());
  498. $result = json_decode($resp->toJsonString(), true);
  499. //3.0版本误识率千分之一对应分数为40分,误识率万分之一对应分数为50分,误识率十万分之一对应分数为60分。 一般超过50分则可认定为同一人。
  500. if (isset($result['Score']) && $result['Score'] >= 60) {
  501. return 1; //通过
  502. } else {
  503. return 0;
  504. }
  505. }
  506. catch(TencentCloudSDKException $e) {
  507. // echo $e;
  508. return 0;
  509. }
  510. }
  511. }