HeXuShi / HeXuShi.Extensions

change www.site.com to site.com in asp.net core web app.
Apache License 2.0
1 stars 0 forks source link

JumpToCN Provide complex call interfaces #3

Open JohnHe404 opened 5 years ago

JohnHe404 commented 5 years ago

like this ComplexJumpToCN

Simple interfaces and complex call interfaces must be distinguished,

class JumpToCNMiddleware accept an enumeration parameter:

  1. default
  2. Toggle in the a specific suffix
  3. Toggle in the a particular domain name

Provided features 1) .cn suffix name, and other suffix names 2) Other suffixes (such as the .io suffix, used in mainland China), and other suffixes (used in non-Chinese mainland regions) 3) Other domain names, and other domain names (non-Chinese mainland) 4) Switch between suffix name and cached domain name (non-Chinese mainland) 5) Switch between domain name and cached domain name (non-Chinese mainland)

Other special environments, such as multiple non-Chinese mainland domain names, have not thought of a good way. I feel that you should designate a non-Chinese mainland domain name.

JohnHe404 commented 5 years ago

Cached to doesn't make sense, because if the current access is Chinese ip, you won't be able to judge, or keep the current state by default.

JohnHe404 commented 5 years ago

https://github.com/HeXuShi/HeXuShi.Extensions/commit/d00a9871bced5ce9872b961d9faab8a844fa3d3f

https://github.com/HeXuShi/HeXuShi.Extensions/commit/2d4bb9722dea44b231a4d68fcdb0031f87925cf2

JohnHe404 commented 5 years ago
public enum JumpOption
{
    OnlyTo_SpecSuffix,//Only jump to specify suffix
    OnlyTo_SpecDomain,//Only jump to specify domain
    SuffixTo_SpecSuffix,//specify suffix to specify suffix,
    DomainTo_SpecDomain,//specify domain to specify domain,
}
JohnHe404 commented 5 years ago

Document not yet completed