mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 05:00:25 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			23 lines
		
	
	
		
			455 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			455 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package ui
 | 
						|
 | 
						|
import (
 | 
						|
	"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
 | 
						|
)
 | 
						|
 | 
						|
// DownloadAction 下载指定的文本内容
 | 
						|
type DownloadAction struct {
 | 
						|
	actionutils.ParentAction
 | 
						|
}
 | 
						|
 | 
						|
func (this *DownloadAction) Init() {
 | 
						|
	this.Nav("", "", "")
 | 
						|
}
 | 
						|
 | 
						|
func (this *DownloadAction) RunGet(params struct {
 | 
						|
	File string
 | 
						|
	Text string
 | 
						|
}) {
 | 
						|
	this.AddHeader("Content-Disposition", "attachment; filename=\""+params.File+"\";")
 | 
						|
	this.WriteString(params.Text)
 | 
						|
}
 |