Skip to content

Commit

Permalink
fix: fit the outdated typings
Browse files Browse the repository at this point in the history
  • Loading branch information
crimx committed Sep 12, 2019
1 parent 508f443 commit f019572
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
10 changes: 1 addition & 9 deletions src/components/dictionaries/baidu/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,7 @@ export const search: SearchFunction<BaiduSearchResult, MachineTranslatePayload>
? 'BAIDUID=8971CB398A02E6B27F50DFF1DE3164BF:FG=1;'
: '',
},
body: new URLSearchParams({
from: sl,
to: tl,
query: text,
token: token,
sign: sign(text, gtk),
transtype: 'translang',
simple_means_flag: '3'
}).toString()
body: `from=${sl}&to=${tl}&query=${encodeURIComponent(text).replace(/%20/g, '+')}&token=${token}&sign=${sign(text, gtk)}&transtype=translang&simple_means_flag=3`
}
))
.then(r => r.json())
Expand Down
15 changes: 1 addition & 14 deletions src/components/dictionaries/sogou/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,7 @@ export const search: SearchFunction<SogouSearchResult, MachineTranslatePayload>
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'X-Requested-With': 'XMLHttpRequest',
},
body: new URLSearchParams({
from: sl,
to: tl,
text: text,
client: 'pc',
fr: 'browser_pc',
pid: 'sogou-dict-vr',
dict: 'true',
word_group: 'true',
second_query: 'true',
uuid: getUUID(),
needQc: '1',
s: md5('' + sl + tl + text + (await getSogouToken()))
}).toString()
body: `from=${sl}&to=${tl}&text=${encodeURIComponent(text).replace(/%20/g, '+')}&client=pc&fr=browser_pc&pid=sogou-dict-vr&dict=true&word_group=true&second_query=true&needQc=1&uuid=${getUUID()}&s=${encodeURIComponent(md5('' + sl + tl + text + (await getSogouToken())))}`
})
.then(r => r.json())
.then(json => handleJSON(json, sl, tl))
Expand Down

0 comments on commit f019572

Please sign in to comment.