Repository: AlistGo/alist (language: go)

Issue:
希望增加Seafile的token登录
### Please make sure of the following things

- [X] I have read the [documentation](https://alist.nn.ci).
- [X] I'm sure there are no duplicate issues or discussions.
- [X] I'm sure this feature is not implemented.
- [ ] I'm sure it's a reasonable and popular requirement.

### Description of the feature / 需求描述

某些学校使用Seafile搭建的网盘通过接入学校的统一认证来登录，无法通过现有Seafile驱动挂载

### Suggested solution / 实现思路

Seafile的Terminal 客户端在 8.0.4 版本后以后支持使用 Token 进行同步，以某大学网盘系统为例，每个账户的 Token 是唯一的，并且不会过期。seaf-cli 实质上是通过 pysearpc 与 seaf-daemon 通讯，因此大部分发行版默认源中较低版本的 seafile 在只替换 seaf-cli 的情况下也能正常工作。通过安装 Terminal 客户端后替换 seaf-cli 实现 Token 登录。

### Additional context / 附件

_No response_


Discussion / hints:
Thanks for opening your first issue here! Be sure to follow the issue template!

需要更多信息，比如使用Token请求的一个示例。
Hello @TanO732, please input issue by template and add detail. Issues labeled by `question` will be closed if no activities in 3 days.
你好 @TanO732，请按照issue模板填写, 并详细说明问题/日志记录/复现步骤/复现链接/实现思路或提供更多信息等, 3天内未回复issue自动关闭。
![Screenshot_20231001-234817~2.png](https://github.com/alist-org/alist/assets/52616511/c5f3e656-8fc8-4464-aafd-d7f25b340ea0)

这是他人给出的具体流程以供参考
Hello @, this issue was closed due to no activities in 3 days.
你好 @，此issue因超过3天未回复被关闭。
![image](https://github.com/alist-org/alist/assets/58730749/f7206dde-fc2a-43b7-bd16-65d0d2a6d15f)
do you mean this token
I think yes

Fix patch:
diff --git a/drivers/seafile/meta.go b/drivers/seafile/meta.go
index 9d84aee182f..fd5255f592b 100644
--- a/drivers/seafile/meta.go
+++ b/drivers/seafile/meta.go
@@ -9,8 +9,9 @@ type Addition struct {
 	driver.RootPath
 
 	Address  string `json:"address" required:"true"`
-	UserName string `json:"username" required:"true"`
-	Password string `json:"password" required:"true"`
+	UserName string `json:"username" required:"false"`
+	Password string `json:"password" required:"false"`
+	Token    string `json:"token" required:"false"`	
 	RepoId   string `json:"repoId" required:"false"`
 	RepoPwd  string `json:"repoPwd" required:"false"`
 }
diff --git a/drivers/seafile/util.go b/drivers/seafile/util.go
index 681953103c3..89b7b0fc39f 100644
--- a/drivers/seafile/util.go
+++ b/drivers/seafile/util.go
@@ -14,6 +14,10 @@ import (
 )
 
 func (d *Seafile) getToken() error {
+	if d.Token != "" {
+		d.authorization = fmt.Sprintf("Token %s", d.Token)
+		return nil
+	}
 	var authResp AuthTokenResp
 	res, err := base.RestyClient.R().
 		SetResult(&authResp).


Test patch: