<?php // 应用公共文件 //响应 if(!function_exists('responses')){ function responses($code,$msg,$data) { return json([ 'code'=>$code, 'msg'=>$msg, 'data'=>$data ]); } } //成功 if(!function_exists('success')){ function success($data,$code=200,$msg='') { return responses($code,$msg,$data); } } //失败 if(!function_exists('fail')){ function fail($msg='',$code=500,$data=[]) { return responses($code,$msg,$data); } }
封装公共成功失败
最新推荐文章于 2024-09-14 16:43:29 发布