diff --git a/app/templates/admin_manage_user.html b/app/templates/admin_manage_user.html index 1b3f0a0..99af604 100644 --- a/app/templates/admin_manage_user.html +++ b/app/templates/admin_manage_user.html @@ -36,7 +36,7 @@
- {% for user in user_list %} @@ -78,6 +78,19 @@ let pwd = generatePassword(12) document.getElementById("new_password").value = pwd }) + // 选择用户后更新其过期时间 + function select_user() { + let cur_user = $('#username').val(); + {% for user in user_list %} + if (cur_user == "{{ user.name }}") { + const dateString = "{{ user.expiry_date }}" + const year = dateString.substr(0,4); + const month = dateString.substr(4,2); + const day = dateString.substr(6,2); + document.getElementById("expiry_date").value = year + '-' + month + '-' + day + } + {% endfor %} + }