优化ctms-api语法、修复已知BUG;

主要修复ctms-api、dacms对PHP新版本的支持问题
This commit is contained in:
2025-07-13 19:37:42 +08:00
parent 65bbd06981
commit 037f274ec5
413 changed files with 107271 additions and 72326 deletions
+70
View File
@@ -0,0 +1,70 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-13T09:20:03+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2024-08-09T09:19:04+08:00
# @Copyright: www.hiluker.cn
//主入口页
namespace api\controllers\gm\v1;
use Yii;
use yii\data\Pagination;
use vendor\huawei\obsclient\Hwobs;
use vendor\huawei\obsclient\TemporarySignature;
use vendor\huawei\obsclient\PostObject;
class ObsController extends Common
{
public function actionIndex()
{
$apis = [
'getkey' => '获取访问Key',
];
$this->result('您正使用CMTS系统-华为云OBS接口!', $apis, 200);
}
private function getconf()
{
return [
'id' => 'ee124c5102064b83bccd2fdda53261cc', //账号ID
'ak' => '1DYBXUNEPNCIEEQOGGAE',
'sk' => '0VBI2xPlDB0NtqqVJv3hSFC8DY52G8OYPYNhncGK',
'area' => 'cn-south-1', //华南广州
'endpoint' => 'obs.cn-south-1.myhuaweicloud.com',
'bucketName' => 'hilu-ctms',
];
}
public function actionGetkey()
{
$params = $this->getconf();
$obs = new Hwobs($ak = $params['ak'], $sk = $params['sk'], $endpoint = $params['endpoint'], $t1 = 30, $t2 = 10);
}
public function actionGeturl()
{
$params = $this->getconf();
$obs = new TemporarySignature($ak = $params['ak'], $sk = $params['sk'], $endpoint = $params['endpoint'], $t1 = 30, $t2 = 10);
$res = $obs->UploadUrl($params['bucketName']);
// $res = $obs->getCors($params['bucketName']);
var_dump($res);
// $this->result('获取上传网址成功!', $res, 200);
}
public function actionGetform()
{
$params = $this->getconf();
$obs = new PostObject($ak = $params['ak'], $sk = $params['sk'], $endpoint = $params['endpoint'], $t1 = 30, $t2 = 10);
$obs->init('obs');
$res = $obs->claimPost('hilu-ctms', 'file.jpg');
$url = 'https://' . $params['bucketName'] . "." . $params['endpoint'];
$res['up_url'] = $url;
$this->result('获取OBS上传准备信息!', $res, 200);
}
}