Skip to content

Commit 0f82822

Browse files
znsoftznsoft
authored andcommitted
macos
1 parent 13c5614 commit 0f82822

File tree

14 files changed

+2739
-644
lines changed

14 files changed

+2739
-644
lines changed

app.go

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,20 +1114,38 @@ func (a *App) ClipboardGetText() (string, error) {
11141114
}
11151115

11161116
func (a *App) ReadBBS() (string, error) {
1117-
url := "https://raw.githubusercontent.com/RapidAI/cceasy/main/bbs.md"
1118-
1117+
// Use GitHub API with timestamp to bypass all caches
1118+
url := fmt.Sprintf("https://api.github.com/repos/RapidAI/aicoder/contents/bbs.md?ref=main&t=%d", time.Now().UnixNano())
1119+
1120+
// Create a new transport to avoid connection reuse caching
1121+
transport := &http.Transport{
1122+
DisableKeepAlives: true,
1123+
ForceAttemptHTTP2: false,
1124+
}
11191125
client := &http.Client{
1120-
Timeout: 10 * time.Second,
1126+
Timeout: 15 * time.Second,
1127+
Transport: transport,
11211128
}
1122-
1123-
resp, err := client.Get(url)
1129+
1130+
req, err := http.NewRequest("GET", url, nil)
1131+
if err != nil {
1132+
return "Failed to create request: " + err.Error(), nil
1133+
}
1134+
1135+
// GitHub API headers - request raw content directly
1136+
req.Header.Set("Accept", "application/vnd.github.v3.raw")
1137+
req.Header.Set("User-Agent", "AICoder-App")
1138+
req.Header.Set("Cache-Control", "no-cache, no-store")
1139+
req.Header.Set("Pragma", "no-cache")
1140+
1141+
resp, err := client.Do(req)
11241142
if err != nil {
11251143
return "Failed to fetch remote message: " + err.Error(), nil
11261144
}
11271145
defer resp.Body.Close()
11281146

11291147
if resp.StatusCode != http.StatusOK {
1130-
return "Remote message unavailable (Status: " + resp.Status + ")", nil
1148+
return fmt.Sprintf("Remote message unavailable (Status: %d %s)", resp.StatusCode, resp.Status), nil
11311149
}
11321150

11331151
data, err := io.ReadAll(resp.Body)

bbs.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
# AICoder 公告
2+
3+
## 最新消息
4+
15
1. 祝大家2026新年快乐!!!
26
2. 更新:解决服务商配置页面超出主窗口问题。
37
3. 与AIcodeMirror达成战略合作协议。
8+
9+
## 测试图片显示
10+
11+
下面是一张测试图片:
12+
13+
![Test Image](https://via.placeholder.com/300x200/4F46E5/FFFFFF?text=AICoder+Test)
14+
15+
如果你能看到上面的紫色测试图片,说明远程图片显示功能正常!
16+
17+
## 功能特点
18+
19+
- ✅ 支持多种 AI 模型
20+
- ✅ 智能代码补全
21+
- ✅ 项目管理
22+
-**Markdown 渲染**
23+
24+
---
25+
26+
*感谢使用 AICoder!*

build/.DS_Store

0 Bytes
Binary file not shown.

build_number

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
81
1+
87

frontend/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<meta charset="UTF-8"/>
55
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
6+
<meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline' 'unsafe-eval' data: blob:; img-src 'self' data: blob: https: http:; connect-src 'self' https: http: wss: ws:; style-src 'self' 'unsafe-inline' https:; font-src 'self' data: https:;">
67
<title>AICoder</title>
78
</head>
89
<body>

0 commit comments

Comments
 (0)