我喜欢b站-1010(4)
}
func (this *app) Init(domain string) {
this.Domain = config.ConfigFile.MustValue("global", "domain", domain)
}
func (this *app) SetUptime() {
this.locker.Lock()
defer this.locker.Unlock()
this.Uptime = time.Now().Sub(this.LaunchTime)
}
func (this *app) SetCopyright() {
curYear := time.Now().Year()
this.locker.Lock()
defer this.locker.Unlock()
if curYear == model.WebsiteSetting.StartYear {
this.Copyright = fmt.Sprintf("%d %s", model.WebsiteSetting.StartYear, model.WebsiteSetting.Domain)
} else {
this.Copyright = fmt.Sprintf("%d-%d %s", model.WebsiteSetting.StartYear, curYear, model.WebsiteSetting.Domain)
}
}
func (this *app) CanonicalCDN(isHTTPS bool) string {