日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

七牛云上传的图片进行删除

發(fā)布時間:2025/4/9 编程问答 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 七牛云上传的图片进行删除 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
PHP方法: /*** 七牛云商品圖片刪除2017/10/25*/ public function delGoodsImg() {$this->isShopLogin();$img = I("imgUrl");$res = $this->qiNiuDelImg($img);if ($res['status'] != 1) {//七牛里沒有圖片時,但數(shù)據(jù)庫里有數(shù)據(jù)時if (!empty($res['err']) && !empty($img)) {$gg = M("goods_gallerys");$where['goodsImg'] = "http://ang.com/" . $img;$imgInfo = $gg->where($where)->find();if (!empty($imgInfo)) {$res = $gg->where($where)->delete();}}$this->ajaxReturn($res['err']);} else {$gg = M("goods_gallerys");$where['goodsImg'] = "http:/g.com/" . $img;$imgInfo = $gg->where($where)->find();if (!empty($imgInfo)) {$res = $gg->where($where)->delete();}$this->ajaxReturn("ok");} }配置刪除路徑 :var delimg="{:U('Home/Goods/delGoodsImg')}"; //刪除退貨上傳的圖片$(document).on("click",".lst1106-SC", function(){$(this).parent().remove();var imgSrc = $(this).parent().children('img').attr('src');var index = imgSrc.lastIndexOf("\/");var name = imgSrc.substring(index + 1,imgSrc.length);console.log(imgSrc)console.log(name)$.post(delimg, { imgUrl: name }, function(data) {console.log(data);});});打印結(jié)果: http://image.jianfengwang.com/o_1c43gn8k15e01ia0tt0898fe9.jpgo_1c43gn8k15e01ia0tt0898fe9.jpgok

?

轉(zhuǎn)載于:https://www.cnblogs.com/lst619247/p/8308884.html

總結(jié)

以上是生活随笔為你收集整理的七牛云上传的图片进行删除的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。