checkToken(); if ($token[ 'code' ] < 0) return $this->response($token); $upload_model = new UploadModel($this->site_id); $param = [ 'thumb_type' => '', 'name' => 'file', 'watermark' => 0, 'cloud' => 1 ]; $result = $upload_model->setPath('headimg/' . date('Ymd') . '/')->image($param); return $this->response($result); } /** * 退款图片 */ public function refundimg() { $token = $this->checkToken(); if ($token[ 'code' ] < 0) return $this->response($token); $upload_model = new UploadModel($this->site_id); $param = [ 'thumb_type' => '', 'name' => 'file', 'watermark' => 0, 'cloud' => 1 ]; $result = $upload_model->setPath('refundimg/' . date('Ymd') . '/')->image($param); return $this->response($result); } /** * 评价上传 */ public function evaluateimg() { $token = $this->checkToken(); if ($token[ 'code' ] < 0 ) return $this->response($token); $upload_model = new UploadModel($this->site_id); $param = [ 'thumb_type' => '', 'name' => 'file', 'watermark' => 0, 'cloud' => 1 ]; $result = $upload_model->setPath('evaluate_img/' . date('Ymd') . '/')->image($param); return $this->response($result); } public function headimgBase64() { $sign = $this->checkSign(); if ( $this->checkToken()['code'] < 0 && $sign[ 'code' ] < 0) return $this->response($sign); $upload_model = new UploadModel($this->site_id); $file = input('images', ''); $file = base64_to_blob($file); $result = $upload_model->setPath('headimg/' . date('Ymd') . '/')->binaryImage($file[ 'blob' ]); return $this->response($result); } public function headimgPull() { $sign = $this->checkSign(); if ( $this->checkToken()['code'] < 0 && $sign[ 'code' ] < 0) return $this->response($sign); $upload_model = new UploadModel($this->site_id); $path = input('path', ''); $result = $upload_model->setPath('headimg/' . date('Ymd') . '/')->remotePull($path); return $this->response($result); } /** * 聊天图片上传 */ public function chatimg() { $token = $this->checkToken(); if ($token[ 'code' ] < 0) return $this->response($token); $upload_model = new UploadModel(0); $param = [ 'thumb_type' => '', 'name' => 'file' ]; $result = $upload_model->setPath('chat_img/' . date('Ymd') . '/')->image($param); return $this->response($result); } }