作者 lyh

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6

... ... @@ -17,7 +17,14 @@ class Translate
{
//接口地址
// public static $url = 'https://translate.hbb618.cn/translates';
public static $url = 'https://api.cmer.com/translates';
public static $url = 'https://api.cmer.com/';
public static $header = array(
'accept: application/json',
'Content-Type: application/json',
'apikey: UkzZljFv83Z2qBi5YR1o3f2otAVWtug6',
'X-CmerApi-Host:ai_translate.p.cmer.com'
);
public static $tls_list = [
'en' => [
... ... @@ -734,7 +741,7 @@ class Translate
'sl' => 'auto',
'tls' => $tls,
];
return Http::post(self::$url.$action, $data);
return http_post(self::$url.$action, json_encode($data),self::$header);
}
/**
... ... @@ -749,11 +756,8 @@ class Translate
if (!$texts) {
return '';
}
$retsult = self::translate($texts, $tls)->json();
return $retsult[0]['texts'] ?? '';
$result = self::translate($texts, $tls);
return $result[0]['texts'] ?? '';
}
/**
* 翻译带源语种
... ... @@ -772,7 +776,7 @@ class Translate
'sl' => 'auto',
'tl' => $tl,
];
return Http::post(self::$url . $action, $data);
return http_post(self::$url.$action, json_encode($data),self::$header);
}
}
... ...
... ... @@ -197,7 +197,9 @@ class ProductLogic extends BaseLogic
* @time :2023/7/29 15:03
*/
public function setCopyProduct(){
$info = $this->model->read(['id'=>$this->param['id']]);
$info = Product::withoutCasts()->find($this->param['id']);
var_dump($info);
die();
$param = $this->setProductParams($info);
$save_id = $this->model->insertGetId($param);
$route = RouteMap::setRoute($param['route'], RouteMap::SOURCE_PRODUCT, $save_id, $this->user['project_id']);
... ...