mirror of
https://github.com/KaySar12/NextZen-UserService.git
synced 2025-06-26 13:40:58 +07:00
suppport multiple users
This commit is contained in:
parent
11de9608cd
commit
2e845d29b7
3
.gitignore
vendored
3
.gitignore
vendored
@ -27,3 +27,6 @@ dist/
|
|||||||
.package-lock.json
|
.package-lock.json
|
||||||
*.sh
|
*.sh
|
||||||
build/scripts/setup/service.d/user-service/ubuntu/setup-user-service.sh
|
build/scripts/setup/service.d/user-service/ubuntu/setup-user-service.sh
|
||||||
|
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
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package common
|
package common
|
||||||
|
|
||||||
const Version = "0.4.8"
|
const Version = "1.3.0"
|
||||||
const SERVICENAME = "CasaOS-UserService"
|
const SERVICENAME = "CasaOS-UserService"
|
||||||
|
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":"cd28792c154027bebe695a5be5eef33d65dce067","date":"2024-06-29T11:38:52.713569836+07:00","runtime":{"goos":"linux","goarch":"amd64"}}
|
{"project_name":"casaos-user-service","tag":"v1.0.0","previous_tag":"","version":"1.0.1","commit":"11de9608cd1105075bc3ac12d2130eb30d3c8004","date":"2024-07-01T02:10:13.880324864+07:00","runtime":{"goos":"linux","goarch":"amd64"}}
|
@ -48,6 +48,7 @@ func PostUserRegister(c *gin.Context) {
|
|||||||
username := json["username"]
|
username := json["username"]
|
||||||
pwd := json["password"]
|
pwd := json["password"]
|
||||||
key := json["key"]
|
key := json["key"]
|
||||||
|
role := json["role"]
|
||||||
if _, ok := service.UserRegisterHash[key]; !ok {
|
if _, ok := service.UserRegisterHash[key]; !ok {
|
||||||
c.JSON(common_err.CLIENT_ERROR,
|
c.JSON(common_err.CLIENT_ERROR,
|
||||||
model.Result{Success: common_err.KEY_NOT_EXIST, Message: common_err.GetMsg(common_err.KEY_NOT_EXIST)})
|
model.Result{Success: common_err.KEY_NOT_EXIST, Message: common_err.GetMsg(common_err.KEY_NOT_EXIST)})
|
||||||
@ -74,7 +75,7 @@ func PostUserRegister(c *gin.Context) {
|
|||||||
user := model2.UserDBModel{}
|
user := model2.UserDBModel{}
|
||||||
user.Username = username
|
user.Username = username
|
||||||
user.Password = encryption.GetMD5ByStr(pwd)
|
user.Password = encryption.GetMD5ByStr(pwd)
|
||||||
user.Role = "admin"
|
user.Role = role
|
||||||
// user.Role = "user"
|
// user.Role = "user"
|
||||||
user = service.MyService.User().CreateUser(user)
|
user = service.MyService.User().CreateUser(user)
|
||||||
if user.Id == 0 {
|
if user.Id == 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user