优化交互

This commit is contained in:
刘祥超
2021-06-06 09:22:59 +08:00
parent abc5162bca
commit 7cbfa2458b
7 changed files with 66 additions and 6 deletions

View File

@@ -68,7 +68,7 @@ func (this *AddPopupAction) RunPost(params struct {
addr := params.Addr
// 是否是完整的地址
if params.Protocol == "http" || params.Protocol == "https" {
if (params.Protocol == "http" || params.Protocol == "https") && regexp.MustCompile(`^(http|https)://`).MatchString(addr) {
u, err := url.Parse(addr)
if err == nil {
addr = u.Host

View File

@@ -122,7 +122,7 @@ func (this *UpdatePopupAction) RunPost(params struct {
addr := params.Addr
// 是否是完整的地址
if params.Protocol == "http" || params.Protocol == "https" {
if (params.Protocol == "http" || params.Protocol == "https") && regexp.MustCompile(`^(http|https)://`).MatchString(addr) {
u, err := url.Parse(addr)
if err == nil {
addr = u.Host