作者 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',['characters'=>'text/这是水印'],false);
331 } 331 }
332 } 332 }
@@ -171,7 +171,7 @@ class CosService @@ -171,7 +171,7 @@ class CosService
171 public function addFieldImage($cdnUrl = '',$data = [],$is_image = true){ 171 public function addFieldImage($cdnUrl = '',$data = [],$is_image = true){
172 if($is_image){ 172 if($is_image){
173 $param = [ 173 $param = [
174 - $data['characters'] ?? 'image/'.urlencode(base64_encode("{$data['image']}")),//文字水印名称 174 + $data['image'] ?? 'image/'.urlencode(base64_encode("{$data['image']}")),//文字水印名称
175 $data['position'] ?? 'gravity/SouthEast', 175 $data['position'] ?? 'gravity/SouthEast',
176 $data['dx'] ?? 'dx/10/dy/10', 176 $data['dx'] ?? 'dx/10/dy/10',
177 $data['font'] ?? 'font/5bCP6aOe',//默认宋体 177 $data['font'] ?? 'font/5bCP6aOe',//默认宋体