|
@@ -14,7 +14,7 @@ use app\common\library\Token;
|
|
|
*/
|
|
|
class Index extends Api
|
|
|
{
|
|
|
- protected $noNeedLogin = ['index','contactus','tcpTest','getAppShare','getWebsiteInfo','getUserCharmRankList','getPartyHotList','searchUsers','getInviteCode','getEdition','getInviteImg','getWebsiteInfoForMini','getBankList','getSwitch','getBootAnimation', 'tencentcall', 'getversion','getversionZx', 'getiosversion'];
|
|
|
+ protected $noNeedLogin = ['zhiyint_registration','index','contactus','tcpTest','getAppShare','getWebsiteInfo','getUserCharmRankList','getPartyHotList','searchUsers','getInviteCode','getEdition','getInviteImg','getWebsiteInfoForMini','getBankList','getSwitch','getBootAnimation', 'tencentcall', 'getversion','getversionZx', 'getiosversion'];
|
|
|
protected $noNeedRight = ['*'];
|
|
|
|
|
|
public function index(){
|
|
@@ -33,8 +33,53 @@ class Index extends Api
|
|
|
$tenim->outMemberFromRoom(4);
|
|
|
$this->success('请求成功');
|
|
|
}
|
|
|
+ protected function getRealIpAddr() {
|
|
|
+ if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
|
|
+ {
|
|
|
+ $ip=$_SERVER['HTTP_CLIENT_IP'];
|
|
|
+ }
|
|
|
+ elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
|
|
+ {
|
|
|
+ $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ $ip=$_SERVER['REMOTE_ADDR'];
|
|
|
+ }
|
|
|
+ return $ip;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ * 三方接口
|
|
|
+ *
|
|
|
+ */
|
|
|
+ public function zhiyint_registration()
|
|
|
+ {
|
|
|
+ $iparr = ["182.37.138.94","18.162.169.63","18.166.207.228","18.167.62.130","18.163.198.60","18.163.33.249","16.163.157.213", "43.198.99.226", "43.198.98.100", "18.163.210.144", "18.167.165.212", "18.166.28.150", "16.163.99.187", "18.163.210.126", "43.198.84.109", "18.163.182.173", "16.162.109.227", "16.162.87.8", "18.162.111.92", "18.166.214.252"];
|
|
|
+ $ip = $this->getRealIpAddr();
|
|
|
+ if(!in_array($ip,$iparr)) {
|
|
|
+ echo json_encode(['error' => "IP not found"]); exit;
|
|
|
+ }
|
|
|
+ $UserId = $this->request->request("UserId",'');
|
|
|
+ if($UserId)
|
|
|
+ {
|
|
|
+ $times = Db::name("user")->where("id",$UserId)->value("createtime");
|
|
|
+ if(!$times)
|
|
|
+ {
|
|
|
+ echo json_encode(['error' => "User ID not found"]);
|
|
|
+ }
|
|
|
+ $data = [
|
|
|
+ 'RegistrationTime' => date("Y-m-d H:i:s",$times)
|
|
|
+ ];
|
|
|
+ echo json_encode($data); exit;
|
|
|
+ }
|
|
|
+ $data = [
|
|
|
+ 'error' => "User ID not found"
|
|
|
+ ];
|
|
|
+ echo json_encode($data);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|