qingchen

qingchen

这家伙有点懒,还没写个性签名!

  • 财富值4270
  • 威望值60
  • 总积分5220

个人信息

  • 2018-05-08 已签到
    连续签到7天,获得了20个金钱
  • 2018-05-07 已签到
    连续签到6天,获得了20个金钱
  • 2018-05-06 已签到
    连续签到5天,获得了20个金钱
  • 2018-05-05 已签到
    连续签到4天,获得了20个金钱
  • 回复了 的回答

    “返回json时用 return $this->asjason([...])有时会报错”
    具体报的什么错,是不是 不方便说?

    asJson内存溢出
    name PHP Fatal Error
    message Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes)
    code 1
    type yii\base\ErrorException
    file /www/wwwroot/test02/vendor/yiisoft/yii2/helpers/BaseJson.php
    line 163

    正常应返回
    {"state":"SUCCESS","url":"/uploads/images/201805/1525434256593896.jpg","title":"1525434256593896.jpg","original":"avatar.jpg","type":".jpg","size":17079}

  • 2018-05-04 已签到
    连续签到3天,获得了15个金钱
  • 控制器中$this->run($route, $params = []) 可以调用另一个action
    例:ueditor插件中

    `public function actionIndex() {

        $request = Yii::$app->getRequest();
        $method = $request->get('action');
        $callback = $request->get('callback');
        if (in_array($method, ['config', 'uploadimage', 'uploadscrawl', 'uploadvideo', 'uploadfile', 'listimage', 'listfile', 'catchimage'])) {
            return $this->run($method);
        }
        return $this->show(['state' => '请求地址出错']);
    }
    
    public function actionUploadimage() {
        $setting = $this->config();
        $config = [
          "pathFormat" => $setting['imagePathFormat'],
          "maxSize" => $setting['imageMaxSize'],
          "allowFiles" => $setting['imageAllowFiles']
        ];
        $res = $this->_upload($setting['imageFieldName'], $config, 'upload');
        return $this->show($res);
    }
    

    `

  • 2018-05-03 已签到
    连续签到2天,获得了10个金钱
  • 2018-05-02 已签到
    连续签到1天,获得了5个金钱
副总裁 等级规则
5220/10000
资料完整度
20/100
用户活跃度
0/100

Ta的关注

0

Ta的粉丝

5

Ta的访客

20