diff --git a/backend/main.go b/backend/main.go index 6b04b54..8757460 100644 --- a/backend/main.go +++ b/backend/main.go @@ -465,6 +465,21 @@ func connect() { c.JSON(http.StatusOK, gin.H{ "result": result, }) + + case "get-password": + err := db.QueryRow("SELECT IFNULL(password, '') AS result FROM esign WHERE employeeid = ?", data).Scan(&result) + if err != nil { + if err == sql.ErrNoRows { + result = "0" + } else { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + + } + c.JSON(http.StatusOK, gin.H{ + "result": result, + }) } })