更新若干功能

This commit is contained in:
李琦
2026-08-15 17:18:00 +08:00
parent 4954295961
commit 6a81e479ef
77 changed files with 8165 additions and 2372 deletions

View File

@@ -155,10 +155,12 @@ func TestSaveContentImageServerMode(t *testing.T) {
}))
defer srv.Close()
cfg, _ := json.Marshal(FileStorageConfig{Mode: "server", BaseURL: srv.URL, APIKey: "k1"})
cfg, _ := json.Marshal(FileStorageConfig{Mode: "server", BaseURL: srv.URL, APIKey: "ignored"})
if e := a.store.SetMeta(fileStorageKey, string(cfg)); e != nil {
t.Fatal(e)
}
_ = a.store.SetMeta("sync_access_token", "jwt-token-1")
_ = a.store.SetMeta("sync_user_id", "9")
st, _ := a.store.Settings()
st.ImageMode = "server"
if e := a.store.SaveSettings(st); e != nil {
@@ -171,8 +173,8 @@ func TestSaveContentImageServerMode(t *testing.T) {
if !strings.HasPrefix(got, "http") || !strings.Contains(got, "/files/") {
t.Fatalf("server mode should return http url, got %q", got)
}
if gotAuth != "Bearer k1" {
t.Fatalf("missing bearer key, got %q", gotAuth)
if gotAuth != "Bearer jwt-token-1" {
t.Fatalf("missing bearer jwt, got %q", gotAuth)
}
if gotKind != "content" {
t.Fatalf("kind should be content, got %q", gotKind)