mirror of
https://github.com/KaySar12/NextZen-UserService.git
synced 2025-03-15 15:15:35 +07:00
update
This commit is contained in:
parent
465e77832e
commit
75abc7e651
2
.gitignore
vendored
2
.gitignore
vendored
@ -31,3 +31,5 @@ linux-amd64-nextzenos-user-service-v1.3.tar.gz
|
||||
build/sysroot/usr/bin/casaos-user-service
|
||||
dist/casaos-user-service-amd64_linux_amd64_v1/build/sysroot/usr/bin/casaos-user-service
|
||||
/build/scripts/setup
|
||||
dist/casaos-user-service-amd64_linux_amd64_v1/build/sysroot/usr/bin/casaos-user-service
|
||||
linux-amd64-nextzenos-user-service-v1.3.0.tar.gz
|
||||
|
Binary file not shown.
2
dist/metadata.json
vendored
2
dist/metadata.json
vendored
@ -1 +1 @@
|
||||
{"project_name":"casaos-user-service","tag":"v1.0.0","previous_tag":"","version":"1.0.1","commit":"219fa12590c7ebbe57526514ffea6ac2b2e63641","date":"2024-07-05T17:28:10.805445951+07:00","runtime":{"goos":"linux","goarch":"amd64"}}
|
||||
{"project_name":"casaos-user-service","tag":"v1.0.0","previous_tag":"","version":"1.0.1","commit":"465e77832e1cc9c31bfae697a1afc19d1608de6a","date":"2024-07-10T11:01:06.016968262+07:00","runtime":{"goos":"linux","goarch":"amd64"}}
|
@ -28,6 +28,7 @@ func InitRouter() *gin.Engine {
|
||||
r.POST("/v1/users/register", v1.PostUserRegister)
|
||||
r.POST("/v1/users/login", v1.PostUserLogin)
|
||||
r.POST("/v1/users/omvlogin", v1.PostOMVLogin)
|
||||
r.POST("/v1/users/logout", v1.PostLogout)
|
||||
r.GET("/v1/users/name", v1.GetUserAllUsername) // all/name
|
||||
r.POST("/v1/users/refresh", v1.PostUserRefreshToken)
|
||||
// No short-term modifications
|
||||
|
@ -99,7 +99,6 @@ func PostUserRegister(c *gin.Context) {
|
||||
user.Username = username
|
||||
user.Password = encryption.GetMD5ByStr(pwd)
|
||||
user.Role = role
|
||||
// user.Role = "user"
|
||||
user = service.MyService.User().CreateUser(user)
|
||||
if user.Id == 0 {
|
||||
c.JSON(common_err.SERVICE_ERROR, model.Result{Success: common_err.SERVICE_ERROR, Message: common_err.GetMsg(common_err.SERVICE_ERROR)})
|
||||
@ -263,6 +262,18 @@ func PostOMVLogin(c *gin.Context) {
|
||||
})
|
||||
|
||||
}
|
||||
func PostLogout(c *gin.Context) {
|
||||
cookies := c.Request.Cookies()
|
||||
for _, cookie := range cookies {
|
||||
// Set the cookie to expire immediately
|
||||
c.SetCookie(cookie.Name, "", -1, "/", "", false, true)
|
||||
}
|
||||
c.JSON(common_err.SUCCESS,
|
||||
model.Result{
|
||||
Success: common_err.SUCCESS,
|
||||
Message: common_err.GetMsg(common_err.SUCCESS),
|
||||
})
|
||||
}
|
||||
|
||||
func isEmpty(obj interface{}) bool {
|
||||
jsonData, err := json.Marshal(obj)
|
||||
|
Loading…
Reference in New Issue
Block a user