Compare commits

..

1 Commits

Author SHA1 Message Date
keli_Chuang 40c86b2050 Bug359 修改位置pickle_idea2.py line71 2022-06-05 22:00:43 +08:00
15 changed files with 6 additions and 7 deletions

View File

@ -1,3 +1,4 @@
# -*- coding: UTF-8 -*-
from WordFreq import WordFreq from WordFreq import WordFreq
from wordfreqCMD import youdao_link, sort_in_descending_order from wordfreqCMD import youdao_link, sort_in_descending_order
from UseSqlite import InsertQuery, RecordQuery from UseSqlite import InsertQuery, RecordQuery

BIN
app/Article.pyc Normal file

Binary file not shown.

View File

@ -1,3 +1,4 @@
# -*- coding: UTF-8 -*-
import hashlib import hashlib
from datetime import datetime from datetime import datetime
from UseSqlite import InsertQuery, RecordQuery from UseSqlite import InsertQuery, RecordQuery
@ -5,10 +6,6 @@ from UseSqlite import InsertQuery, RecordQuery
path_prefix = '/var/www/wordfreq/wordfreq/' path_prefix = '/var/www/wordfreq/wordfreq/'
path_prefix = './' # comment this line in deployment path_prefix = './' # comment this line in deployment
def verify_pass(newpass,oldpass):
if(newpass==oldpass):
return True
def verify_user(username, password): def verify_user(username, password):
rq = RecordQuery(path_prefix + 'static/wordfreqapp.db') rq = RecordQuery(path_prefix + 'static/wordfreqapp.db')
@ -51,8 +48,6 @@ def change_password(username, old_password, new_password):
if not verify_user(username, old_password): # 旧密码错误 if not verify_user(username, old_password): # 旧密码错误
return False return False
# 将用户名和密码一起加密,以免暴露不同用户的相同密码 # 将用户名和密码一起加密,以免暴露不同用户的相同密码
if verify_pass(new_password,old_password): #新旧密码一致
return False
password = md5(username + new_password) password = md5(username + new_password)
rq = InsertQuery(path_prefix + 'static/wordfreqapp.db') rq = InsertQuery(path_prefix + 'static/wordfreqapp.db')
rq.instructions_with_parameters("UPDATE user SET password=:password WHERE name=:username", dict( rq.instructions_with_parameters("UPDATE user SET password=:password WHERE name=:username", dict(

BIN
app/Login.pyc Normal file

Binary file not shown.

BIN
app/UseSqlite.pyc Normal file

Binary file not shown.

BIN
app/WordFreq.pyc Normal file

Binary file not shown.

View File

@ -1,3 +1,4 @@
# -*- coding: UTF-8 -*-
''' '''
Yaml.py Yaml.py
配置文件包括: 配置文件包括:

BIN
app/Yaml.pyc Normal file

Binary file not shown.

View File

@ -1,3 +1,4 @@
# -*- coding: UTF-8 -*-
########################################################################### ###########################################################################
# Copyright 2019 (C) Hui Lan <hui.lan@cantab.net> # Copyright 2019 (C) Hui Lan <hui.lan@cantab.net>
# Written permission must be obtained from the author for commercial uses. # Written permission must be obtained from the author for commercial uses.

BIN
app/difficulty.pyc Normal file

Binary file not shown.

BIN
app/pickle_idea.pyc Normal file

Binary file not shown.

View File

@ -68,7 +68,7 @@ def save_frequency_to_pickle(d, pickle_fname):
d2 = {} d2 = {}
for k in d: for k in d:
if not k in exclusion_lst and not k.isnumeric() and not len(k) < 2: if not k in exclusion_lst and not k.isnumeric() and not len(k) < 2:
d2[k] = list(sorted(set(d[k]))) d2[k] = list(sorted(d[k])) # 原先这里是d2[k] = list(sorted(set(d[k])))
pickle.dump(d2, f) pickle.dump(d2, f)
f.close() f.close()

BIN
app/pickle_idea2.pyc Normal file

Binary file not shown.

View File

@ -1,3 +1,4 @@
# -*- coding: UTF-8 -*-
########################################################################### ###########################################################################
# Copyright 2019 (C) Hui Lan <hui.lan@cantab.net> # Copyright 2019 (C) Hui Lan <hui.lan@cantab.net>
# Written permission must be obtained from the author for commercial uses. # Written permission must be obtained from the author for commercial uses.

BIN
app/wordfreqCMD.pyc Normal file

Binary file not shown.