| 12345678910111213141516171819202122232425 |
- <?php
- // +----------------------------------------------------------------------
- // | ThinkPHP [ WE CAN DO IT JUST THINK ]
- // +----------------------------------------------------------------------
- // | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
- // +----------------------------------------------------------------------
- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
- // +----------------------------------------------------------------------
- // | Author: 流年 <liu21st@gmail.com>
- // +----------------------------------------------------------------------
- // 应用公共文件
- function resultArray($array)
- {
- if(isset($array['data'])) {
- return json(['code'=>'00','user'=>$array['data']['nickname'],"authKey"=>$array['data']['authKey'],'is_reg'=>1,'msg'=>'登录成功']);
- } elseif (isset($array['error'])) {
- return json(['code'=>'01','msg'=>$array['error']]);
- }
- }
|