diff --git a/src/main/java/com/fr/plugin/login/theme/fresh/FreshTheme.java b/src/main/java/com/fr/plugin/login/theme/fresh/FreshTheme.java index 86ccfc4..52f0a05 100644 --- a/src/main/java/com/fr/plugin/login/theme/fresh/FreshTheme.java +++ b/src/main/java/com/fr/plugin/login/theme/fresh/FreshTheme.java @@ -38,12 +38,12 @@ public class FreshTheme extends AbstractLoginPageProvider { } @Override - public int imgHeight() { - return 1080; + public int imgWidth() { + return 1920; } @Override - public int imgWidth() { - return 1920; + public int imgHeight() { + return 1080; } } \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/login/theme/fresh/web/js/login.js b/src/main/resources/com/fr/plugin/login/theme/fresh/web/js/login.js index d5b4765..6719877 100644 --- a/src/main/resources/com/fr/plugin/login/theme/fresh/web/js/login.js +++ b/src/main/resources/com/fr/plugin/login/theme/fresh/web/js/login.js @@ -6,7 +6,7 @@ }, _store: function () { - return BI.Models.getModel("dec.model.login"); + return BI.Models.getModel("dec.model.login.fresh"); }, watch: { @@ -14,6 +14,10 @@ render: function () { var self = this, loginConfig = this.model.loginConfig; + + // 调用自定义主题色,可以自行配置 + BI.Services.getService("dec.service.login").initStyles(); + return { type: "bi.htape", cls: "dec-login-fresh", @@ -68,9 +72,20 @@ }, top: 0, right: 89, bottom: 0, left: 89 }] }] - }] + }], + ref: function (_ref) { + self.loginBg = _ref; + } }; + }, + + mounted: function () { + var loginConfig = this.model.loginConfig; + // 使用用户自定义登录背景 + if (loginConfig.loginImg) { + this.loginBg.element.css("backgroundImage", "url(" + Dec.fineServletURL + "/login/image/" + loginConfig.loginImgId + ")"); + } } }); - BI.shortcut("dec.login.custom", Login); + BI.shortcut("dec.login.fresh", Login); })(); \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/login/theme/fresh/web/js/login.model.js b/src/main/resources/com/fr/plugin/login/theme/fresh/web/js/login.model.js new file mode 100644 index 0000000..7acc28e --- /dev/null +++ b/src/main/resources/com/fr/plugin/login/theme/fresh/web/js/login.model.js @@ -0,0 +1,20 @@ +!(function () { + var Model = BI.inherit(Fix.Model, { + _init: function () { + this.loginConfigInfo = Dec.loginConfig || {}; + }, + + state: function () { + return {}; + }, + + computed: { + loginConfig: function () { + return this.loginConfigInfo; + } + }, + + actions: {} + }); + BI.model("dec.model.login.fresh", Model); +})(); \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/login/theme/fresh/web/login_style.png b/src/main/resources/com/fr/plugin/login/theme/fresh/web/login_style.png index 0dfeeb5..d79ef60 100644 Binary files a/src/main/resources/com/fr/plugin/login/theme/fresh/web/login_style.png and b/src/main/resources/com/fr/plugin/login/theme/fresh/web/login_style.png differ diff --git a/src/main/resources/com/fr/plugin/login/theme/fresh/web/theme.js b/src/main/resources/com/fr/plugin/login/theme/fresh/web/theme.js index 361c6c1..1b30c57 100644 --- a/src/main/resources/com/fr/plugin/login/theme/fresh/web/theme.js +++ b/src/main/resources/com/fr/plugin/login/theme/fresh/web/theme.js @@ -6,7 +6,7 @@ }, _store: function () { - return BI.Models.getModel("dec.model.login"); + return BI.Models.getModel("dec.model.login.fresh"); }, watch: { @@ -14,6 +14,10 @@ render: function () { var self = this, loginConfig = this.model.loginConfig; + + // 调用自定义主题色,可以自行配置 + BI.Services.getService("dec.service.login").initStyles(); + return { type: "bi.htape", cls: "dec-login-fresh", @@ -68,13 +72,45 @@ }, top: 0, right: 89, bottom: 0, left: 89 }] }] - }] + }], + ref: function (_ref) { + self.loginBg = _ref; + } }; + }, + + mounted: function () { + var loginConfig = this.model.loginConfig; + // 使用用户自定义登录背景 + if (loginConfig.loginImg) { + this.loginBg.element.css("backgroundImage", "url(" + Dec.fineServletURL + "/login/image/" + loginConfig.loginImgId + ")"); + } } }); - BI.shortcut("dec.login.custom", Login); + BI.shortcut("dec.login.fresh", Login); +})(); +!(function () { + var Model = BI.inherit(Fix.Model, { + _init: function () { + this.loginConfigInfo = Dec.loginConfig || {}; + }, + state: function () { + return {}; + }, + + computed: { + loginConfig: function () { + return this.loginConfigInfo; + } + }, + + actions: {} + }); + BI.model("dec.model.login.fresh", Model); +})(); +!(function () { BI.config("dec.login", function (ob) { - return BI.extend(ob, {type: "dec.login.custom"}); + return BI.extend(ob, {type: "dec.login.fresh"}); }); })(); \ No newline at end of file