rabin 7 years ago
parent
commit
4147164201
3 changed files with 11 additions and 5 deletions
  1. 2 2
      conf/dev.conf
  2. 2 2
      conf/env.conf
  3. 7 1
      front/api/__load__.py

+ 2 - 2
conf/dev.conf

@@ -78,6 +78,6 @@ originurl			= http://192.168.15.10:8089/origin?id=
 
 ;微信小程序配置
 [weixinApp]
-appid				= 1
-secret				= 1
+appid				= wxf0a528da6a913aa1
+secret				= 20a4478017a8dffa3c9271041b13dc0a
 login				= https://api.weixin.qq.com/sns/jscode2session

+ 2 - 2
conf/env.conf

@@ -77,6 +77,6 @@ originurl			= http://s.xinnongbaohe.com/?id=
 
 ;微信小程序配置
 [weixinApp]
-appid				= 1
-secret				= 1
+appid				= wxf0a528da6a913aa1
+secret				= 20a4478017a8dffa3c9271041b13dc0a
 login				= https://api.weixin.qq.com/sns/jscode2session

+ 7 - 1
front/api/__load__.py

@@ -21,5 +21,11 @@ class Load(Base):
 	KEYS = ('user', 'farm')
 
 	def setting(self):
-		Demeter.config['setting']['farm'] = 1
+		uid = self.input('uid')
+		farm = 1
+		if uid:
+			user = self.service('common').one('farm_user', id=uid)
+			if user:
+				farm = user['farm_id']
+		Demeter.config['setting']['farm'] = farm
 		return