作者 lyh

gx脚本demo

@@ -327,6 +327,6 @@ class LoginController extends BaseController @@ -327,6 +327,6 @@ class LoginController extends BaseController
327 327
328 public function ceshi(){ 328 public function ceshi(){
329 $cos = new CosService(); 329 $cos = new CosService();
330 - return $cos->addFieldImage('https://ecdn6.globalso.com/upload/p/2000/image_product/2024-07/aero-y50-introduction-3.jpg',['characters'=>'这是水印'],false); 330 + return $cos->addFieldImage('https://ecdn6.globalso.com/upload/p/2000/image_product/2024-07/aero-y50-introduction-3.jpg',['image'=>'https://ecdn6.globalso.com/upload/p/2000/image_product/2024-07/aero-y50-introduction-3.jpg'],true);
331 } 331 }
332 } 332 }
@@ -183,10 +183,10 @@ class CosService @@ -183,10 +183,10 @@ class CosService
183 $param = [ 183 $param = [
184 'text/'.urlencode(base64_encode("{$data['characters']}")),//文字水印名称 184 'text/'.urlencode(base64_encode("{$data['characters']}")),//文字水印名称
185 $data['position'] ?? 'gravity/SouthEast', 185 $data['position'] ?? 'gravity/SouthEast',
186 -// $data['dx'] ?? 'dx/10/dy/10',  
187 -// $data['font'] ?? 'font/5bCP6aOe',//默认宋体  
188 -// $data['fontsize'] ?? 'fontsize/24',//大小  
189 -// $data['fill'] ?? 'fill/I0ZGRkZGRg==',//颜色 186 + $data['dx'] ?? 'dx/10/dy/10',
  187 + $data['font'] ?? 'font/5bCP6aOe',//默认宋体
  188 + $data['fontsize'] ?? 'fontsize/24',//大小
  189 + $data['fill'] ?? 'fill/I0ZGRkZGRg==',//颜色
190 ]; 190 ];
191 $cdnUrl = $cdnUrl.'?imageMogr2/watermark/3/'.implode('/',$param); 191 $cdnUrl = $cdnUrl.'?imageMogr2/watermark/3/'.implode('/',$param);
192 } 192 }