Skip to content

Commit

Permalink
update webServer
Browse files Browse the repository at this point in the history
  • Loading branch information
CAOLINAN committed Jun 25, 2018
1 parent 858ad0a commit bf5ee13
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
20 changes: 10 additions & 10 deletions ulordapi/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ def config_show(self, args=None):
result = result.get(arg)
return result

def config_init(self):
"""
init config
"""
# def config_init(self):
# """
# init config
# """

# udfs operations
def udfs_download(self, udfshashs):
Expand Down Expand Up @@ -226,12 +226,12 @@ def request(self, method, url, data=None):
if method.lower() == 'get':
return self.get(url=url)

def help(self):
"""
:return: dict.self method
"""
# todo create self help
return inspect.getmembers(self, predicate=inspect.ismethod)
# def help(self):
# """
# :return: dict.self method
# """
# # todo create self help
# return inspect.getmembers(self, predicate=inspect.ismethod)


class Senior(Developer):
Expand Down
8 changes: 6 additions & 2 deletions ulordapi/webServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

log = logging.getLogger('webServer')

junior = Junior(appkey="5d42b27e581c11e88b12f48e3889c8ab", secret="5d42b27f581c11e8bf63f48e3889c8ab")
junior = Junior(appkey="8326648868ad11e8b894fa163e37b4c3", secret="8326648968ad11e8b894fa163e37b4c3")
# junior = Junior(appkey="5d42b27e581c11e88b12f48e3889c8ab", secret="5d42b27f581c11e8bf63f48e3889c8ab")
# blog_config = {
# 'baseconfig':{
# 'config_file':'E:\ulord\ulord-blog-demo\config'
Expand All @@ -25,6 +26,7 @@
# }
# }
# junior.config_edit(blog_config)

dbpath = os.getcwd()
junior.create_database(dbpath)

Expand Down Expand Up @@ -61,7 +63,7 @@ def get_pubkey():
return jsonify(return_result(0, result={"pubkey":junior.rsahelper.pubkeybytes}))
elif request.method == 'POST':
message = request.json.get("password")
return jsonify(return_result(0, result={'password': junior.get_purearg(message)}))
return jsonify(return_result(0, result={'password': junior.rsahelper._decrypt(message)}))


@app.route('/user/encrypt',methods=['POST'])
Expand Down Expand Up @@ -308,6 +310,8 @@ def pay_blogs():
})
return jsonify(junior.pay_resources(current_user, claim_id, password, encrypted=True))

@app.route('/blog/update',methods=['POST'])


@app.route('/pay/ads',methods=['POST'])
def pay_ads():
Expand Down

0 comments on commit bf5ee13

Please sign in to comment.