We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c9668e2 commit 43dec56Copy full SHA for 43dec56
internal/middleware/collect_answer.go
@@ -29,9 +29,12 @@ func FillHash(t *entity.Tiku) {
29
}
30
sort.Strings(options) // 将选项排序
31
32
- optionsStr, _ := json.Marshal(options)
+ sortOptionsStr, err := json.Marshal(options)
33
+ if err != nil {
34
+ sortOptionsStr = []byte("[]")
35
+ }
36
- t.Hash = strutil.Md5(t.Question + string(optionsStr) + strconv.Itoa(int(t.Type)) + strconv.Itoa(int(t.Plat)))
37
+ t.Hash = strutil.Md5(t.Question + string(sortOptionsStr) + strconv.Itoa(int(t.Type)) + strconv.Itoa(int(t.Plat)))
38
39
40
// CollectAnswer 收集没有搜索到的答案
0 commit comments