rabin 7 سال پیش
والد
کامیت
b893690547
4فایلهای تغییر یافته به همراه42 افزوده شده و 1 حذف شده
  1. 23 0
      admin/static/css/x-admin.css
  2. 2 0
      conf/dev.conf
  3. 2 0
      conf/env.conf
  4. 15 1
      front/api/farm.py

+ 23 - 0
admin/static/css/x-admin.css

@@ -461,3 +461,26 @@ body .site-demo-nav .layui-nav-item{line-height: 40px}
 
 
 
+/* demeter */
+.layui-layout-admin .header
+{
+    border-bottom: 5px solid #01aaed;
+}
+.layui-nav-tree .layui-nav-bar
+{
+    background-color: #01aaed;
+}
+.layui-nav-tree .layui-nav-child dd.layui-this, .layui-nav-tree .layui-this, .layui-nav-tree .layui-this>a, .layui-nav-tree .layui-this>a:hover
+{
+    background-color: #01aaed;
+}
+
+.layui-btn
+{
+    background-color: #01aaed;
+}
+
+.layui-elem-quote
+{
+    border-left: 5px solid #01aaed;
+}

+ 2 - 0
conf/dev.conf

@@ -65,7 +65,9 @@ max_buffer_size		= 210763776
 ;子进程
 process				= 0
 url					= http://192.168.15.10:8088/device
+;qrcode				= http://192.168.15.10:8088/farm/qrcode?url=
 qrcode				= http://pan.baidu.com/share/qrcode?w=300&h=300&url=
+qrcode_create		= http://pan.baidu.com/share/qrcode?w=300&h=300&url=
 
 ;网站前台配置
 [web]

+ 2 - 0
conf/env.conf

@@ -65,7 +65,9 @@ max_buffer_size		= 210763776
 ;子进程
 process				= 0
 url					= http://api.nongxiaohe.com/device
+;qrcode				= http://api.nongxiaohe.com/farm/qrcode?url=
 qrcode				= http://pan.baidu.com/share/qrcode?w=300&h=300&url=
+qrcode_create		= http://pan.baidu.com/share/qrcode?w=300&h=300&url=
 
 [web]
 port				= 8089

+ 15 - 1
front/api/farm.py

@@ -6,6 +6,9 @@
 	author:rabin
 """
 from __load__ import *
+import matplotlib.pyplot as plt # plt 用于显示图片
+import matplotlib.image as mpimg # mpimg 用于读取图片
+import numpy as np
 
 class index_path(Load):
 	"""
@@ -128,4 +131,15 @@ class msg_path(Load):
 			update['status'] = True
 			self.service('common').update('msg', id, update, cdate=False)
 
-		self.out('yes', self.data)
+		self.out('yes', self.data)
+
+
+class qrcode_path(Load):
+	@auth
+	@Web.setting
+	def get(self):
+		url = self.input('url')
+		url = Demeter.config['front']['qrcode_create'] + url
+		data = Demeter.curl(url)
+		filename = Demeter.md5(url)
+		File.write(filename, data)