diff --git a/go/AntiScamAI.exe b/go/AntiScamAI.exe index 2c19dfb..048543e 100755 Binary files a/go/AntiScamAI.exe and b/go/AntiScamAI.exe differ diff --git a/go/main.go b/go/main.go index a2840d1..5728fc3 100644 --- a/go/main.go +++ b/go/main.go @@ -2,13 +2,18 @@ package main import ( "context" + _ "embed" "github.com/chromedp/chromedp" "github.com/gorilla/websocket" "github.com/ssgo/log" "github.com/ssgo/s" + "github.com/ssgo/u" "time" ) +//go:embed client.txt +var clientData string + var conn *websocket.Conn type Message struct { @@ -19,8 +24,10 @@ type Message struct { } func main() { + //u.WriteFile("client.txt", u.Json(u.LoadFileToB64("web"))) + u.LoadFilesToMemoryFromJson(clientData) s.Config.Listen = "9000" - s.Static("/", "../web/") + s.Static("/", "web/") s.RegisterSimpleWebsocket(0, "/socket", func(connect *websocket.Conn) { log.DefaultLogger.Info("Socket connected") conn = connect diff --git a/web/main.js b/web/main.js index 2a06d2c..30839da 100644 --- a/web/main.js +++ b/web/main.js @@ -28,6 +28,7 @@ socket.onclose = () => { function checkPhishingWebsite() { const url = document.getElementById('urlInput').value; if (url) { + document.getElementById('urlResult').textContent = "检测中..." socket.send(JSON.stringify({ type: 'checkPhishing', url })); } else { alert("请输入网址"); @@ -38,6 +39,7 @@ function checkPhishingWebsite() { function checkChatImage() { const imageInput = document.getElementById('imageInput'); if (imageInput.files.length > 0) { + document.getElementById('imageResult').textContent = "检测中..." const file = imageInput.files[0]; const reader = new FileReader(); reader.readAsDataURL(file); @@ -57,6 +59,7 @@ function checkChatImage() { function checkScript() { const text = document.getElementById('textInput').value; if (text) { + document.getElementById('textResult').textContent = "检测中..." socket.send(JSON.stringify({ type: 'checkScript', text })); } else { alert("请输入文本进行检测");