| xqd
@@ -11,6 +11,8 @@ use GuzzleHttp\Client;
|
|
|
use Illuminate\Http\Request;
|
|
|
use App\Http\Controllers\Controller;
|
|
|
use Illuminate\Support\Facades\Log;
|
|
|
+use Illuminate\Support\Facades\Storage;
|
|
|
+use Intervention\Image\Facades\Image;
|
|
|
|
|
|
class ApiController extends Controller
|
|
|
{
|
| xqd
@@ -119,4 +121,16 @@ class ApiController extends Controller
|
|
|
|
|
|
return response()->json(['status' => 'success', 'info' => '打卡成功']);
|
|
|
}
|
|
|
+
|
|
|
+ public function getShareImageSize(Request $request)
|
|
|
+ {
|
|
|
+ $share_image = Setting::where('key', 'share_image')->first();
|
|
|
+ if(empty($share_image) || empty($share_image->value) || !Storage::disk('upload')->exists($share_image->value)) {
|
|
|
+ return response()->json(['status' => 'fail', 'info' => '没有分享图片的信息!']);
|
|
|
+ }
|
|
|
+
|
|
|
+ $image = Image::make(url($share_image->value));
|
|
|
+
|
|
|
+ return response()->json(['status' => 'success', 'width' => $image->width(), 'height' => $image->height()]);
|
|
|
+ }
|
|
|
}
|