🐛 Fix get user info query statement bug

This commit is contained in:
LittleSheep 2024-11-17 01:05:11 +08:00
parent 4695a617d7
commit 8e1ed67c48
2 changed files with 5 additions and 5 deletions

View File

@ -4,7 +4,7 @@
<option name="autoReloadType" value="ALL" />
</component>
<component name="ChangeListManager">
<list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":sparkles: Allow get realm by numeric auto increment id">
<list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":sparkles: Allow access user info via numeric id">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pkg/internal/http/api/userinfo_api.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/http/api/userinfo_api.go" afterDir="false" />
</list>
@ -159,7 +159,6 @@
</component>
<component name="VcsManagerConfiguration">
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
<MESSAGE value=":bug: Bug fixes on compile time" />
<MESSAGE value=":bug: Fix notification order" />
<MESSAGE value=":bug: Fix notification order... again" />
<MESSAGE value=":bug: Trying to fix panic" />
@ -184,7 +183,8 @@
<MESSAGE value=":sparkles: Authkit can get user" />
<MESSAGE value=":bug: Fix auth cache" />
<MESSAGE value=":sparkles: Allow get realm by numeric auto increment id" />
<option name="LAST_COMMIT_MESSAGE" value=":sparkles: Allow get realm by numeric auto increment id" />
<MESSAGE value=":sparkles: Allow access user info via numeric id" />
<option name="LAST_COMMIT_MESSAGE" value=":sparkles: Allow access user info via numeric id" />
<option name="GROUP_MULTIFILE_MERGE_BY_DIRECTORY" value="true" />
</component>
<component name="VgoProject">

View File

@ -15,11 +15,11 @@ import (
func getOtherUserinfo(c *fiber.Ctx) error {
alias := c.Params("alias")
tx := database.C.Where("name = ?")
tx := database.C.Where("name = ?", alias)
numericId, err := strconv.Atoi(alias)
if err == nil {
tx = tx.Where("id = ?", numericId)
tx = tx.Or("id = ?", numericId)
}
var account models.Account