mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-08 14:10:30 +08:00
实现公用的IP名单
This commit is contained in:
30
internal/web/actions/default/ui/hideTip.go
Normal file
30
internal/web/actions/default/ui/hideTip.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
|
||||
|
||||
package ui
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/iwind/TeaGo/Tea"
|
||||
"io/ioutil"
|
||||
)
|
||||
|
||||
type HideTipAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *HideTipAction) RunPost(params struct {
|
||||
Code string
|
||||
}) {
|
||||
tipKeyLocker.Lock()
|
||||
tipKeyMap[params.Code] = true
|
||||
tipKeyLocker.Unlock()
|
||||
|
||||
// 保存到文件
|
||||
tipJSON, err := json.Marshal(tipKeyMap)
|
||||
if err == nil {
|
||||
_ = ioutil.WriteFile(Tea.ConfigFile(tipConfigFile), tipJSON, 0666)
|
||||
}
|
||||
|
||||
this.Success()
|
||||
}
|
||||
Reference in New Issue
Block a user