Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(os/gsession): add session reset function. #3726

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

lxy1151
Copy link

@lxy1151 lxy1151 commented Aug 14, 2024

session模块:增加了session重置方法。
使用 场景:
重新登录后使原来的sessionId过期,新生成一个sessionId

林孝义 and others added 8 commits July 31, 2024 16:48
@hailaz
Copy link
Member

hailaz commented Aug 15, 2024

session模块:增加了session重置方法。

多语言翻译中TranslateFormat方法增加了动态参数与位置无关的处理(部分翻译在不同语言动态参数位置会变化)。

如果包含两个功能的修改,可以拆分为两个pr提交,这样不会相互影响,也能提高代码审批的效率。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Session module: Added session reset method.

The TranslateFormat method in multi-language translation adds position-independent processing of dynamic parameters (some translations will change the position of dynamic parameters in different languages).

If it contains modifications to two functions, it can be split into two PR submissions, so that they will not affect each other and improve the efficiency of code approval.

林孝义 added 2 commits August 15, 2024 16:59
修改多语言替换和参数无关
还原无关文件
修改多语言替换和参数无关
还原无关文件
处理测试不通过问题
Copy link

sonarcloud bot commented Aug 16, 2024

@lxy1151
Copy link
Author

lxy1151 commented Aug 18, 2024

session模块:增加了session重置方法。
多语言翻译中TranslateFormat方法增加了动态参数与位置无关的处理(部分翻译在不同语言动态参数位置会变化)。

如果包含两个功能的修改,可以拆分为两个pr提交,这样不会相互影响,也能提高代码审批的效率。
好的,下次尽量单一功能提交

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Session module: Added session reset method.
The TranslateFormat method in multi-language translation adds position-independent processing of dynamic parameters (some translations will change the position of dynamic parameters in different languages).

If it contains modifications to two functions, it can be split into two PR submissions, so that they will not affect each other and improve the efficiency of code approval.
Okay, try to submit a single function next time

return result
}
}
return fmt.Sprintf(result, values...)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lxy1151 请先拆分pr,一个pr只做一个事情。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,我先处理下

@gqcn
Copy link
Member

gqcn commented Sep 23, 2024

@lxy1151 Any updates?

@lxy1151
Copy link
Author

lxy1151 commented Sep 26, 2024

@lxy1151 Any updates?

I have processed it, please recheck!

@lxy1151 lxy1151 changed the title feat(os/gsession): add session reset function. fix(i18n/gi18n_manager): TranslateFormat bug fixed feat(os/gsession): add session reset function. Sep 26, 2024
@lxy1151 lxy1151 requested a review from gqcn September 26, 2024 06:22
@@ -155,6 +157,33 @@ func (s *Session) Remove(keys ...string) (err error) {
return nil
}

func (s *Session) RegenSession(delOld ...bool) (newSid string, err error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请描述增加此方法的必要性,例如需要解决什么样的业务场景痛点?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没有这个方法,sessionId始终不能过期。
每次登录时要求上次的sessionId过期,无法实现,特此加了该方法

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个怎么说,还需修改什么吗?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直接使用RemoveAll不就行了呢。

@lxy1151 lxy1151 requested a review from gqcn September 29, 2024 01:31
@@ -155,6 +157,33 @@ func (s *Session) Remove(keys ...string) (err error) {
return nil
}

func (s *Session) RegenSession(delOld ...bool) (newSid string, err error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直接使用RemoveAll不就行了呢。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants