rabin 7 years ago
parent
commit
d1bea04240
1 changed files with 2 additions and 9 deletions
  1. 2 9
      front/api/login.py

+ 2 - 9
front/api/login.py

@@ -6,9 +6,6 @@
 	author:rabin
 """
 from __load__ import *
-import json
-import urllib
-import urllib2
 
 class login_path(Load):
 	"""
@@ -60,12 +57,8 @@ class login_path(Load):
 		url = url + '&secret=' + Demeter.config['weixinApp']['secret']
 		url = url + '&js_code=' + code
 		url = url + '&grant_type=authorization_code'
-		req = urllib2.Request(url)
-		response = urllib2.urlopen(req)
-		data = json.loads(response.read())
-		#data = Demeter.curl(url)
-		#data = json.loads(data.body)
-		print data
+		data = Demeter.curl(url)
+		data = json.loads(data)
 		if 'errcode' in data:
 			return False
 		update = {}