diff --git a/frontend/src/components/localchat/ChatContent.vue b/frontend/src/components/localchat/ChatContent.vue
index 1ee192e..2f44c8c 100644
--- a/frontend/src/components/localchat/ChatContent.vue
+++ b/frontend/src/components/localchat/ChatContent.vue
@@ -90,19 +90,14 @@ async function scroll({ scrollTop }: { scrollTop: number }) {
-
-
-
-
+
- 取消
+ 拒绝
- 接收
+ 接收文件
diff --git a/frontend/src/stores/localchat.ts b/frontend/src/stores/localchat.ts
index 6ca9c41..47be69d 100644
--- a/frontend/src/stores/localchat.ts
+++ b/frontend/src/stores/localchat.ts
@@ -431,11 +431,13 @@ export const useLocalChatStore = defineStore('localChatStore', () => {
notifyError("确认失败!")
} else {
const res = await coms.json()
- if(res.code === 0){
+ console.log(res)
+ if(res.code > -1){
+ item = toRaw(item)
item.content.path = res.data.path
item.content.status = 'accessed'
- //console.log(item)
- await db.update('chatmsg', res.data.msg.msgId, toRaw(item))
+ console.log(item)
+ await db.update('chatmsg', item.id, item)
await getMsgList()
}else{
notifyError(res.message)
diff --git a/godo/localchat/filedown.go b/godo/localchat/filedown.go
index 01c891c..553c55c 100644
--- a/godo/localchat/filedown.go
+++ b/godo/localchat/filedown.go
@@ -118,7 +118,7 @@ func handleResponse(reader io.Reader, ip string) (string, error) {
}
}
- return revPath, nil
+ return filepath.Join(resPath, timestamp), nil
}
// downloadFile 下载单个文件
diff --git a/godo/localchat/filemsg.go b/godo/localchat/filemsg.go
index 767a276..a5e7cc8 100644
--- a/godo/localchat/filemsg.go
+++ b/godo/localchat/filemsg.go
@@ -73,7 +73,7 @@ func HandlerAccessFile(w http.ResponseWriter, r *http.Request) {
var msg UdpMessage
decoder := json.NewDecoder(r.Body)
if err := decoder.Decode(&msg); err != nil {
- http.Error(w, "Invalid request body", http.StatusBadRequest)
+ libs.ErrorMsg(w, "Invalid request body")
return
}
defer r.Body.Close()