1
0
forked from x/icebergs

fix sessauth

This commit is contained in:
root 2023-12-12 12:39:06 +08:00
parent 3ce839ecc9
commit a4573dd54a

View File

@ -60,7 +60,7 @@ func SessAuth(m *ice.Message, value ice.Any, arg ...string) *ice.Message {
kit.If(language == "", func() { language = kit.Select("", "zh-cn", strings.Contains(m.Option(ice.MSG_USERUA), "zh_CN")) }) kit.If(language == "", func() { language = kit.Select("", "zh-cn", strings.Contains(m.Option(ice.MSG_USERUA), "zh_CN")) })
kit.If(language == "" && m.R != nil, func() { language = kit.Select("", kit.Split(m.R.Header.Get(html.AcceptLanguage), ",;"), 0) }) kit.If(language == "" && m.R != nil, func() { language = kit.Select("", kit.Split(m.R.Header.Get(html.AcceptLanguage), ",;"), 0) })
kit.If(language == "", func() { language = ice.Info.Lang }) kit.If(language == "", func() { language = ice.Info.Lang })
language = strings.ReplaceAll(strings.ToLower(kit.Split(language, " .")[0]), "_", "-") language = strings.ReplaceAll(strings.ToLower(kit.Select("", kit.Split(language, " ."), 0)), "_", "-")
return m.Auth( return m.Auth(
USERNICK, m.Option(ice.MSG_USERNICK, kit.Format(kit.Value(value, USERNICK))), USERNICK, m.Option(ice.MSG_USERNICK, kit.Format(kit.Value(value, USERNICK))),
USERNAME, m.Option(ice.MSG_USERNAME, kit.Format(kit.Value(value, USERNAME))), USERNAME, m.Option(ice.MSG_USERNAME, kit.Format(kit.Value(value, USERNAME))),