feat: now server part supports multiple channels for the same type (#50)
This commit is contained in:
+6
-36
@@ -389,45 +389,15 @@ func UpdateSelf(c *gin.Context) {
|
||||
})
|
||||
return
|
||||
}
|
||||
originUser, err := model.GetUserById(c.GetInt("id"), true)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"success": false,
|
||||
"message": err.Error(),
|
||||
})
|
||||
return
|
||||
}
|
||||
// White list mode. For safe :)
|
||||
cleanUser := model.User{
|
||||
Id: c.GetInt("id"),
|
||||
Username: user.Username,
|
||||
Password: user.Password,
|
||||
DisplayName: user.DisplayName,
|
||||
Token: user.Token,
|
||||
Channel: user.Channel,
|
||||
WeChatTestAccountId: user.WeChatTestAccountId,
|
||||
WeChatTestAccountSecret: user.WeChatTestAccountSecret,
|
||||
WeChatTestAccountTemplateId: user.WeChatTestAccountTemplateId,
|
||||
WeChatTestAccountOpenId: user.WeChatTestAccountOpenId,
|
||||
WeChatTestAccountVerificationToken: user.WeChatTestAccountVerificationToken,
|
||||
WeChatCorpAccountId: user.WeChatCorpAccountId,
|
||||
WeChatCorpAccountAgentSecret: user.WeChatCorpAccountAgentSecret,
|
||||
WeChatCorpAccountAgentId: user.WeChatCorpAccountAgentId,
|
||||
WeChatCorpAccountUserId: user.WeChatCorpAccountUserId,
|
||||
WeChatCorpAccountClientType: user.WeChatCorpAccountClientType,
|
||||
CorpWebhookURL: user.CorpWebhookURL,
|
||||
LarkWebhookURL: user.LarkWebhookURL,
|
||||
LarkWebhookSecret: user.LarkWebhookSecret,
|
||||
DingWebhookURL: user.DingWebhookURL,
|
||||
DingWebhookSecret: user.DingWebhookSecret,
|
||||
BarkServer: user.BarkServer,
|
||||
BarkSecret: user.BarkSecret,
|
||||
ClientSecret: user.ClientSecret,
|
||||
TelegramBotToken: user.TelegramBotToken,
|
||||
TelegramChatId: user.TelegramChatId,
|
||||
DiscordWebhookURL: user.DiscordWebhookURL,
|
||||
Id: c.GetInt("id"),
|
||||
Username: user.Username,
|
||||
Password: user.Password,
|
||||
DisplayName: user.DisplayName,
|
||||
Token: user.Token,
|
||||
Channel: user.Channel,
|
||||
}
|
||||
channel.TokenStoreUpdateUser(&cleanUser, originUser)
|
||||
|
||||
if user.Password == "$I_LOVE_U" {
|
||||
user.Password = "" // rollback to what it should be
|
||||
|
||||
Reference in New Issue
Block a user