Added get-password

This commit is contained in:
Patrick Alvin Alcala 2025-09-26 17:31:59 +08:00
parent 2f6a1572dd
commit 011460a533

View file

@ -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,
})
}
})