Browse Source

fix bugs

master
欧醚 2 years ago
parent
commit
1dba01ac63
2 changed files with 4 additions and 4 deletions
  1. +3
    -3
      app.py
  2. +1
    -1
      templates/homepage.html

+ 3
- 3
app.py View File

@ -86,12 +86,12 @@ def calc_token(cid, uid):
return RtcTokenBuilder.buildTokenWithUid(C.app_id, C.app_certificate, cid, uid, Role_Attendee, privilegeExpiredTs)
def calc_rtm_token(name):
def calc_rtm_token(username):
expireTimeInSeconds = 3600 * 5
currentTimestamp = int(time.time())
privilegeExpiredTs = currentTimestamp + expireTimeInSeconds
return RtmTokenBuilder.buildToken(C.app_id, C.app_certificate, name, Role_Rtm_User, privilegeExpiredTs)
return RtmTokenBuilder.buildToken(C.app_id, C.app_certificate, username, Role_Rtm_User, privilegeExpiredTs)
@app.route('/call/')
@ -99,7 +99,7 @@ def calc_rtm_token(name):
def homepage():
me = current_user
app_id = C.app_id
rtm_token = calc_rtm_token(me.acct or me.disp)
rtm_token = calc_rtm_token(me.acct)
_cid = request.args.get('cid')
if _cid and not rds.hexists(RDS_KEY, _cid):

+ 1
- 1
templates/homepage.html View File

@ -103,7 +103,7 @@
<script type="text/javascript">
window._APPID = "{{app_id}}";
window._RTM_TOKEN = "{{rtm_token}}";
window._MY_NAME = "{{me.acct or me.disp}}";
window._MY_NAME = "{{me.acct}}";
window._UID = {{me.id}};
</script>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>

Loading…
Cancel
Save