1 Star 0 Fork 6

larkdoc/adam_qiniu

forked from szwldev/adam_qiniu 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
setting.php 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
szwldev 提交于 2019-03-26 11:37 +08:00 . 保存sk cdnurl 出错问题修复
<?php
!defined('DEBUG') AND exit('Access Denied.');
if ($method == 'GET'){
$config = include(APP_PATH.'plugin/adam_qiniu/config.php');
include _include(APP_PATH.'plugin/adam_qiniu/setting.htm');
}elseif ($method == 'POST'){
$post_data = $_POST;
if (empty($post_data['accessKey'])) message(-1, 'AK必填!');
if (empty($post_data['secretKey'])) message(-1, 'SK必填!');
if (empty($post_data['bucket'])) message(-1, 'bucket必填!');
if (empty($post_data['cdnurl'])) message(-1, '域名必填!');
$file = fopen(APP_PATH."plugin/adam_qiniu/config.php", "w");
$config_data = "<?php
return array(
'accessKey' => '{$post_data['accessKey']}',
'secretKey' => '{$post_data['secretKey']}',
'bucket' => '{$post_data['bucket']}',
'cdnurl' => '{$post_data['cdnurl']}',
);";
try{
$res = fwrite($file, $config_data);
fclose($file);
if ($res){
message(1, '保存成功');
}else{
message(-1, '保存失败');
}
}catch (Exception $e){
message(-1, $e->getMessage());
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/lackdoc/adam_qiniu.git
git@gitee.com:lackdoc/adam_qiniu.git
lackdoc
adam_qiniu
adam_qiniu
master

搜索帮助