OA获取信息修改

master
Your Name 5 years ago
parent 9e9d742275
commit 94480951cb

@ -23,6 +23,9 @@ return array(
'DATA_CACHE_PREFIX' => 'onethink_', // 缓存前缀 'DATA_CACHE_PREFIX' => 'onethink_', // 缓存前缀
'DATA_CACHE_TYPE' => 'File', // 数据缓存类型 'DATA_CACHE_TYPE' => 'File', // 数据缓存类型
/*获取信息加密KEY*/
'GET_INFO_KEY' => 'wmkjtx_kj213',
/* 文件上传相关配置 */ /* 文件上传相关配置 */
'DOWNLOAD_UPLOAD' => array( 'DOWNLOAD_UPLOAD' => array(
'mimes' => '', //允许上传的文件MiMe类型 'mimes' => '', //允许上传的文件MiMe类型

@ -5,11 +5,11 @@
* Date: 2019/8/5 * Date: 2019/8/5
* Time: 16:04 * Time: 16:04
*/ */
namespace SDK\Controller; namespace Sdk\Controller;
use Think\Controller; use Think\Controller;
use Think\Log; use Think\Log;
class FengHuoApiController extends Controller{ class FengHuoApiController extends GetInfoBaseController{
// protected function _initialize(){ // protected function _initialize(){
// // 制定允许其他域名访问 // // 制定允许其他域名访问
// header("Access-Control-Allow-Origin:*"); // header("Access-Control-Allow-Origin:*");
@ -76,7 +76,7 @@ class FengHuoApiController extends Controller{
// 默认排序id降序 // 默认排序id降序
$order = 'register_time asc'; $order = 'register_time asc';
$data = M('user','tab_') $data = M('user','tab_')
->field('id,account,promote_account,register_ip,register_time,device_type,device_number') ->field('id,account,promote_account,register_ip,register_time,device_type,device_number','fgame_name')
->where($where) ->where($where)
->order($order) ->order($order)
->page($page, $row) ->page($page, $row)
@ -87,6 +87,15 @@ class FengHuoApiController extends Controller{
$data[$k]['device_type'] = 'Android'; $data[$k]['device_type'] = 'Android';
}elseif($bindType == 2) { }elseif($bindType == 2) {
$data[$k]['device_type'] = 'IOS'; $data[$k]['device_type'] = 'IOS';
}else{
if(!empty($v['fgame_name'])){
$gameServer = substr($v['fgame_name'], -10, 9);
if($gameServer == '安卓版'){
$data[$k]['device_type'] = 'Android';
} elseif($gameServer == '苹果版') {
$data[$k]['device_type'] = 'Android';
}
}
} }
} }
@ -104,7 +113,6 @@ class FengHuoApiController extends Controller{
'Data' => 'null' 'Data' => 'null'
]; ];
} }
Log::write('registerDetail:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($result), 'INFO'); Log::write('registerDetail:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($result), 'INFO');
return $this->ajaxReturn($result); return $this->ajaxReturn($result);

@ -0,0 +1,39 @@
<?php
namespace Sdk\Controller;
use Think\Controller;
class GetInfoBaseController extends Controller
{
public function _initialize()
{
$data = I('param.');
if (empty($data['time_stamp']) || time() - 60 * 10 > $data['time_stamp']) {
$result = [
'ResultCode' => 2002,
'ResultMessage' => "链接已过期",
'Data' => 'null',
];
return $this->ajaxReturn($result);
} else {
$sign = $data['sign'];
unset($data['sign']);
ksort($data);
reset($data);
$str = "";
foreach ($data as $k => $v) {
$str = $str . $k . "=" . $v;
}
$str = $str . 'key=' . C('GET_INFO_KEY');
if (md5($str) != $sign) {
$result = [
'ResultCode' => 2001,
'ResultMessage' => "参数错误",
'Data' => 'null',
];
return $this->ajaxReturn($result);
}
}
}
}

@ -5,10 +5,10 @@
* Date: 2016/11/4 * Date: 2016/11/4
* Time: 16:04 * Time: 16:04
*/ */
namespace SDK\Controller; namespace Sdk\Controller;
use Think\Controller; use Think\Controller;
class OAController extends Controller{ class OAController extends GetInfoBaseController{
/** /**
* 游戏列表接口 * 游戏列表接口

Loading…
Cancel
Save