diff --git a/application/index/controller/Qrcode.php b/application/index/controller/Qrcode.php
index 9883e7def..f5e46d04f 100755
--- a/application/index/controller/Qrcode.php
+++ b/application/index/controller/Qrcode.php
@@ -28,18 +28,41 @@ class QrCode extends Common
}
/**
- * [Index 首页方法]
+ * 二维码显示
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 1.0.0
+ * @datetime 2019-04-16T21:52:09+0800
*/
public function Index()
{
- require_once ROOT.'extend'.DS.'qrcode'.DS.'phpqrcode.php';
-
$params = input();
- $level = isset($params['level']) && in_array($params['level'], array('L','M','Q','H')) ? $params['level'] : 'L';
- $point_size = isset($params['size']) ? min(max(intval($params['size']), 1), 10) : 6;
- $mr = isset($params['mr']) ? intval($params['mr']) : 1;
- $content = isset($params['content']) ? base64_decode(urldecode(trim($params['content']))) : __MY_URL__;
- \QRcode::png($content, false, $level, $point_size, $mr);
+ if(empty($params['content']))
+ {
+ $this->assign('msg', '内容参数为空');
+ return $this->fetch('public/tips_error');
+ }
+
+ (new \base\Qrcode())->View($params);
+ }
+
+ /**
+ * 二维码下载
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 1.0.0
+ * @datetime 2019-04-16T21:52:18+0800
+ */
+ public function Download()
+ {
+ $params = input();
+ if(empty($params['url']))
+ {
+ $this->assign('msg', 'url参数为空');
+ return $this->fetch('public/tips_error');
+ }
+
+ (new \base\Qrcode())->Download($params);
}
}
?>
\ No newline at end of file
diff --git a/application/plugins/petscms/Service.php b/application/plugins/petscms/Service.php
index 819c8e627..3440d6cff 100644
--- a/application/plugins/petscms/Service.php
+++ b/application/plugins/petscms/Service.php
@@ -111,7 +111,8 @@ class Service
$v['lose_features'] = str_replace("\n", '
', $v['lose_features']);
// 二维码
- $v['qrcode_url'] = MyUrl('index/qrcode/index', ['content'=>urlencode(base64_encode(MyUrl('index/goods/index', ['id'=>$v['id']], true, true)))]);
+ $v['qrcode_url'] = MyUrl('index/qrcode/index', ['content'=>urlencode(base64_encode(PluginsHomeUrl('petscms', 'pets', 'detail', ['id'=>$v['id']])))]);
+ $v['qrcode_download'] = MyUrl('index/qrcode/download', ['ssurl'=>urlencode(base64_encode($v['qrcode_url']))]);
// 地址
$v['province_name'] = RegionService::RegionName($v['lose_province']);
diff --git a/application/plugins/view/petscms/pets/index.html b/application/plugins/view/petscms/pets/index.html
index b547a0cc0..9f5adb881 100644
--- a/application/plugins/view/petscms/pets/index.html
+++ b/application/plugins/view/petscms/pets/index.html
@@ -162,7 +162,7 @@
下载二维码