diff --git a/hrp/internal/version/VERSION b/hrp/internal/version/VERSION new file mode 100644 index 00000000..7aa76f1c --- /dev/null +++ b/hrp/internal/version/VERSION @@ -0,0 +1 @@ +v5.4.0 \ No newline at end of file diff --git a/internal/version/VERSION b/internal/version/VERSION index 81d96d83..c541ebc1 100644 --- a/internal/version/VERSION +++ b/internal/version/VERSION @@ -1 +1 @@ -v5.0.0+2502192152 +v5.3.4 \ No newline at end of file diff --git a/pkg/uixt/browser_web_driver.go b/pkg/uixt/browser_web_driver.go index 7a803216..598b2abc 100644 --- a/pkg/uixt/browser_web_driver.go +++ b/pkg/uixt/browser_web_driver.go @@ -223,7 +223,7 @@ func (wd *BrowserWebDriver) tapBySelector(selector string, options ...option.Act return err } -func (wd *BrowserWebDriver) RightClick(x, y int) (err error) { +func (wd *BrowserWebDriver) RightClick(x, y float64) (err error) { data := map[string]interface{}{ "x": x, "y": y, diff --git a/pkg/uixt/driver.go b/pkg/uixt/driver.go index dd39f3e4..bfb165c8 100644 --- a/pkg/uixt/driver.go +++ b/pkg/uixt/driver.go @@ -116,7 +116,7 @@ type IXTDriver interface { type IBrowserWebDriver interface { IDriver Hover(x, y float64) (err error) - RightClick(x, y int) (err error) + RightClick(x, y float64) (err error) Scroll(delta int) (err error) UploadFile(x, y float64, FileUrl, FileFormat string) (err error) } diff --git a/pkg/uixt/driver_ext/browser_sub_driver.go b/pkg/uixt/driver_ext/browser_sub_driver.go index 8bdedef6..ca939207 100644 --- a/pkg/uixt/driver_ext/browser_sub_driver.go +++ b/pkg/uixt/driver_ext/browser_sub_driver.go @@ -124,14 +124,15 @@ func (wd *StubBrowserDriver) LoginNoneUI(packageName, phoneNumber string, captch "url": packageName, "web_cookie": password, } - _, err = wd.HttpPOST(data, wd.sessionId, "stub/login") + resp, err := wd.HttpPOST(data, wd.sessionId, "stub/login") if err != nil { return info, err } + respdata := resp.Data.(map[string]interface{}) loginSuccss := AppLoginInfo{ IsLogin: true, - Uid: wd.sessionId, + Uid: respdata["webid"].(string), Did: password, } return loginSuccss, err diff --git a/server/main.go b/server/main.go index ee18f7e2..336c2537 100644 --- a/server/main.go +++ b/server/main.go @@ -44,6 +44,7 @@ func (r *Router) Init() { // UI operations apiV1PlatformSerial.POST("/ui/tap", r.tapHandler) + apiV1PlatformSerial.POST("/ui/right_click", r.rightClickHandler) apiV1PlatformSerial.POST("/ui/double_tap", r.doubleTapHandler) apiV1PlatformSerial.POST("/ui/drag", r.dragHandler) apiV1PlatformSerial.POST("/ui/input", r.inputHandler) diff --git a/server/ui.go b/server/ui.go index 962ddbcd..9a6a7fb5 100644 --- a/server/ui.go +++ b/server/ui.go @@ -29,6 +29,24 @@ func (r *Router) tapHandler(c *gin.Context) { RenderSuccess(c, true) } +func (r *Router) rightClickHandler(c *gin.Context) { + var rightClickReq TapRequest + if err := c.ShouldBindJSON(&rightClickReq); err != nil { + RenderErrorValidateRequest(c, err) + return + } + driver, err := r.GetDriver(c) + if err != nil { + return + } + err = driver.GetWebDriver().RightClick(rightClickReq.X, rightClickReq.Y) + if err != nil { + RenderError(c, err) + return + } + RenderSuccess(c, true) +} + func (r *Router) uploadHandler(c *gin.Context) { var uploadRequest uploadRequest if err := c.ShouldBindJSON(&uploadRequest); err != nil {