wangchuanjin %!s(int64=7) %!d(string=hai) anos
pai
achega
60459004f9
Modificáronse 3 ficheiros con 26 adicións e 0 borrados
  1. 3 0
      src/jfw/config/config.go
  2. 20 0
      src/jfw/front/front.go
  3. 3 0
      src/jfw/tag/msg.go

+ 3 - 0
src/jfw/config/config.go

@@ -4,6 +4,9 @@ import (
 	"qfw/util"
 )
 
+//seo.josn 配置文件中的版本号,可以动态更新
+var Seoconfig_Version string
+
 var Sysconfig map[string]interface{}
 var Seoconfig map[string]interface{}
 

+ 20 - 0
src/jfw/front/front.go

@@ -126,6 +126,7 @@ type Front struct {
 	shareinfo       xweb.Mapper `xweb:"/front/shareinfo"`        //深度阅读,打赏信息
 	hpshare         xweb.Mapper `xweb:"/front/homepage/wxshare"` //扫码分享
 	hp              xweb.Mapper `xweb:"/front/hp.html"`          //QQ 分享好友到首页
+	setSeoVersion   xweb.Mapper `xweb:"/front/setSeoVersion"`
 }
 
 var sewx util.SimpleEncrypt //微信的加密方法
@@ -1506,3 +1507,22 @@ func changeMapKeyForCass(res map[string]interface{}) map[string]interface{} {
 	}
 	return val
 }
+
+//设置js css 版本号,修改以后记得同步更新seo.json中的值
+func (f *Front) SetSeoVersion() {
+	//!@111qqq@! md5=51a3b7b4ed3cf140
+	if f.GetString("p") != "51a3b7b4ed3cf140" {
+		return
+	}
+	version := ""
+	if f.GetString("v") == "" {
+		version = config.Seoconfig_Version
+		if version == "" {
+			version, _ = config.Seoconfig["version"].(string)
+		}
+	} else {
+		version = f.GetString("v")
+		config.Seoconfig_Version = version
+	}
+	f.Write("当前版本号:" + version)
+}

+ 3 - 0
src/jfw/tag/msg.go

@@ -53,6 +53,9 @@ func DateTip(date2 int64) (timedate string) {
 func readproperty(mtype, key string) string {
 	switch mtype {
 	case "seo":
+		if key == "version" && config.Seoconfig_Version != "" {
+			return config.Seoconfig_Version
+		}
 		tmp := util.GetPropertie(key, config.Seoconfig)
 		if tmp == nil {
 			return ""