Skip to content

Commit 8faada7

Browse files
authored
Merge pull request yascmf#7 from yascmf/develop
remove unnecessary package
2 parents c174595 + e95a709 commit 8faada7

File tree

4 files changed

+1
-145
lines changed

4 files changed

+1
-145
lines changed

app/Http/Controllers/API/HomeController.php

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -20,74 +20,6 @@ public function getIndex()
2020
return new JsonResponse($json, '404');
2121
}
2222

23-
/**
24-
* 身份证服务
25-
* 由内建的第三方composer包 `douyasi/identity-card` 提供
26-
*/
27-
public function getIdentityCard(Request $request)
28-
{
29-
$data = [
30-
'status' => 0,
31-
'result' => 'invaild identity-card number',
32-
];
33-
$pid = $request->input('pid');
34-
if ($pid) {
35-
$ID = app('Douyasi\IdentityCard\ID') ;
36-
$is_pass = $ID->validateIDCard($pid); //校验身份证证号是否合法
37-
if ($is_pass) {
38-
$area = $ID->getArea($pid); //获取身份证所在地信息 遵循GB/T 2260-2007中华人民共和国行政区划代码 标准
39-
$gender = $ID->getGender($pid); //获取性别 'f'表示女,'m'表示男,校验失败返回false
40-
$birthday = $ID->getBirth($pid); //获取出生日期,失败则返回false
41-
$data = [
42-
'status' => 1,
43-
'result' => compact('is_pass', 'area', 'gender', 'birthday'),
44-
];
45-
}
46-
}
47-
return new JsonResponse($data);
48-
}
49-
50-
51-
/**
52-
* IP归属地服务
53-
* 由第三方在线API (http://ip.taobao.com/) 提供
54-
*/
55-
public function getIP(Request $request)
56-
{
57-
$ip = $request->input('ip', $request->ip());
58-
$urlTaobao = 'http://ip.taobao.com/service/getIpInfo.php?ip='.$ip;
59-
$json = @file_get_contents($urlTaobao);
60-
if (isset($json) && $json) {
61-
$jsonDecode = json_decode($json);
62-
if ($jsonDecode->code == 0) {
63-
$data = [
64-
'status' => 1,
65-
'result' => [
66-
'ip' => $ip,
67-
'country' => $jsonDecode->data->country,
68-
'country_id' => $jsonDecode->data->country_id,
69-
'province' => $jsonDecode->data->region,
70-
'city' => $jsonDecode->data->city,
71-
'isp' => $jsonDecode->data->isp,
72-
],
73-
];
74-
} else {
75-
$data = [
76-
'status' => 0,
77-
'result' => 'invaild ip',
78-
];
79-
}
80-
return new JsonResponse($data);
81-
} else {
82-
$data = [
83-
'code' => 500,
84-
'error' => 'Internal Server Error',
85-
'error_description' => 'check your network and try later',
86-
];
87-
return new JsonResponse($data, 500);
88-
}
89-
}
90-
9123
/**
9224
* 汉字转拼音
9325
* 由内建的第三方composer包 `overtrue/laravel-pinyin` 提供

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"php": ">=5.5.9",
99
"laravel/framework": "5.2.*",
1010
"erusev/parsedown-extra": "0.7.0",
11-
"douyasi/identity-card": "~2.0",
1211
"overtrue/laravel-pinyin": "~3.0",
1312
"overtrue/laravel-socialite": "~1.0",
1413
"douyasi/laravel-editor-md": "dev-master"

composer.lock

Lines changed: 1 addition & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/permission.php

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)