def get(self): self.write(111) #a = yield MySQLHelper.add_user({ # 'name': 'test1', # 'password': '******' # }) a = yield MySQLHelper.modify_password('bfb7c38a-9bda-11e5-8ad1-5254001a7787', '123456') self.write(222)
def post(self): uid = self.session_get() if uid is None or len(uid) == 0: self.exception_handle( 'Session timeout') return if self.body_json_object is None: self.exception_handle( 'Request data format exception, %s' % self.request.uri) return request_password = self.body_json_object.get('password') if request_password is None or len(request_password) == 0: self.exception_handle('Missing argument \'password\'') return # TODO Check password format try: rc = yield MySQLHelper.modify_password(uid, request_password) except Exception, e: self.exception_handle('Password change failed (MySQL)') return