Commit 2eba205a by 冷斌

fix bug

parent 502e0714
......@@ -52,7 +52,7 @@ class ProfitController extends HomebaseController
$this->display();
}
protected function getInfo()
public function info()
{
$uid=I("uid");
$token=I("token");
......@@ -89,12 +89,66 @@ class ProfitController extends HomebaseController
}
}
$data['certification'] = $certification;
return $data;
echo json_encode(array("ret"=>200,'data'=>$data,'msg'=>''));
die;
}
public function info()
public function authInfo()
{
$data = $this->getInfo();
$uid=I("uid");
$token=I("token");
if( !$uid || !$token || checkToken($uid,$token)==700 ){
echo json_encode(array("ret"=>0,'data'=>array(),'msg'=>'您的登陆状态失效,请重新登陆!'));
exit;
}
$data = [];
$identity = 0;
$auth = M('users_auth')->where("uid={$uid}")->find();
if (!empty($auth)) {
$identity = 3;
if ($auth['status'] == 0) {
$identity = 2;
}
if ($auth['status'] == 1) {
$identity = 1;
}
}
$data['identity'] = $identity;
$certification = 0;
$auth2=M('users_info_auth')->where("uid={$uid}")->find();
if (!empty($auth2)) {
$certification = 3;
if ($auth2['status'] == 0) {
$certification = 2;
}
if ($auth2['status'] == 1) {
$certification = 1;
}
}
$data['certification'] = $certification;
if (!$auth2) {
$auth2 = [
'account' => '',
'username' => '',
'front_view' => '',
'back_view' => '',
'handset_view' => '',
'name' => '',
'bank_name' => '',
'bank_card' => '',
'bank_province' => '',
'bank_city' => '',
'status' => 3,
'reason' => '',
'addtime' => '',
'uptime' => ''
];
}
$data = array_merge($data, $auth2);
echo json_encode(array("ret"=>200,'data'=>$data,'msg'=>''));
die;
}
......
......@@ -113,8 +113,7 @@
created: function() {
//加载触发函数
let _this = this;
let url = _this.url('/index.php?g=Appapi&m=Profit&a=info');
sessionStorage.removeItem("source");
let url = _this.url('/index.php?g=Appapi&m=Profit&a=authInfo');
$.ajax({
url:url,
dataType:"json",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment