mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 20:40:26 +08:00
31 lines
584 B
Go
31 lines
584 B
Go
// 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"
|
|
"os"
|
|
)
|
|
|
|
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 {
|
|
_ = os.WriteFile(Tea.ConfigFile(tipConfigFile), tipJSON, 0666)
|
|
}
|
|
|
|
this.Success()
|
|
}
|