Merge branch 'Bug502-YuGaoXiang' of http://121.4.94.30:3000/mrlan/EnglishPal into Alpha-snapshot20230506
commit
becef7e343
|
@ -91,10 +91,7 @@ def article():
|
|||
question = data.get("question", "")
|
||||
level = data.get("level", "4")
|
||||
if content:
|
||||
try: # check level
|
||||
if level not in ['1', '2', '3', '4']:
|
||||
raise ValueError
|
||||
except ValueError:
|
||||
return "Level must be between 1 and 4."
|
||||
add_article(content, source, level, question)
|
||||
_update_context()
|
||||
|
|
|
@ -68,9 +68,9 @@
|
|||
<script>
|
||||
// 密码生成器
|
||||
function generatePassword(length) {
|
||||
var charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+~`|}{[]\:;?><,./-=";
|
||||
var password = "";
|
||||
for (var i = 0; i < length; i++) {
|
||||
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^*()_+~`|}{[]\:;?,./-=";
|
||||
let password = "";
|
||||
for (let i = 0; i < length; i++) {
|
||||
password += charset.charAt(Math.floor(Math.random() * charset.length));
|
||||
}
|
||||
return password;
|
||||
|
|
Loading…
Reference in New Issue