diff --git a/docs/changelog/index.md b/docs/changelog/index.md index 0bca57e..974abf9 100644 --- a/docs/changelog/index.md +++ b/docs/changelog/index.md @@ -4,6 +4,7 @@ - NPC 安装到系统服务失败 BUG [#338](https://github.com/yisier/nps/issues/338) - 隧道实际未运行但面板提示「启动成功」、运行状态始终为关闭的问题 [#339](https://github.com/yisier/nps/issues/339) - 配置 `allow_ports` 后随机生成端口问题 [#339](https://github.com/yisier/nps/issues/339) + - Web 面板`languages.xml`使用 NPS 版本号作为缓存标识 [#342](https://github.com/yisier/nps/issues/342) - 新增: - 客户端、隧道、域名解析修改接口支持修改流量数据 [#341](https://github.com/yisier/nps/issues/341) diff --git a/web/controllers/login.go b/web/controllers/login.go index 2e849ad..0fc1d1f 100755 --- a/web/controllers/login.go +++ b/web/controllers/login.go @@ -10,6 +10,7 @@ import ( "ehang.io/nps/lib/common" "ehang.io/nps/lib/file" + "ehang.io/nps/lib/version" "ehang.io/nps/server" "github.com/astaxie/beego" ) @@ -41,6 +42,7 @@ func (self *LoginController) Index() { self.Data["web_base_url"] = webBaseUrl self.Data["register_allow"], _ = beego.AppConfig.Bool("allow_user_register") self.Data["captcha_open"], _ = beego.AppConfig.Bool("open_captcha") + self.Data["version"] = version.VERSION self.TplName = "login/index.html" } @@ -125,6 +127,7 @@ func (self *LoginController) doLogin(username, password string, explicit bool) b func (self *LoginController) Register() { if self.Ctx.Request.Method == "GET" { self.Data["web_base_url"] = beego.AppConfig.String("web_base_url") + self.Data["version"] = version.VERSION self.TplName = "login/register.html" } else { if b, err := beego.AppConfig.Bool("allow_user_register"); err != nil || !b { diff --git a/web/static/js/language.js b/web/static/js/language.js index 9231500..abf4c2a 100644 --- a/web/static/js/language.js +++ b/web/static/js/language.js @@ -59,7 +59,7 @@ $.fn.cloudLang = function () { $.ajax({ type: 'GET', - url: window.nps.web_base_url + '/static/page/languages.xml?v=202512051', + url: window.nps.web_base_url + '/static/page/languages.xml?v=' + window.nps.version, dataType: 'xml', success: function (xml) { languages['content'] = xml2json($(xml).children())['content']; diff --git a/web/views/login/index.html b/web/views/login/index.html index 77d3904..61f3155 100644 --- a/web/views/login/index.html +++ b/web/views/login/index.html @@ -97,7 +97,7 @@