|
|
@@ -19,9 +19,7 @@ class UploadController extends BaseController
|
|
|
{
|
|
|
header('Content-type:text/html;charset=utf-8');
|
|
|
$base64 = file_get_contents('php://input');
|
|
|
- Yii::info('base64:'.$base64);
|
|
|
$base64_image_content = str_replace("content=", "", urldecode($base64));
|
|
|
- Yii::info($base64_image_content);
|
|
|
//匹配出图片的格式
|
|
|
if (preg_match('/^(data:\s*image\/(\w+);base64,)/', $base64_image_content, $result)) {
|
|
|
$type = $result[2];
|
|
|
@@ -40,7 +38,10 @@ class UploadController extends BaseController
|
|
|
util::fail('上传失败!!');
|
|
|
}
|
|
|
$img = "/uploads/{$merchantId}/{$month}/{$date}/" . $newFile;
|
|
|
-
|
|
|
+
|
|
|
+ $r = getimagesize($fullPath);
|
|
|
+ dd($r);
|
|
|
+
|
|
|
$new = $path.$preFileName.'_small.'.$type;
|
|
|
//压缩
|
|
|
Image::thumbnail($fullPath, 167, 111)->save($new, ['quality' => 100]);
|