edit-api-wxqrcode
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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}");
|
||||
|
||||
Reference in New Issue
Block a user