Skip to content

更新图书馆新接口检索与认证流程#157

Open
aqqkad wants to merge 3 commits into
BenderBlog:mainfrom
aqqkad:main
Open

更新图书馆新接口检索与认证流程#157
aqqkad wants to merge 3 commits into
BenderBlog:mainfrom
aqqkad:main

Conversation

@aqqkad

@aqqkad aqqkad commented Jul 5, 2026

Copy link
Copy Markdown

变更内容

  • 将图书馆检索、馆藏详情、已借阅查询切换到新的 OPAC 接口
  • 图书馆认证链路沿用学校 IDS / 超星 CAS,绕开微信认证
  • 重做“查询藏书”页面,支持普通检索和高级检索切换
  • 高级检索参数为从 OPAC 在线获取
  • 图书封面保持懒加载,不做本地持久化缓存
  • 优化馆藏详情展示,较长馆藏地信息可正常换行

说明

  • 本次改动不修改 lib/repository/preference.dart
  • 已在本地通过相关文件的 dart analyze

factory BorrowData.fromJson(Map<String, dynamic> json) =>
_$BorrowDataFromJson(json);

factory BorrowData.fromOpacJson(Map<String, dynamic> json) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不知道我理解的对不对,这里不应该通过写一个新的 factory 解决,而是彻底地修改数据结构,然后跑 https://pub.dev/packages/json_serializable 来解决。

builder: (context) {
final state = controller.energyInfoStateSignal.value;
final displayInfo = controller.displayEnergyInfo.value;
final lowElectricityWarningEnabled =

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

late final Future<List<BookLocation>> _locationsFuture =
widget.toUse.items != null
? Future.value(widget.toUse.items!)
: LibrarySession().bookLocations(widget.toUse.docNumber);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -7,69 +7,19 @@ import 'package:watermeter/page/public_widget/both_side_sheet.dart';
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

暂不细看,只要能跑回来我自己优化

required this.years,
});

factory LibrarySearchFilterOptions.fallback() => LibrarySearchFilterOptions(

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

哎,先这样吧……

Options get _opacOptions => Options(
contentType: "application/json;charset=utf-8",
headers: {
HttpHeaders.cookieHeader: "jwt=$token; jwtHeader=$_opacJwtHeader",

@BenderBlog BenderBlog Jul 11, 2026

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cookie 这块不用 CookieJar 吗?纯好奇
不懂但是能跑的话不要改

@BenderBlog

Copy link
Copy Markdown
Owner

解决掉上面的问题就完了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants