Skip to content

Commit 1c052b7

Browse files
fix: Fix the issue with AI proxy certificate res error (#7983)
1 parent 6c8d48c commit 1c052b7

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

backend/app/dto/ai.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ type OllamaBindDomainReq struct {
3636
}
3737

3838
type OllamaBindDomainRes struct {
39-
Domain string `json:"domain"`
40-
SSLID uint `json:"sslID"`
41-
AllowIPs []string `json:"allowIPs"`
42-
WebsiteID uint `json:"websiteID"`
43-
ConnUrl string `json:"connUrl"`
39+
Domain string `json:"domain"`
40+
SSLID uint `json:"sslID"`
41+
AcmeAccountID uint `json:"acmeAccountID"`
42+
AllowIPs []string `json:"allowIPs"`
43+
WebsiteID uint `json:"websiteID"`
44+
ConnUrl string `json:"connUrl"`
4445
}

backend/app/service/ai.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,8 @@ func (u *AIToolService) GetBindDomain(req dto.OllamaBindDomainReq) (*dto.OllamaB
297297
res.Domain = website.PrimaryDomain
298298
if website.WebsiteSSLID > 0 {
299299
res.SSLID = website.WebsiteSSLID
300+
ssl, _ := websiteSSLRepo.GetFirst(commonRepo.WithByID(website.WebsiteSSLID))
301+
res.AcmeAccountID = ssl.AcmeAccountID
300302
}
301303
res.ConnUrl = fmt.Sprintf("%s://%s", strings.ToLower(website.Protocol), website.PrimaryDomain)
302304
res.AllowIPs = GetAllowIps(website)

frontend/src/api/interface/ai.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ export namespace AI {
104104
export interface BindDomainRes {
105105
domain: string;
106106
sslID: number;
107+
acmeAccountID: number;
107108
allowIPs: string[];
108109
websiteID?: number;
109110
connUrl: string;

frontend/src/views/ai/model/domain/index.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,6 @@ const listSSL = () => {
202202
const listAcmeAccount = () => {
203203
SearchAcmeAccount({ page: 1, pageSize: 100 }).then((res) => {
204204
acmeAccounts.value = res.data.items || [];
205-
if (acmeAccounts.value.length > 0) {
206-
req.value.acmeAccountID = acmeAccounts.value[0].id;
207-
}
208205
listSSL();
209206
});
210207
};
@@ -238,6 +235,7 @@ const search = async (appInstallID: number) => {
238235
if (res.data.sslID > 0) {
239236
req.value.enableSSL = true;
240237
req.value.sslID = res.data.sslID;
238+
req.value.acmeAccountID = res.data.acmeAccountID;
241239
listAcmeAccount();
242240
}
243241
}

0 commit comments

Comments
 (0)