edit-api-wxqrcode

This commit is contained in:
lccsw
2023-02-08 17:16:05 +08:00
parent 635eb315fc
commit 2c1528fc7c
3 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -364,7 +364,7 @@ class Home extends Wxapp
if (!$ret) {
throw new Hd_Exception('生成失败,稍后重试', API_CODE_FAIL);
}
$data = array('url' => $ret['url']);
$data = array('url' => $ret['url'].'?v=1');
return $data;
}
+8
View File
@@ -142,7 +142,15 @@ class Hdwechat
}
$CI = &get_instance();
$CI->load->library('qiniu');
$info = $CI->qiniu->getInfo("{$filename}.png");
if($info && $info['putTime']){
$put_time = substr($info['putTime'],0,10);
if($put_time<strtotime('2023-02-08 17:35:30')){ //2023-02-08重新上传
$CI->qiniu->rm("{$filename}.png");
}
}
$ret= $CI->qiniu->save("{$filename}.png", $res);
return $ret;
}
+1
View File
@@ -194,6 +194,7 @@ class Qiniu{
public function getInfo($filename){
$auth = new \Qiniu\Auth($this->config['access_key'], $this->config['secret_key']);
$bucketMgr = new \Qiniu\Storage\BucketManager($auth);
$filename = $this->config['attch'].$filename;
list($fileInfo, $err) = $bucketMgr->stat($this->config['bucket'], $filename);
if ($err) {
debug_log("七牛云获取文件信息失败, " . $err->message(). "; filename={$filename}");