Commit 84dcbc37 authored by huanle's avatar huanle

0526 ddapi

parent 4da9e981
...@@ -26,11 +26,12 @@ class Index extends Controller ...@@ -26,11 +26,12 @@ class Index extends Controller
$jsapi_ticket= $Ding->config('jsapi_ticket',$ticket); $jsapi_ticket= $Ding->config('jsapi_ticket',$ticket);
$config=$Ding->ddconfig(); $config=$Ding->ddconfig();
if($config){ // if($config){
$data['config']=$config; // $data['config']=$config;
$data['status']=200; // $data['status']=200;
} // }
return json($data); return json(code([$config], 0, 'ok'));
//return json($data);
} }
public function getSsoToken(){ public function getSsoToken(){
...@@ -41,15 +42,15 @@ class Index extends Controller ...@@ -41,15 +42,15 @@ class Index extends Controller
$User =new Dingtalk\User(); $User =new Dingtalk\User();
$userid =$User->code($code); $userid =$User->code($code);
if($userid===false){ if($userid===false){
$data['status']=100000; $data['status']=-10001;
$data['errmsg']='登录失败'; $data['errmsg']='登录失败';
}else{ }else{
$data['status']=0; $data['status']=0;
$data['errmsg']='登录成功'; $data['errmsg']='登录成功';
$data['userid']=$userid; $data['userid']=$userid;
} }
return json($data); // return json($data);
return json(code([$data], 0, 'ok'));
// var_dump($_SESSION); // var_dump($_SESSION);
} }
} }
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