zoukankan      html  css  js  c++  java
  • lumen 开启调试模式,关闭debug输出,只保留数据验证提示

    我们在使用lumen验证数据输出时,往往会有debug详细错误输出,在正式模式中我们是不需要的,哪我们怎么关闭呢,很简单

    修改文件:vendordingoapisrcExceptionHandler.php

    带debug模式的输出
     //  return new Response(array("code"=>1,"data"=>$response["message"],"debug"=>$response["debug"]), $this->getStatusCode($exception), $this->getHeaders($exception));
    只有错误码和提示的输出
      return new Response(array("code"=>1,"data"=>$this->unicodeDecode($response["message"])), $this->getStatusCode($exception), $this->getHeaders($exception));
    }
    /*将unicodel转为中文*/
    private function unicodeDecode($unicode_str){
    $json = '{"str":"'.$unicode_str.'"}';
    $arr = json_decode($json,true);
    if(empty($arr)) return '';
    return $arr['str'];
    }
    
    
  • 相关阅读:
    22-Camping野营-露营
    node留言板
    js中const,var,let区别
    app消息推送
    Vue + Mui
    七牛云图片存储---Java
    springboot---发送邮件
    SSM简易版
    Hibernate---快速入门
    Vue---mock.js 使用
  • 原文地址:https://www.cnblogs.com/fogwang/p/11337264.html
Copyright © 2011-2022 走看看