mirror of
https://github.com/OwO-Network/DeepLX.git
synced 2025-04-19 06:03:25 +00:00
Fixed bug
This commit is contained in:
parent
a8a24b597c
commit
3a6c037434
6
main.go
6
main.go
@ -85,6 +85,8 @@ type ResData struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
// create a random id
|
||||||
|
id := getRandomNumber()
|
||||||
r := gin.Default()
|
r := gin.Default()
|
||||||
// r.SetTrustedProxies([]string{"192.168.36.153"})
|
// r.SetTrustedProxies([]string{"192.168.36.153"})
|
||||||
r.GET("/", func(c *gin.Context) {
|
r.GET("/", func(c *gin.Context) {
|
||||||
@ -95,6 +97,7 @@ func main() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
r.POST("/translate", func(c *gin.Context) {
|
r.POST("/translate", func(c *gin.Context) {
|
||||||
reqj := ResData{}
|
reqj := ResData{}
|
||||||
c.BindJSON(&reqj)
|
c.BindJSON(&reqj)
|
||||||
@ -113,7 +116,8 @@ func main() {
|
|||||||
if translate_text != "" {
|
if translate_text != "" {
|
||||||
|
|
||||||
url := "https://www2.deepl.com/jsonrpc"
|
url := "https://www2.deepl.com/jsonrpc"
|
||||||
id := getRandomNumber()
|
|
||||||
|
id = id + 1
|
||||||
|
|
||||||
post_data := init_data(source_lang, target_lang)
|
post_data := init_data(source_lang, target_lang)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user