web异常待修复
This commit is contained in:
@@ -306,7 +306,7 @@ func (s *Server) handleShieldHosts(w http.ResponseWriter, r *http.Request) {
|
||||
// 获取hosts条目列表
|
||||
hosts := s.shieldManager.GetAllHosts()
|
||||
hostsCount := s.shieldManager.GetHostsCount()
|
||||
|
||||
|
||||
// 转换为数组格式,便于前端展示
|
||||
hostsList := make([]map[string]string, 0, len(hosts))
|
||||
for domain, ip := range hosts {
|
||||
@@ -315,7 +315,7 @@ func (s *Server) handleShieldHosts(w http.ResponseWriter, r *http.Request) {
|
||||
"ip": ip,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
json.NewEncoder(w).Encode(map[string]interface{}{
|
||||
"hosts": hostsList,
|
||||
"hostsCount": hostsCount,
|
||||
@@ -341,7 +341,7 @@ func (s *Server) handleQuery(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
// 获取域名屏蔽的详细信息
|
||||
blockDetails := s.shieldManager.CheckDomainBlockDetails(domain)
|
||||
|
||||
|
||||
// 添加时间戳
|
||||
blockDetails["timestamp"] = time.Now()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user