diff --git a/README.md b/README.md index b60ce84..224c402 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ # open-JSD-8481 -JSD-8481 不同域名不同登录页 开源任务材料 \ No newline at end of file +JSD-8481 不同域名不同登录页 开源任务材料\ +免责说明:该源码为第三方爱好者提供,不保证源码和方案的可靠性,也不提供任何形式的源码教学指导和协助!\ +仅作为开发者学习参考使用!禁止用于任何商业用途!\ +为保护开发者隐私,开发者信息已隐去!若原开发者希望公开自己的信息,可联系hugh处理。 \ No newline at end of file diff --git a/plugin.xml b/plugin.xml new file mode 100644 index 0000000..e1e3055 --- /dev/null +++ b/plugin.xml @@ -0,0 +1,18 @@ + + com.fr.plugin.dfui + + yes + 1.0.4 + 10.0 + 2018-07-31 + fr.open + + + com.fr.plugin.dfui + + + + + + \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/dfui/webresource/WebResourceProvider.java b/src/main/java/com/fr/plugin/dfui/webresource/WebResourceProvider.java new file mode 100644 index 0000000..4878f2d --- /dev/null +++ b/src/main/java/com/fr/plugin/dfui/webresource/WebResourceProvider.java @@ -0,0 +1,37 @@ +package com.fr.plugin.dfui.webresource; + +import com.fr.decision.fun.impl.AbstractWebResourceProvider; +import com.fr.decision.web.LoginComponent; +import com.fr.decision.web.MainComponent; +import com.fr.plugin.transform.FunctionRecorder; +import com.fr.web.struct.Atom; +import com.fr.web.struct.Component; +import com.fr.web.struct.browser.RequestClient; +import com.fr.web.struct.category.ScriptPath; +import com.fr.web.struct.category.StylePath; + +/** + * Created by zhouping on 2019/1/16. + */ +@FunctionRecorder +public class WebResourceProvider extends AbstractWebResourceProvider { + @Override + public Atom attach() { + return LoginComponent.KEY; + } + + @Override + public Atom client() { + return new Component() { + @Override + public ScriptPath script(RequestClient requestClient) { + return ScriptPath.build("/com/fr/plugin/dfui/js/plugin.js"); + } + + @Override + public StylePath style(RequestClient requestClient) { + return StylePath.build("/com/fr/plugin/dfui/css/plugin.css"); + } + }; + } +} diff --git a/src/main/resources/com/fr/plugin/dfui/css/plugin.css b/src/main/resources/com/fr/plugin/dfui/css/plugin.css new file mode 100644 index 0000000..dc27e1c --- /dev/null +++ b/src/main/resources/com/fr/plugin/dfui/css/plugin.css @@ -0,0 +1,44 @@ +body { + color: #FBFBFB; +} +body input { + color: #9ea6b2; +} +.login-area { + max-width:80% + /*min-width: 270px;*/ + /*max-width: 370px;*/ +} +.login-area .edit-area { + background-color: rgba(17, 34, 78, 0.71); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#b511224e,endColorstr=#b511224e); + border: 1px solid rgba(131, 194, 255, 0.22); + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; +} +.login-area .edit-area .dec-login-demo-title { + font-size: 16px; +} +.login-area .edit-area .dec-login-item .bi-border-top.bi-text { + border-color: #3d4d66; +} + + +/*.dec-login-fresh {*/ +/* !*background: url('resources?path=com/fr/plugin/dfui/image/1.png') no-repeat center center;*!*/ +/* _filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='${fineServletURL}/resources?path=com/fr/plugin/dfui/image/1.png');*/ +/* background-size: contain;*/ +/* _background: none;*/ +/*}*/ +/*.dec-login-fresh.hack {*/ +/* !*background: url('resources?path=com/fr/plugin/dfui/image/1.png') no-repeat center center;*!*/ +/* _filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='${fineServletURL}/resources?path=com/fr/plugin/dfui/image/1.png');*/ +/* _background: none;*/ +/*}*/ +/*.dec-login-fresh {*/ +/* background-size: cover;*/ +/*}*/ + + + diff --git a/src/main/resources/com/fr/plugin/dfui/image/1.1.png b/src/main/resources/com/fr/plugin/dfui/image/1.1.png new file mode 100644 index 0000000..1cd2f02 Binary files /dev/null and b/src/main/resources/com/fr/plugin/dfui/image/1.1.png differ diff --git a/src/main/resources/com/fr/plugin/dfui/image/1.png b/src/main/resources/com/fr/plugin/dfui/image/1.png new file mode 100644 index 0000000..07320f7 Binary files /dev/null and b/src/main/resources/com/fr/plugin/dfui/image/1.png differ diff --git a/src/main/resources/com/fr/plugin/dfui/image/2.2.png b/src/main/resources/com/fr/plugin/dfui/image/2.2.png new file mode 100644 index 0000000..15da716 Binary files /dev/null and b/src/main/resources/com/fr/plugin/dfui/image/2.2.png differ diff --git a/src/main/resources/com/fr/plugin/dfui/image/2.png b/src/main/resources/com/fr/plugin/dfui/image/2.png new file mode 100644 index 0000000..a749fe6 Binary files /dev/null and b/src/main/resources/com/fr/plugin/dfui/image/2.png differ diff --git a/src/main/resources/com/fr/plugin/dfui/image/3.3.png b/src/main/resources/com/fr/plugin/dfui/image/3.3.png new file mode 100644 index 0000000..86ccccc Binary files /dev/null and b/src/main/resources/com/fr/plugin/dfui/image/3.3.png differ diff --git a/src/main/resources/com/fr/plugin/dfui/image/3.png b/src/main/resources/com/fr/plugin/dfui/image/3.png new file mode 100644 index 0000000..3e051b8 Binary files /dev/null and b/src/main/resources/com/fr/plugin/dfui/image/3.png differ diff --git a/src/main/resources/com/fr/plugin/dfui/js/plugin.js b/src/main/resources/com/fr/plugin/dfui/js/plugin.js new file mode 100644 index 0000000..4c66f9a --- /dev/null +++ b/src/main/resources/com/fr/plugin/dfui/js/plugin.js @@ -0,0 +1,662 @@ +!(function () { + var e = BI.inherit(BI.Widget, { + props: { + baseCls: "dec-login-login" + }, + _store: function () { + return BI.Models.getModel("dec.model.login.login") + }, + watch: { + supportForgetPwd: function (e) { + this.forgetPasswordRow.setVisible(e) + }, + needSlider: function (e) { + this.sliderMasker.setVisible(e) + } + }, + render: function () { + var t = this; + this.options; + return { + type: "bi.absolute", + items: [{ + el: { + type: "bi.vertical", + items: [ + { + type: "dec.login.login.item", + $testId: "dec-login-username", + iconCls: "login-username-font", + watermark: BI.i18nText("Dec-User_Name"), + ref: function (e) { + t.usernameRow = e + } + }, { + type: "dec.login.login.item", + $testId: "dec-login-password", + iconCls: "login-password-font", + watermark: BI.i18nText("Dec-Password"), + inputType: "password", + ref: function (e) { + t.passwordRow = e + } + }, + { + type: "bi.left_right_vertical_adapt", + bgap: 30, + items: { + left: [{ + type: "bi.multi_select_item", + $testId: "dec-login-remember", + textLgap: 5, + iconWrapperWidth: 16, + height: 16, + text: BI.i18nText("Dec-Login_Remember"), + logic: { + dynamic: !0 + }, + ref: function (e) { + t.rememberRow = e + } + } + ], + right: [{ + type: "bi.button", + $testId: "dec-login-forget-password", + clear: !0, + height: 16, + invisible: !this.model.supportForgetPwd, + text: BI.i18nText("Dec-Basic_Forget_Password"), + ref: function (e) { + t.forgetPasswordRow = e + }, + handler: function () { + t.store.setSelectedTab(DecCst.Login.Tabs.FORGET_PASSWORD) + } + } + ].concat(this._createItems()) + } + }, { + type: "bi.horizontal_auto", + items: [{ + type: "bi.button", + cls: "login-button", + text: BI.i18nText("Dec-Basic_Login"), + width: 190, + height: 40, + handler: function () { + t._start() + } + } + ] + }, { + el: { + type: "bi.vertical", + $testId: "dec-login-logged-chang-text", + cls: "login-error", + invisible: !0, + scrolly: !1, + items: [{ + type: "bi.text", + tagName: "span", + whiteSpace: "normal", + text: BI.i18nText("Dec-Login_Other_Logged_Tip") + }, { + type: "bi.text", + $testId: "dec-login-logged-chang-password", + tagName: "span", + cls: "password-btn", + text: BI.i18nText("Dec-Login_Change_Password"), + handler: function () { + t.model.isNeedVerify ? t.store.setSelectedTab(DecCst.Login.Tabs.VERIFY_BING) : t.store.setSelectedTab(DecCst.Login.Tabs.PASSWORD_OLD) + } + } + ], + ref: function (e) { + t.loginErrorRow = e + } + }, + tgap: 20 + }, { + el: { + type: "bi.text", + $testId: "dec-login-logged-text", + cls: "login-error", + invisible: !0, + whiteSpace: "normal", + text: BI.i18nText("Dec-Login_Normal_Other_Logged_Tip"), + ref: function (e) { + t.loginNormalErrorRow = e + } + }, + tgap: 20 + } + ] + }, + top: 0, + right: 40, + bottom: 0, + left: 40 + }, + { + el: { + type: "bi.center_adapt", + cls: "slider-masker", + invisible: !0, + items: [{ + type: "dec.login.slider", + listeners: [{ + eventName: "EVENT_SUCCESS", + action: function () { + t._start() + } + }, { + eventName: "EVENT_CLOSE", + action: function () { + t.store.resetSlider() + } + } + ], + ref: function (e) { + t.sliderBar = e + } + } + ], + ref: function (e) { + t.sliderMasker = e + } + }, + top: 0, + right: 40, + bottom: 0, + left: 40 + } + ] + } + }, + mounted: function () { + var t = this; + this.store.initData(), + this.element.keyup(function (e) { + 13 === e.keyCode && t._start() + }) + }, + _createItems: function () { + return BI.map(BI.Constants.getConstant("dec.constant.login.way.extend"), function (e, t) { + return { + type: t.cardType + } + }) + }, + _start: function () { + var t = this, + e = this.usernameRow.getValue(), + i = this.passwordRow.getValue(), + n = this.rememberRow.isSelected() ? -2 : -1; + t.loginErrorRow.invisible(), + t.loginNormalErrorRow.invisible(), + "" !== e ? "" !== i ? (this.store.setLoginInfo({ + username: e, + validity: n, + phone: "", + captcha: "" + }), this.store.login({ + username: e, + password: this.passwordRow.getCipher(), + validity: n, + sliderToken: this.model.sliderToken, + origin: Dec.Utils.getUrlQuery("origin"), + encrypted: !0 + }, function (e) { + t.store.resetSlider(), + e.data && e.data.accessToken ? t.fireEvent("EVENT_LOGIN", e.data) : BI.bind(BI.Services.getService("dec.service.login.login").getHandler(e.errorCode), t)(e) + })) : this.passwordRow.showError(BI.i18nText("Dec-Error_Password_Not_Null")) : this.usernameRow.showError(BI.i18nText("Dec-Error_Username_Not_Null")) + } + }); + BI.shortcut("dec.login.login", e) +})(); + +!(function () { + var Login = BI.inherit(BI.Widget, { + + props: { + baseCls: "dec-login" + }, + + _store: function () { + return BI.Models.getModel("dec.model.login.visual"); + }, + + watch: { + }, + + render: function () { + var self = this, loginConfig = this.model.loginConfig; + + // 调用自定义主题色,可以自行配置 + BI.Services.getService("dec.service.login").initStyles(); + + return { + type: "bi.absolute", + cls: "dec-login-fresh", + items: [{ + el:{ + type:"bi.img", + src:"resources?path=com/fr/plugin/dfui/image/1.png", + width:"70%" + },top: 0, left: 0, + },{ + el:{ + type:"bi.absolute", + width:"30%", + items:[ + { + el:{ + type: "bi.center_adapt", + width: "100%", + items:[{ + type:"bi.label", + text:"小康集团数据平台", + css: {color:"black","font-size":"3vw"} + }], + + },top: "4%", right: 0 + } + , + { + el: { + type: "bi.center_adapt", + width: "100%", + cls: "login-area", + items: [ + { + type: "bi.absolute", + cls: "edit-area", + height: 350, + width: "100%", + items: [ + { + el: { + type: "bi.horizontal_auto", + height: 100, + items: [ + { + el: { + type: "bi.center_adapt", + items: [{ + type: "bi.img", + src: "resources?path=com/fr/plugin/dfui/image/1.1.png", + height: 50, + width: "auto" + }] + } + }, { + el: { + type: "bi.label", + height: 24, + cls: "dec-login-visual-title", + text: "" + }, + tgap: 5 + }], + ref: function (_ref) { + self.logo = _ref; + } + }, top: 30, right: 0, left: 0 + }, + { + el: { + type: "dec.login.index", + listeners: [{ + eventName: "EVENT_CHANGE", + action: function (v) { + self.logo.setVisible(v === DecCst.Login.Tabs.LOGIN); + } + }] + }, top: 85, right: 0, bottom: 0, left: 0 + }] + }] + }, top: 0, right: '10%', bottom: 0 + }, + { + el:{ + type: "bi.center_adapt", + width: "100%", + items:[{ + type:"bi.label", + text:"© 2021 重庆小康工业集团股份有限公司", + css: {color:"rgb(126,126,126)","font-size":"1vw"} + }] + + },bottom: "8%", right: 0 + } + ] + },top:0,right:0,bottom:0 + } + ], + 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.visual1", Login); +})(); + +!(function () { + var Login = BI.inherit(BI.Widget, { + + props: { + baseCls: "dec-login" + }, + + _store: function () { + return BI.Models.getModel("dec.model.login.visual"); + }, + + watch: { + }, + + render: function () { + var self = this, loginConfig = this.model.loginConfig; + + // 调用自定义主题色,可以自行配置 + BI.Services.getService("dec.service.login").initStyles(); + + return { + type: "bi.absolute", + cls: "dec-login-fresh", + items: [{ + el:{ + type:"bi.img", + src:"resources?path=com/fr/plugin/dfui/image/2.png", + width:"70%" + },top: 0, left: 0, + },{ + el:{ + type:"bi.absolute", + width:"30%", + items:[ + { + el:{ + type: "bi.center_adapt", + width: "100%", + items:[{ + type:"bi.label", + text:"东风小康数据平台", + css: {color:"black","font-size":"3vw"} + }], + + },top: "5%", right: 0 + + } + , + { + el: { + type: "bi.center_adapt", + width: "100%", + cls: "login-area", + items: [ + { + type: "bi.absolute", + cls: "edit-area", + height: 440, + width: "100%", + items: [{ + el: { + type: "bi.horizontal_auto", + height: 100, + items: [ + { + el: { + type: "bi.center_adapt", + items: [{ + type: "bi.img", + src: "resources?path=com/fr/plugin/dfui/image/2.2.png", + height: 50, + width: "auto" + }] + } + }, { + el: { + type: "bi.label", + height: 24, + cls: "dec-login-visual-title", + text: "" + }, + tgap: 5 + }], + ref: function (_ref) { + self.logo = _ref; + } + }, top: 30, right: 0, left: 0 + }, { + el: { + type: "dec.login.index", + listeners: [{ + eventName: "EVENT_CHANGE", + action: function (v) { + self.logo.setVisible(v === DecCst.Login.Tabs.LOGIN); + } + }] + }, top: 85, right: 0, bottom: 0, left: 0 + }] + }] + }, top: 0, right: "10%", bottom: 0 + }, + { + el:{ + type: "bi.center_adapt", + width: "100%", + items:[{ + type:"bi.label", + text:"© 2021 东风小康汽车有限公司", + css: {color:"rgb(126,126,126)","font-size":"1vw"} + }] + + },bottom: "10%", right: 0 + + } + ] + },top:0,right:0,bottom:0 + } + ], + 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.visual2", Login); +})(); +!(function () { + var Login = BI.inherit(BI.Widget, { + + props: { + baseCls: "dec-login" + }, + + _store: function () { + return BI.Models.getModel("dec.model.login.visual"); + }, + + watch: { + }, + + render: function () { + var self = this, loginConfig = this.model.loginConfig; + + // 调用自定义主题色,可以自行配置 + BI.Services.getService("dec.service.login").initStyles(); + + return { + type: "bi.absolute", + cls: "dec-login-fresh", + items: [{ + el:{ + type:"bi.img", + src:"resources?path=com/fr/plugin/dfui/image/3.png", + width:"70%" + },top: 0, left: 0, + },{ + el:{ + type:"bi.absolute", + width:"30%", + items:[ + { + el:{ + type: "bi.center_adapt", + width: "100%", + items:[{ + type:"bi.label", + text:"金康赛力斯数据平台", + css: {color:"black","font-size":"3vw"} + }], + + },top: "5%", right: 0 + + } + , + { + el: { + type: "bi.center_adapt", + width: "100%", + cls: "login-area", + items: [ + { + type: "bi.absolute", + cls: "edit-area", + height: 440, + width: "100%", + items: [{ + el: { + type: "bi.horizontal_auto", + height: 100, + items: [ + { + el: { + type: "bi.center_adapt", + items: [{ + type: "bi.img", + src: "resources?path=com/fr/plugin/dfui/image/3.3.png", + height: 50, + width: "auto" + }] + } + }, { + el: { + type: "bi.label", + height: 24, + cls: "dec-login-visual-title", + text: "" + }, + tgap: 5 + }], + ref: function (_ref) { + self.logo = _ref; + } + }, top: 30, right: 0, left: 0 + }, { + el: { + type: "dec.login.index", + listeners: [{ + eventName: "EVENT_CHANGE", + action: function (v) { + self.logo.setVisible(v === DecCst.Login.Tabs.LOGIN); + } + }] + }, top: 85, right: 0, bottom: 0, left: 0 + }] + }] + }, top: 0, right: "10%", bottom: 0 + }, + { + el:{ + type: "bi.center_adapt", + width: "100%", + items:[{ + type:"bi.label", + text:"© 2021 重庆金康新能源汽车有限公司", + css: {color:"rgb(126,126,126)","font-size":"1vw"} + }] + + },bottom: "10%", right: 0 + } + ] + },top:0,right:0,bottom:0 + } + ], + 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.visual3", 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.visual", Model); +})(); +!(function () { + var url = window.location.href; + var visual = "dec.login.visual1"; + if(url.indexOf("bi.sokon.com") != -1){ + visual= "dec.login.visual1"; + } + + if(url.indexOf("bi.dfsk.com.cn") != -1){ + visual= "dec.login.visual2"; + } + + if(url.indexOf("bi.seres.cn") != -1){ + visual= "dec.login.visual3"; + } + + BI.config("dec.login", function (ob) { + return BI.extend(ob, {type: visual}); + }); +})(); \ No newline at end of file diff --git a/使用手册.docx b/使用手册.docx new file mode 100644 index 0000000..4a035c6 Binary files /dev/null and b/使用手册.docx differ