mirror of
https://github.com/OwO-Network/DeepLX.git
synced 2025-04-19 14:13:24 +00:00
feat: allow dl_session
via cookie
This commit is contained in:
parent
56c066a316
commit
b44e9b614d
10
main.go
10
main.go
@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* @Author: Vincent Yang
|
* @Author: Vincent Yang
|
||||||
* @Date: 2023-07-01 21:45:34
|
* @Date: 2023-07-01 21:45:34
|
||||||
* @LastEditors: Vincent Yang
|
* @LastEditors: Vincent Young
|
||||||
* @LastEditTime: 2024-04-23 00:42:28
|
* @LastEditTime: 2024-04-23 14:49:35
|
||||||
* @FilePath: /DeepLX/main.go
|
* @FilePath: /DeepLX/main.go
|
||||||
* @Telegram: https://t.me/missuo
|
* @Telegram: https://t.me/missuo
|
||||||
* @GitHub: https://github.com/missuo
|
* @GitHub: https://github.com/missuo
|
||||||
@ -126,6 +126,12 @@ func main() {
|
|||||||
translateText := req.TransText
|
translateText := req.TransText
|
||||||
|
|
||||||
dlSession := cfg.DlSession
|
dlSession := cfg.DlSession
|
||||||
|
|
||||||
|
cookie := c.GetHeader("Cookie")
|
||||||
|
if cookie != "" {
|
||||||
|
dlSession = strings.Replace(cookie, "dl_session=", "", -1)
|
||||||
|
}
|
||||||
|
|
||||||
if dlSession == "" {
|
if dlSession == "" {
|
||||||
c.JSON(http.StatusUnauthorized, gin.H{
|
c.JSON(http.StatusUnauthorized, gin.H{
|
||||||
"code": http.StatusUnauthorized,
|
"code": http.StatusUnauthorized,
|
||||||
|
Loading…
Reference in New Issue
Block a user