Skip to content

Commit b1af79e

Browse files
committed
release 5.0.2
1 parent d280583 commit b1af79e

File tree

8 files changed

+8
-30
lines changed

8 files changed

+8
-30
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
部署教程:[文档](https://fcircle-doc.yyyzyyyz.cn/) | [备用地址](https://fcircle-doc.is-a.dev/)
66

77
```
8-
5.0.1 支持:
8+
5.0.2 支持:
99
- 更好的前端样式
1010
- 新增前端管理面板,告别繁琐的配置,管理朋友圈更加方便
1111
- 支持 gitee 和 github 上的 issues 友链获取
@@ -25,7 +25,7 @@
2525
- 提供一个简单的快速部署脚本
2626
2727
最近改动:
28-
- 接口bug修复
29-
- 移动端适配和前端样式修复
28+
- 修复可能出现的安全问题
29+
- volantis抓取错位修复
3030
```
3131

api_dependencies/dependencies.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,6 @@ def verify_password(plain_password, hashed_password):
2121
return pwd_context.verify(plain_password, hashed_password)
2222

2323

24-
def get_or_create_token(password: str):
25-
password_hash = create_password_hash(password)
26-
return password_hash
27-
# try:
28-
# payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])
29-
# return payload
30-
# username: str = payload.get("sub")
31-
# if username is None:
32-
# raise credentials_exception
33-
# except JWTError:
34-
# return "123"
35-
36-
3724
def encode_access_token(data: dict, secert_key: str,
3825
expires_delta: timedelta = timedelta(days=ACCESS_TOKEN_EXPIRE_DAYS)):
3926
to_encode = data.copy()

api_dependencies/leancloud/leancloudapi.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -382,18 +382,14 @@ async def login_(password: str):
382382
query.limit(10)
383383

384384
try:
385-
query.select('password', "token")
385+
query.select('password')
386386
res = query.first()
387387
obj_id = res.id
388388
# 保存了pwd,通过pwd验证
389389
if dep.verify_password(password, res.get("password")):
390390
# 更新token
391391
data = {"password_hash": res.get("password")}
392392
token = dep.encode_access_token(data, secret_key)
393-
auth.create_without_data(obj_id).destroy()
394-
auth_db.set("password", res.get("password"))
395-
auth_db.set("token", token)
396-
auth_db.save()
397393
else:
398394
# 401
399395
return format_response.CredentialsException
@@ -405,7 +401,6 @@ async def login_(password: str):
405401
data = {"password_hash": password_hash}
406402
token = dep.encode_access_token(data, secret_key)
407403
auth_db.set("password", password_hash)
408-
auth_db.set("token", token)
409404
auth_db.save()
410405
except:
411406
return format_response.CredentialsException

api_dependencies/mongodb/mongodbapi.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,13 @@ async def login_(password: str):
194194
# 未保存pwd,生成对应token并保存
195195
data = {"password_hash": password_hash}
196196
token = dep.encode_access_token(data, secret_key)
197-
auth.insert_one({"password": password_hash, "token": token})
197+
auth.insert_one({"password": password_hash})
198198
elif auth_count == 1:
199199
# 保存了pwd,通过pwd验证
200200
if dep.verify_password(password, auth_res["password"]):
201201
# 更新token
202202
data = {"password_hash": auth_res["password"]}
203203
token = dep.encode_access_token(data, secret_key)
204-
insert_stat = {"password": auth_res["password"], "token": token}
205-
auth.replace_one({"password": auth_res["password"]}, insert_stat, upsert=True)
206204
else:
207205
# 401
208206
return format_response.CredentialsException

api_dependencies/sql/sqlapi.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,15 +282,14 @@ async def login_(password: str):
282282
# 未保存pwd,生成对应token并保存
283283
data = {"password_hash": password_hash}
284284
token = dep.encode_access_token(data, secret_key)
285-
tb_obj = Auth(password=password_hash, token=token)
285+
tb_obj = Auth(password=password_hash)
286286
session.add(tb_obj)
287287
elif len(auth) == 1:
288288
# 保存了pwd,通过pwd验证
289289
if dep.verify_password(password, auth[0].password):
290290
# 更新token
291291
data = {"password_hash": auth[0].password}
292292
token = dep.encode_access_token(data, secret_key)
293-
session.query(Auth).filter_by(password=auth[0].password).update({"token": token})
294293
else:
295294
# 401
296295
return format_response.CredentialsException

hexo_circle_of_friends/models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ class Auth(AbstractBase):
4343
__tablename__ = 'auth'
4444
id = Column(Integer, primary_key=True, autoincrement=True)
4545
password = Column(String(1024))
46-
token = Column(String(1024))
4746

4847

4948
class Secret(AbstractBase):

hexo_circle_of_friends/scrapy_conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
############################## 除非您了解本项目,否则请勿修改本文件 ################################
2-
VERSION = "5.0.1"
2+
VERSION = "5.0.2"
33

44
# debug
55
# debug模式

hexo_circle_of_friends/utils/get_url.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def get_volantis_url(self, response, queue):
106106
if not name:
107107
name = response.css('a.friend-card span::text').extract()
108108
if not name:
109-
name = response.css('a.friend-card p::text').extract()
109+
name = response.css('a.friend-card p.friend-name::text').extract()
110110
self.handle(avatar, link, name, queue, "volantis")
111111

112112
def get_Yun_url(self, response, queue):

0 commit comments

Comments
 (0)