mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-19 09:46:39 +08:00
opt: change the relative path with absolute path for midjourney image uploading
This commit is contained in:
parent
9e9bc52737
commit
a5299b52d4
@ -145,6 +145,13 @@ func (h *MidJourneyHandler) Image(c *gin.Context) {
|
|||||||
prompt = fmt.Sprintf("%s:%s", data.TaskType, strings.Join(data.ImgArr, ","))
|
prompt = fmt.Sprintf("%s:%s", data.TaskType, strings.Join(data.ImgArr, ","))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 如果本地图片上传的是相对地址,处理成绝对地址
|
||||||
|
for k, v := range data.ImgArr {
|
||||||
|
if !strings.HasPrefix(v, "http") {
|
||||||
|
data.ImgArr[k] = fmt.Sprintf("http://localhost:5678/%s", strings.TrimLeft(v, "/"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
idValue, _ := c.Get(types.LoginUserID)
|
idValue, _ := c.Get(types.LoginUserID)
|
||||||
userId := utils.IntValue(utils.InterfaceToString(idValue), 0)
|
userId := utils.IntValue(utils.InterfaceToString(idValue), 0)
|
||||||
// generate task id
|
// generate task id
|
||||||
|
@ -479,9 +479,15 @@ const changeChat = (chat) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const loadChat = function (chat) {
|
const loadChat = function (chat) {
|
||||||
|
if (!isLogin.value) {
|
||||||
|
showLoginDialog.value = true
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (activeChat.value['chat_id'] === chat.chat_id) {
|
if (activeChat.value['chat_id'] === chat.chat_id) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
activeChat.value = chat
|
activeChat.value = chat
|
||||||
newChatItem.value = null;
|
newChatItem.value = null;
|
||||||
roleId.value = chat.role_id;
|
roleId.value = chat.role_id;
|
||||||
|
Loading…
Reference in New Issue
Block a user