13 changed files with 1475 additions and 1 deletions
@ -1,3 +1,6 @@
|
||||
# open-JSD-8565 |
||||
|
||||
JSD-8565 开源任务材料 |
||||
JSD-8565 重置密码推送邮件\ |
||||
免责说明:该源码为第三方爱好者提供,不保证源码和方案的可靠性,也不提供任何形式的源码教学指导和协助!\ |
||||
仅作为开发者学习参考使用!禁止用于任何商业用途!\ |
||||
为保护开发者隐私,开发者信息已隐去!若原开发者希望公开自己的信息,可联系hugh处理。 |
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?><plugin> |
||||
<id>com.fr.plugin.emailandui</id> |
||||
<name><![CDATA[重置密码组件]]></name> |
||||
<active>yes</active> |
||||
<version>1.0.3</version> |
||||
<env-version>10.0</env-version> |
||||
<jartime>2018-07-31</jartime> |
||||
<vendor>fr.open</vendor> |
||||
<description><![CDATA[重置密码组件]]></description> |
||||
<change-notes><![CDATA[ |
||||
]]></change-notes> |
||||
<main-package>com.fr.plugin.emailandui</main-package> |
||||
<lifecycle-monitor class="com.fr.plugin.emailandui.config.InitializeMonitor"/> |
||||
|
||||
<extra-decision> |
||||
<WebResourceProvider class="com.fr.plugin.emailandui.webresource.WebResourceProvider"/> |
||||
<HttpHandlerProvider class="com.fr.plugin.emailandui.email.ExtendAttrHandlerProvider"/> |
||||
<URLAliasProvider class="com.fr.plugin.emailandui.email.URLAliasProvide"/> |
||||
</extra-decision> |
||||
|
||||
<function-recorder class="com.fr.plugin.emailandui.config.PluginSimpleConfig"/> |
||||
</plugin> |
@ -0,0 +1,21 @@
|
||||
package com.fr.plugin.emailandui.config; |
||||
|
||||
import com.fr.plugin.context.PluginContext; |
||||
import com.fr.plugin.observer.inner.AbstractPluginLifecycleMonitor; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2018-12-04 |
||||
*/ |
||||
public class InitializeMonitor extends AbstractPluginLifecycleMonitor { |
||||
@Override |
||||
public void afterRun(PluginContext pluginContext) { |
||||
PluginSimpleConfig.getInstance(); |
||||
} |
||||
|
||||
@Override |
||||
public void beforeStop(PluginContext pluginContext) { |
||||
|
||||
} |
||||
} |
@ -0,0 +1,59 @@
|
||||
package com.fr.plugin.emailandui.config; |
||||
|
||||
import com.fr.config.*; |
||||
import com.fr.config.holder.Conf; |
||||
import com.fr.config.holder.factory.Holders; |
||||
import com.fr.intelli.record.Focus; |
||||
import com.fr.intelli.record.Original; |
||||
import com.fr.record.analyzer.EnableMetrics; |
||||
|
||||
@Visualization(category = "邮件内容配置") |
||||
@EnableMetrics |
||||
public class PluginSimpleConfig extends DefaultConfiguration { |
||||
|
||||
private static volatile PluginSimpleConfig config = null; |
||||
|
||||
@Focus(id="com.fr.plugin.emailandui.config", text = "邮件内容配置", source = Original.PLUGIN) |
||||
public static PluginSimpleConfig getInstance() { |
||||
if (config == null) { |
||||
config = ConfigContext.getConfigInstance(PluginSimpleConfig.class); |
||||
} |
||||
return config; |
||||
} |
||||
|
||||
@Identifier(value = "title", name = "邮件标题", description = "邮件标题", status = Status.SHOW) |
||||
private Conf<String> title = Holders.simple("重置密码"); |
||||
|
||||
public String getTitle() { |
||||
return title.get(); |
||||
} |
||||
|
||||
public void setTitle(String url) { |
||||
this.title.set(url); |
||||
} |
||||
|
||||
@Identifier(value = "content", name = "邮件内容", description = "邮件内容", status = Status.SHOW) |
||||
private Conf<String> content = Holders.simple("您的密码重置为${PSD}"); |
||||
|
||||
public String getContent() { |
||||
return content.get(); |
||||
} |
||||
|
||||
public void setContent(String url) { |
||||
this.content.set(url); |
||||
} |
||||
|
||||
|
||||
|
||||
@Override |
||||
public Object clone() throws CloneNotSupportedException { |
||||
PluginSimpleConfig cloned = (PluginSimpleConfig) super.clone(); |
||||
// cloned.text = (Conf<String>) text.clone();
|
||||
// cloned.count = (Conf<Integer>) count.clone();
|
||||
// cloned.price = (Conf<Double>) price.clone();
|
||||
// cloned.time = (Conf<Long>) time.clone();
|
||||
// cloned.student = (Conf<Boolean>) student.clone();
|
||||
return cloned; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,13 @@
|
||||
package com.fr.plugin.emailandui.email; |
||||
|
||||
import com.fr.decision.fun.HttpHandler; |
||||
import com.fr.decision.fun.impl.AbstractHttpHandlerProvider; |
||||
|
||||
public class ExtendAttrHandlerProvider extends AbstractHttpHandlerProvider { |
||||
@Override |
||||
public HttpHandler[] registerHandlers() { |
||||
return new HttpHandler[]{ |
||||
new SendEmail() |
||||
}; |
||||
} |
||||
} |
@ -0,0 +1,69 @@
|
||||
package com.fr.plugin.emailandui.email; |
||||
|
||||
import com.fr.base.EmailManager; |
||||
import com.fr.decision.fun.impl.BaseHttpHandler; |
||||
import com.fr.json.JSONObject; |
||||
import com.fr.plugin.emailandui.config.PluginSimpleConfig; |
||||
import com.fr.plugin.emailandui.utils.FRUtils; |
||||
import com.fr.plugin.emailandui.utils.Utils; |
||||
import com.fr.plugin.transform.FunctionRecorder; |
||||
import com.fr.third.springframework.web.bind.annotation.RequestMethod; |
||||
|
||||
import javax.mail.MessagingException; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
|
||||
@FunctionRecorder |
||||
public class SendEmail extends BaseHttpHandler { |
||||
|
||||
|
||||
public SendEmail() { |
||||
} |
||||
|
||||
@Override |
||||
public RequestMethod getMethod() { |
||||
return RequestMethod.POST; |
||||
} |
||||
|
||||
@Override |
||||
public String getPath() { |
||||
return "/sendEmail"; |
||||
} |
||||
|
||||
@Override |
||||
public boolean isPublic() { |
||||
return true; |
||||
} |
||||
|
||||
@Override |
||||
public void handle(HttpServletRequest req, HttpServletResponse res) { |
||||
//邮件接收人
|
||||
String to = req.getParameter("email"); |
||||
if(Utils.isNullStr(to)){ |
||||
return ; |
||||
} |
||||
String password = req.getParameter("realPassword"); |
||||
boolean retPsd = Boolean.parseBoolean(req.getParameter("resetPassword")); |
||||
FRUtils.FRLogInfo("发送邮件:psd:"+password+";retPsd:"+retPsd); |
||||
//邮件标题
|
||||
String title = PluginSimpleConfig.getInstance().getTitle(); |
||||
if(!retPsd){ |
||||
return ; |
||||
} |
||||
//邮件内容
|
||||
String content = PluginSimpleConfig.getInstance().getContent().replace("${PSD}",password); |
||||
|
||||
//获取请求参数
|
||||
try { |
||||
EmailManager.getInstance().send(to,title,content); |
||||
} catch (MessagingException e) { |
||||
FRUtils.FRLogError("发送邮件异常:"+e.getMessage()); |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
} |
||||
|
@ -0,0 +1,14 @@
|
||||
package com.fr.plugin.emailandui.email; |
||||
|
||||
import com.fr.decision.fun.impl.AbstractURLAliasProvider; |
||||
import com.fr.decision.webservice.url.alias.URLAlias; |
||||
import com.fr.decision.webservice.url.alias.URLAliasFactory; |
||||
|
||||
public class URLAliasProvide extends AbstractURLAliasProvider { |
||||
@Override |
||||
public URLAlias[] registerAlias() { |
||||
return new URLAlias[]{ |
||||
URLAliasFactory.createPluginAlias("/sendEmail","/sendEmail",true), |
||||
}; |
||||
} |
||||
} |
@ -0,0 +1,167 @@
|
||||
package com.fr.plugin.emailandui.utils; |
||||
|
||||
import com.fr.decision.authority.AuthorityContext; |
||||
import com.fr.decision.authority.data.User; |
||||
import com.fr.decision.webservice.login.LogInOutResultInfo; |
||||
import com.fr.decision.webservice.utils.DecisionServiceConstants; |
||||
import com.fr.decision.webservice.v10.login.LoginService; |
||||
import com.fr.decision.webservice.v10.login.event.LogInOutEvent; |
||||
import com.fr.decision.webservice.v10.user.UserService; |
||||
import com.fr.event.EventDispatcher; |
||||
import com.fr.log.FineLoggerFactory; |
||||
import com.fr.stable.StringUtils; |
||||
import com.fr.stable.query.QueryFactory; |
||||
import com.fr.stable.query.restriction.RestrictionFactory; |
||||
import com.fr.web.utils.WebUtils; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import javax.servlet.http.HttpSession; |
||||
import java.util.List; |
||||
|
||||
public class FRUtils { |
||||
/** |
||||
* 判断用户是否存在 |
||||
* @param userName |
||||
* @return |
||||
*/ |
||||
public static boolean isUserExist(String userName){ |
||||
if (StringUtils.isEmpty(userName)) { |
||||
return false; |
||||
} else { |
||||
try { |
||||
List var1 = AuthorityContext.getInstance().getUserController().find(QueryFactory.create().addRestriction(RestrictionFactory.eq("userName", userName))); |
||||
return var1 != null && !var1.isEmpty(); |
||||
} catch (Exception var2) { |
||||
FineLoggerFactory.getLogger().error(var2.getMessage()); |
||||
return false; |
||||
} |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 判断是否登录FR |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
public static boolean isLogin(HttpServletRequest req){ |
||||
return LoginService.getInstance().isLogged(req); |
||||
} |
||||
|
||||
/** |
||||
* 帆软登录 |
||||
* @param httpServletRequest |
||||
* @param httpServletResponse |
||||
* @param userName |
||||
* @param url |
||||
*/ |
||||
public static void login(HttpServletRequest httpServletRequest,HttpServletResponse httpServletResponse,String userName,String url){ |
||||
|
||||
FineLoggerFactory.getLogger().info("FRLOG:用户名:"+userName); |
||||
FineLoggerFactory.getLogger().info("FRLOG:跳转链接:"+url); |
||||
|
||||
|
||||
//判断用户名是否为空
|
||||
if(!Utils.isNullStr(userName)){ |
||||
if(isUserExist(userName)){ |
||||
String FRToken = ""; |
||||
|
||||
try { |
||||
HttpSession session = httpServletRequest.getSession(true); |
||||
|
||||
FRToken = LoginService.getInstance().login(httpServletRequest, httpServletResponse, userName); |
||||
|
||||
httpServletRequest.setAttribute(DecisionServiceConstants.FINE_AUTH_TOKEN_NAME,FRToken); |
||||
|
||||
session.setAttribute(DecisionServiceConstants.FINE_AUTH_TOKEN_NAME, FRToken); |
||||
EventDispatcher.fire(LogInOutEvent.LOGIN,new LogInOutResultInfo(httpServletRequest,httpServletResponse,userName,true)); |
||||
FineLoggerFactory.getLogger().info("FRLOG:登陆成功!"); |
||||
|
||||
if(!Utils.isNullStr(url)){ |
||||
httpServletResponse.sendRedirect(url); |
||||
} |
||||
} catch (Exception e) { |
||||
ResponseUtils.failedResponse(httpServletResponse,"登录异常,请联系管理员!"); |
||||
FineLoggerFactory.getLogger().info("FRLOG:登录异常,请联系管理员!"); |
||||
FineLoggerFactory.getLogger().info("FRLOGException:"+e.getMessage()); |
||||
} |
||||
}else{ |
||||
ResponseUtils.failedResponse(httpServletResponse,"用户在报表系统中不存在!"); |
||||
FineLoggerFactory.getLogger().info("FRLOG:用户在报表系统中不存在!"); |
||||
} |
||||
}else{ |
||||
ResponseUtils.failedResponse(httpServletResponse,"用户名不能为空!"); |
||||
FineLoggerFactory.getLogger().info("FRLOG:用户名不能为空!"); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param httpServletRequest |
||||
* @param httpServletResponse |
||||
*/ |
||||
public static void logout(HttpServletRequest httpServletRequest,HttpServletResponse httpServletResponse) |
||||
{ |
||||
if(!isLogin(httpServletRequest)){ |
||||
return ; |
||||
} |
||||
|
||||
try { |
||||
LoginService.getInstance().logout(httpServletRequest,httpServletResponse); |
||||
} catch (Exception e) { |
||||
ResponseUtils.failedResponse(httpServletResponse,"登出异常,请联系管理员!"); |
||||
FineLoggerFactory.getLogger().info("FRLOG:登出异常,请联系管理员!"); |
||||
FineLoggerFactory.getLogger().info("FRLOGException:"+e.getMessage()); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 打印FR日志 |
||||
* @param message |
||||
*/ |
||||
public static void FRLogInfo(String message){ |
||||
FineLoggerFactory.getLogger().info("FRLOG:"+message); |
||||
} |
||||
|
||||
/** |
||||
* 打印FR日志-error |
||||
* @param message |
||||
*/ |
||||
public static void FRLogError(String message){ |
||||
FineLoggerFactory.getLogger().error("FRLOG:"+message); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 根据用户名获取用户信息 |
||||
* @param userName |
||||
* @return |
||||
*/ |
||||
public static User getFRUserByUserName(String userName){ |
||||
try { |
||||
return UserService.getInstance().getUserByUserName(userName); |
||||
} catch (Exception e) { |
||||
FRLogInfo("获取用户信息异常:"+e.getMessage()); |
||||
} |
||||
|
||||
return null; |
||||
} |
||||
|
||||
/** |
||||
* 解密FR密码 |
||||
* @param password |
||||
* @return |
||||
*/ |
||||
// public static String decryptFRPsd(String password){
|
||||
// FRLogInfo("解密密码:"+password);
|
||||
// return TransmissionTool.decrypt(password);
|
||||
// }
|
||||
|
||||
/** |
||||
* 获取带参数的访问链接 |
||||
* @return |
||||
*/ |
||||
public static String getAllUrl(HttpServletRequest httpServletRequest){ |
||||
return WebUtils.getOriginalURL(httpServletRequest); |
||||
} |
||||
} |
@ -0,0 +1,94 @@
|
||||
package com.fr.plugin.emailandui.utils; |
||||
|
||||
import com.fr.json.JSONObject; |
||||
import com.fr.log.FineLoggerFactory; |
||||
import com.fr.web.utils.WebUtils; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import java.io.PrintWriter; |
||||
|
||||
public class ResponseUtils { |
||||
private static final int SUCCESS = 200; |
||||
private static final int FAILED = -1; |
||||
|
||||
public static void successResponse(HttpServletResponse res, String body) { |
||||
response(res, body, SUCCESS); |
||||
} |
||||
|
||||
public static void failedResponse(HttpServletResponse res, String body) { |
||||
response(res, body, FAILED); |
||||
} |
||||
|
||||
private static void response(HttpServletResponse res, String body, int code) { |
||||
JSONObject object = new JSONObject(); |
||||
PrintWriter pw; |
||||
try { |
||||
object.put("code", code); |
||||
object.put("data", body); |
||||
pw = WebUtils.createPrintWriter(res); |
||||
} catch (Exception e) { |
||||
FineLoggerFactory.getLogger().info(e.getMessage()); |
||||
return; |
||||
} |
||||
res.setContentType("application/json;charset=utf-8"); |
||||
String result = object.toString(); |
||||
pw.println(result); |
||||
pw.flush(); |
||||
pw.close(); |
||||
} |
||||
|
||||
public static void response(HttpServletResponse res,JSONObject json){ |
||||
PrintWriter pw; |
||||
try { |
||||
pw = WebUtils.createPrintWriter(res); |
||||
} catch (Exception e) { |
||||
FineLoggerFactory.getLogger().info(e.getMessage()); |
||||
return; |
||||
} |
||||
res.setContentType("application/json;charset=utf-8"); |
||||
String result = json.toString(); |
||||
pw.println(result); |
||||
pw.flush(); |
||||
pw.close(); |
||||
} |
||||
|
||||
public static void responseXml(HttpServletResponse res,String xml){ |
||||
PrintWriter pw; |
||||
try { |
||||
pw = WebUtils.createPrintWriter(res); |
||||
} catch (Exception e) { |
||||
FineLoggerFactory.getLogger().info(e.getMessage()); |
||||
return; |
||||
} |
||||
res.setContentType("text/xml;charset=utf-8"); |
||||
pw.println(xml); |
||||
pw.flush(); |
||||
pw.close(); |
||||
} |
||||
|
||||
public static void setCSRFHeader(HttpServletResponse httpServletResponse){ |
||||
httpServletResponse.setHeader("Access-Control-Allow-Origin", "*"); |
||||
httpServletResponse.setHeader("Access-Control-Allow-Methods", "POST,GET,OPTIONS,DELETE,HEAD,PUT,PATCH"); |
||||
httpServletResponse.setHeader("Access-Control-Max-Age", "36000"); |
||||
httpServletResponse.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept,Authorization,authorization"); |
||||
} |
||||
|
||||
public static void responseJsonp(HttpServletRequest req, HttpServletResponse res, JSONObject json){ |
||||
PrintWriter pw; |
||||
try { |
||||
pw = WebUtils.createPrintWriter(res); |
||||
} catch (Exception e) { |
||||
FineLoggerFactory.getLogger().info(e.getMessage()); |
||||
return; |
||||
} |
||||
res.setContentType("text/javascript;charset=utf-8;charset=utf-8"); |
||||
String result = json.toString(); |
||||
|
||||
String jsonp=req.getParameter("callback"); |
||||
|
||||
pw.println(jsonp+"("+result+")"); |
||||
pw.flush(); |
||||
pw.close(); |
||||
} |
||||
} |
@ -0,0 +1,178 @@
|
||||
package com.fr.plugin.emailandui.utils; |
||||
|
||||
import com.fr.data.NetworkHelper; |
||||
import com.fr.json.JSONObject; |
||||
import com.fr.stable.CodeUtils; |
||||
import com.fr.stable.StringUtils; |
||||
import com.fr.third.org.apache.commons.codec.digest.DigestUtils; |
||||
|
||||
import javax.servlet.http.Cookie; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import java.io.BufferedReader; |
||||
import java.util.UUID; |
||||
|
||||
public class Utils { |
||||
|
||||
/** |
||||
* 判断字符串是否为空 |
||||
* @param str |
||||
* @return true 空字符串 false 非空字符串 |
||||
*/ |
||||
public static boolean isNullStr(String str){ |
||||
return !(str != null && !str.isEmpty() && !"null".equals(str)); |
||||
} |
||||
|
||||
/** |
||||
* 判断字符串是否非空 |
||||
* @param str |
||||
* @return |
||||
*/ |
||||
public static boolean isNotNullStr(String str){ |
||||
return !isNullStr(str); |
||||
} |
||||
|
||||
/** |
||||
* MD5加密 |
||||
* @param str |
||||
* @return |
||||
*/ |
||||
public static String getMd5Str(String str) |
||||
{ |
||||
return DigestUtils.md5Hex(str); |
||||
} |
||||
|
||||
/** |
||||
* 帆软shaEncode加密 |
||||
*/ |
||||
|
||||
public static String shaEncode(String str){ |
||||
return CodeUtils.sha256Encode(str); |
||||
} |
||||
|
||||
/** |
||||
* 获取uuid |
||||
*/ |
||||
public static String uuid(){ |
||||
return UUID.randomUUID().toString(); |
||||
} |
||||
|
||||
/** |
||||
* 替换空字符串 |
||||
* @param str |
||||
* @param replace |
||||
* @return |
||||
*/ |
||||
public static String replaceNullStr(String str,String replace){ |
||||
if(isNullStr(str)){ |
||||
return replace; |
||||
} |
||||
|
||||
return str; |
||||
} |
||||
|
||||
/** |
||||
* 获取请求体 |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
public static JSONObject getRequestBody(HttpServletRequest req){ |
||||
StringBuffer sb = new StringBuffer(); |
||||
String line = null; |
||||
try { |
||||
BufferedReader reader = req.getReader(); |
||||
while ((line = reader.readLine()) != null) |
||||
sb.append(line); |
||||
} catch (Exception e) { |
||||
FRUtils.FRLogInfo("getRequestBody:exception:"+e.getMessage()); |
||||
} |
||||
//将空格和换行符替换掉避免使用反序列化工具解析对象时失败
|
||||
String jsonString = sb.toString().replaceAll("\\s","").replaceAll("\n",""); |
||||
|
||||
JSONObject json = new JSONObject(jsonString); |
||||
|
||||
return json; |
||||
} |
||||
|
||||
/** |
||||
* 获取ip |
||||
* @return |
||||
*/ |
||||
public static String getIp(HttpServletRequest req){ |
||||
String realIp = req.getHeader("X-Real-IP"); |
||||
String fw = req.getHeader("X-Forwarded-For"); |
||||
if (StringUtils.isNotEmpty(fw) && !"unKnown".equalsIgnoreCase(fw)) { |
||||
int var3 = fw.indexOf(","); |
||||
return var3 != -1 ? fw.substring(0, var3) : fw; |
||||
} else { |
||||
fw = realIp; |
||||
if (StringUtils.isNotEmpty(realIp) && !"unKnown".equalsIgnoreCase(realIp)) { |
||||
return realIp; |
||||
} else { |
||||
if (StringUtils.isBlank(realIp) || "unknown".equalsIgnoreCase(realIp)) { |
||||
fw = req.getHeader("Proxy-Client-IP"); |
||||
} |
||||
|
||||
if (StringUtils.isBlank(fw) || "unknown".equalsIgnoreCase(fw)) { |
||||
fw = req.getHeader("WL-Proxy-Client-IP"); |
||||
} |
||||
|
||||
if (StringUtils.isBlank(fw) || "unknown".equalsIgnoreCase(fw)) { |
||||
fw = req.getHeader("HTTP_CLIENT_IP"); |
||||
} |
||||
|
||||
if (StringUtils.isBlank(fw) || "unknown".equalsIgnoreCase(fw)) { |
||||
fw = req.getHeader("HTTP_X_FORWARDED_FOR"); |
||||
} |
||||
|
||||
if (StringUtils.isBlank(fw) || "unknown".equalsIgnoreCase(fw)) { |
||||
fw = req.getRemoteAddr(); |
||||
} |
||||
|
||||
return fw; |
||||
} |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 根据key获取cookie |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
public static String getCookieByKey(HttpServletRequest req,String key){ |
||||
Cookie[] cookies = req.getCookies(); |
||||
String cookie = ""; |
||||
|
||||
if(cookies == null || cookies.length <=0){ |
||||
return ""; |
||||
} |
||||
|
||||
for(int i = 0; i < cookies.length; i++) { |
||||
Cookie item = cookies[i]; |
||||
if (item.getName().equalsIgnoreCase(key)) { |
||||
cookie = item.getValue(); |
||||
} |
||||
} |
||||
|
||||
FRUtils.FRLogInfo("cookie:"+cookie); |
||||
|
||||
return cookie; |
||||
} |
||||
|
||||
/** |
||||
* 判断是否是手机端的链接 |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
public static boolean isMobile(HttpServletRequest req) { |
||||
String[] mobileArray = {"iPhone", "iPad", "android", "windows phone", "xiaomi"}; |
||||
String userAgent = req.getHeader("user-agent"); |
||||
if (userAgent != null && userAgent.toUpperCase().contains("MOBILE")) { |
||||
for(String mobile : mobileArray) { |
||||
if(userAgent.toUpperCase().contains(mobile.toUpperCase())) { |
||||
return true; |
||||
} |
||||
} |
||||
} |
||||
return NetworkHelper.getDevice(req).isMobile(); |
||||
} |
||||
} |
@ -0,0 +1,35 @@
|
||||
package com.fr.plugin.emailandui.webresource; |
||||
|
||||
import com.fr.decision.fun.impl.AbstractWebResourceProvider; |
||||
import com.fr.decision.web.MainComponent; |
||||
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 wink on 2019/1/16. |
||||
*/ |
||||
public class WebResourceProvider extends AbstractWebResourceProvider { |
||||
@Override |
||||
public Atom attach() { |
||||
return MainComponent.KEY; |
||||
} |
||||
|
||||
@Override |
||||
public Atom client() { |
||||
return new Component() { |
||||
@Override |
||||
public ScriptPath script(RequestClient requestClient) { |
||||
return ScriptPath.build("/com/fr/plugin/emailandui/js/ui.js"); |
||||
} |
||||
|
||||
@Override |
||||
public StylePath style(RequestClient requestClient) { |
||||
return StylePath.EMPTY; |
||||
// return StylePath.build("/com/fr/plugin/jdfSSO/css/icon.css");
|
||||
} |
||||
}; |
||||
} |
||||
} |
@ -0,0 +1,799 @@
|
||||
var e = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "dec-edit-user-popup", |
||||
onClickConfirm: BI.emptyFn, |
||||
info: {}, |
||||
roleEditable: !0, |
||||
passwordEditable: !0 |
||||
}, |
||||
_store: function () { |
||||
return BI.Models.getModel("dec.model.user.edit.popup", this.options) |
||||
}, |
||||
watch: { |
||||
ableCopy: function (e) { |
||||
this.resetPasswordBtn.setEnable(!e) |
||||
// this.copyBtn.setEnable(e)
|
||||
}, |
||||
password: function (e) { |
||||
this.resetPasswordBtn.setText(e ? "生成成功" : BI.i18nText("Dec-Reset_Password_Button")) |
||||
} |
||||
}, |
||||
render: function () { |
||||
var e = this; |
||||
return { |
||||
type: "bi.vtape", |
||||
items: [{ |
||||
el: this._rebuildCenter() |
||||
}, { |
||||
type: "bi.right_vertical_adapt", |
||||
lgap: 10, |
||||
height: 44, |
||||
items: [{ |
||||
type: "bi.button", |
||||
text: BI.i18nText("Dec-Basic_Cancel"), |
||||
level: "ignore", |
||||
handler: function () { |
||||
e._close() |
||||
} |
||||
}, { |
||||
type: "bi.button", |
||||
text: BI.i18nText("Dec-Basic_Sure"), |
||||
handler: function () { |
||||
e._end() |
||||
} |
||||
} |
||||
] |
||||
} |
||||
] |
||||
} |
||||
}, |
||||
_rebuildCenter: function () { |
||||
var t = this, |
||||
e = this.options.info; |
||||
return { |
||||
type: "bi.form", |
||||
cls: "dec-add-user-popup", |
||||
layouts: [{ |
||||
type: "bi.vertical", |
||||
bgap: 15 |
||||
} |
||||
], |
||||
ref: function (e) { |
||||
t.form = e |
||||
}, |
||||
items: [{ |
||||
type: "bi.htape", |
||||
cls: "bi-tips", |
||||
height: 36, |
||||
items: [{ |
||||
type: "bi.label", |
||||
textAlign: "left", |
||||
text: BI.i18nText("Dec-Basic_Tip") + ":", |
||||
height: 24, |
||||
width: 40 |
||||
}, { |
||||
type: "bi.label", |
||||
whiteSpace: "normal", |
||||
textAlign: "left", |
||||
text: BI.i18nText("Dec-Add_User_Tips") |
||||
} |
||||
] |
||||
}, { |
||||
label: { |
||||
type: "bi.label", |
||||
width: 80, |
||||
textAlign: "left", |
||||
text: BI.i18nText("Dec-User_Name") |
||||
}, |
||||
el: { |
||||
type: "bi.label", |
||||
cls: "bi-border", |
||||
width: 428, |
||||
height: 22, |
||||
value: e.username, |
||||
textAlign: "left", |
||||
lgap: 4, |
||||
disabled: !0 |
||||
} |
||||
}, { |
||||
type: "dec.form.editor", |
||||
$value: "real-name", |
||||
textWidth: 80, |
||||
editorWidth: 430, |
||||
text: BI.i18nText("Dec-Real_Name"), |
||||
watermark: BI.i18nText("Dec-Real_Name"), |
||||
value: e.realName, |
||||
rules: { |
||||
required: { |
||||
message: BI.i18nText("Dec-Real_Name_Can_Not_Null") |
||||
}, |
||||
max: DecCst.STRING_SHORT_TEXT_LENGTH |
||||
}, |
||||
ref: function (e) { |
||||
t.realName = e |
||||
} |
||||
}, |
||||
|
||||
|
||||
|
||||
{ |
||||
type: "bi.vertical_adapt", |
||||
invisible: !this.options.passwordEditable, |
||||
items: [ |
||||
{ |
||||
type: "bi.label", |
||||
textAlign: "left", |
||||
width: 80, |
||||
text: BI.i18nText("Dec-Reset_Password"), |
||||
title: BI.i18nText("Dec-Reset_Password") |
||||
}, { |
||||
type: "bi.form.error.item", |
||||
width: 430, |
||||
el: { |
||||
type: "bi.button", |
||||
$value: "reset-pwd", |
||||
text: BI.i18nText("Dec-Reset_Password_Button"), |
||||
handler: function () { |
||||
t.resetPasswordRow.hideError(), |
||||
t.store.genPassword(t._generatePassword()) |
||||
}, |
||||
ref: function (e) { |
||||
t.resetPasswordBtn = e |
||||
} |
||||
}, |
||||
ref: function (e) { |
||||
t.resetPasswordRow = e |
||||
} |
||||
}, |
||||
// {
|
||||
// type: "bi.clipboard",
|
||||
// width: 80,
|
||||
// height: 24,
|
||||
// disabled: !this.model.ableCopy,
|
||||
// el: {
|
||||
// type: "bi.button",
|
||||
// clear: !0,
|
||||
// level: "ignore",
|
||||
// text: BI.i18nText("Dec-Copy_Password"),
|
||||
// tipType: "success",
|
||||
// title: BI.i18nText("Dec-Copy_Password"),
|
||||
// handler: function () {
|
||||
// BI.Msg.toast(BI.i18nText("Dec-Basic_Copy_Success"), {
|
||||
// level: "success"
|
||||
// })
|
||||
// }
|
||||
// },
|
||||
// copy: function () {
|
||||
// return t.model.password
|
||||
// },
|
||||
// ref: function (e) {
|
||||
// t.copyBtn = e
|
||||
// }
|
||||
// }
|
||||
] |
||||
}, |
||||
|
||||
{ |
||||
type: "dec.form.editor", |
||||
$value: "email", |
||||
textWidth: 80, |
||||
editorWidth: 430, |
||||
text: BI.i18nText("Dec-User_Email"), |
||||
watermark: BI.i18nText("Dec-User_Email"), |
||||
value: e.email, |
||||
rules: { |
||||
email: !0 |
||||
}, |
||||
ref: function (e) { |
||||
t.email = e |
||||
} |
||||
}, { |
||||
type: "dec.form.editor", |
||||
$value: "mobile", |
||||
textWidth: 80, |
||||
editorWidth: 430, |
||||
text: BI.i18nText("Dec-User_Mobile"), |
||||
watermark: BI.i18nText("Dec-User_Mobile"), |
||||
value: e.mobile, |
||||
rules: { |
||||
phone: !0 |
||||
}, |
||||
ref: function (e) { |
||||
t.mobile = e |
||||
} |
||||
}, { |
||||
type: "bi.vertical", |
||||
items: [{ |
||||
type: "bi.vertical_adapt", |
||||
items: [{ |
||||
type: "bi.label", |
||||
textAlign: "left", |
||||
width: 80, |
||||
text: BI.i18nText("Dec-Role") |
||||
}, { |
||||
type: "dec.select.role.combo", |
||||
ref: function (e) { |
||||
t.role = e |
||||
}, |
||||
disabled: !this.options.roleEditable, |
||||
width: 430, |
||||
roleNames: e.roleNames, |
||||
roleIds: e.roleIds |
||||
} |
||||
] |
||||
}, { |
||||
el: { |
||||
type: "bi.label", |
||||
textAlign: "left", |
||||
cls: "bi-tips", |
||||
text: BI.i18nText("Dec-User_Edit_User_Role_Column_Tip"), |
||||
invisible: !this.store.checkRoleEditTipVisible() |
||||
}, |
||||
vgap: 10, |
||||
lgap: 80 |
||||
} |
||||
] |
||||
} |
||||
] |
||||
} |
||||
}, |
||||
getValue: function () { |
||||
var e = this.model.ableCopy ? { |
||||
password: BI.Providers.getProvider("dec.provider.cipher").getCipher(this.model.password), |
||||
realPassword:this.model.password |
||||
} |
||||
: {}; |
||||
return BI.extend({ |
||||
username: this.options.info.username, |
||||
realName: this.realName.getValue(), |
||||
email: this.email.getValue(), |
||||
mobile: this.mobile.getValue(), |
||||
roleIds: this.role.getValue(), |
||||
roleNames: this.role.getText(), |
||||
enable: this.options.info.enable, |
||||
resetPassword: this.model.ableCopy |
||||
}, e) |
||||
}, |
||||
_close: function () { |
||||
this.fireEvent("EVENT_CLOSE") |
||||
}, |
||||
_end: function () { |
||||
var t = this, |
||||
i = this.options; |
||||
this.form.submit(function () { |
||||
i.onClickConfirm(t.getValue(), function (e) { |
||||
BI.isNotNull(e.data) ? (i.info.id === Dec.personal.userId && (Dec.UserInfo.displayName = t.realName.getValue()), BI.Msg.toast(BI.i18nText("Dec-Basic_Success_Save"), { |
||||
level: "success" |
||||
}), sendEamil(t.getValue()),t._close()) : e.errorCode && e.errorCode === DecCst.ErrorCode.HISTORY_PASSWORD_LIMIT ? (t.resetPasswordRow.showError(BI.i18nText("Dec-Error_Reset_Password")), t.store.resetPassword()) : BI.Msg.toast(BI.i18nText("Dec-Basic_Save_Fail"), { |
||||
level: "error" |
||||
}) |
||||
}) |
||||
}) |
||||
}, |
||||
_generatePassword: function () { |
||||
return Dec.Utils.generateRandomString(6) |
||||
} |
||||
}); |
||||
e.EVENT_CLICK_CONFIRM = "EVENT_CONFIRM", |
||||
BI.shortcut("dec.user.edit.popup", e); |
||||
|
||||
|
||||
// var e = BI.inherit(BI.Widget, {
|
||||
// props: {
|
||||
// baseCls: "dec-edit-user-popup",
|
||||
// onClickConfirm: BI.emptyFn,
|
||||
// info: {},
|
||||
// onEdit: BI.emptyFn,
|
||||
// editControll: {
|
||||
// roleEditable: !0,
|
||||
// depostEditable: !0,
|
||||
// passwordEditable: !0,
|
||||
// enableEditInfo: !0,
|
||||
// userInfoReadOnly: !1
|
||||
// }
|
||||
// },
|
||||
// _store: function () {
|
||||
// return BI.Models.getModel("dec.model.user.edit.popup", this.options)
|
||||
// },
|
||||
// watch: {},
|
||||
// render: function () {
|
||||
// var e = this;
|
||||
// return {
|
||||
// type: "bi.vtape",
|
||||
// items: [{
|
||||
// el: this._rebuildCenter()
|
||||
// }, {
|
||||
// type: "bi.right_vertical_adapt",
|
||||
// lgap: 10,
|
||||
// height: 44,
|
||||
// items: [{
|
||||
// type: "bi.button",
|
||||
// text: BI.i18nText("Dec-Basic_Cancel"),
|
||||
// level: "ignore",
|
||||
// handler: function () {
|
||||
// e._close()
|
||||
// }
|
||||
// }, {
|
||||
// type: "bi.button",
|
||||
// text: BI.i18nText("Dec-Basic_Sure"),
|
||||
// handler: function () {
|
||||
// e._end()
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// },
|
||||
// _rebuildCenter: function () {
|
||||
// var t = this,
|
||||
// i = this.options.editControll,
|
||||
// n = this.options.info,
|
||||
// e = [{
|
||||
// type: "dec.user.edit_user.item.username"
|
||||
// }
|
||||
// ];
|
||||
// return i.enableEditInfo && e.push({
|
||||
// type: "dec.user.edit_user.item.realname"
|
||||
// }),
|
||||
// i.passwordEditable && e.push({
|
||||
// type: "dec.user.edit_user.item.password"
|
||||
// }),
|
||||
// i.enableEditInfo && (e.push({
|
||||
// type: "dec.user.edit_user.item.mobile"
|
||||
// }), e.push({
|
||||
// type: "dec.user.edit_user.item.email"
|
||||
// })),
|
||||
// i.depostEditable && e.push({
|
||||
// type: "dec.user.edit_user.item.depost"
|
||||
// }),
|
||||
// i.roleEditable && e.push({
|
||||
// type: "dec.user.edit_user.item.role"
|
||||
// }),
|
||||
// BI.each(e, function (e, t) {
|
||||
// BI.extend(t, {
|
||||
// editControll: i,
|
||||
// userInfo: n
|
||||
// })
|
||||
// }), {
|
||||
// type: "bi.vertical",
|
||||
// items: [{
|
||||
// el: {
|
||||
// type: "bi.htape",
|
||||
// cls: "bi-tips",
|
||||
// height: 36,
|
||||
// items: [{
|
||||
// type: "bi.vertical",
|
||||
// items: [{
|
||||
// type: "bi.label",
|
||||
// textAlign: "left",
|
||||
// text: BI.i18nText("Dec-Basic_Tip") + ":"
|
||||
// }
|
||||
// ],
|
||||
// width: 40
|
||||
// }, {
|
||||
// type: "bi.vertical",
|
||||
// items: [{
|
||||
// type: "bi.label",
|
||||
// whiteSpace: "normal",
|
||||
// textAlign: "left",
|
||||
// text: BI.i18nText("Dec-Add_User_Tips")
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// bgap: 15
|
||||
// }, {
|
||||
// el: {
|
||||
// type: "bi.form",
|
||||
// cls: "dec-add-user-popup",
|
||||
// layouts: [{
|
||||
// type: "bi.vertical",
|
||||
// bgap: 15
|
||||
// }
|
||||
// ],
|
||||
// ref: function (e) {
|
||||
// t.form = e
|
||||
// },
|
||||
// items: e
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// },
|
||||
// getValue: function () {
|
||||
// var i = {};
|
||||
// return BI.each(this.form.getValue(), function (e, t) {
|
||||
// BI.extend(i, t)
|
||||
// }),
|
||||
// i
|
||||
// },
|
||||
// _close: function () {
|
||||
// this.fireEvent("EVENT_CLOSE")
|
||||
// },
|
||||
// _end: function () {
|
||||
// var t = this;
|
||||
// this.options;
|
||||
// this.form.submit(function () {
|
||||
// t.store.editUser(t.getValue(), function (e) {
|
||||
// e && t.getValue().resetPassword && sendEamil(t.getValue());
|
||||
// e && t._close()
|
||||
// })
|
||||
// })
|
||||
// },
|
||||
// _generatePassword: function () {
|
||||
// return Dec.Utils.generateRandomString(6)
|
||||
// }
|
||||
// });
|
||||
// e.EVENT_CLICK_CONFIRM = "EVENT_CONFIRM",
|
||||
// BI.shortcut("dec.user.edit.popup", e);
|
||||
//
|
||||
// var e = BI.inherit(BI.Widget, {
|
||||
// props: {
|
||||
// baseCls: "dec-edit-user-popup",
|
||||
// onClickConfirm: BI.emptyFn,
|
||||
// info: {},
|
||||
// roleEditable: !0,
|
||||
// passwordEditable: !0
|
||||
// },
|
||||
// _store: function () {
|
||||
// return BI.Models.getModel("dec.model.user.edit.popup", this.options)
|
||||
// },
|
||||
// watch: {
|
||||
// ableCopy: function (e) {
|
||||
// this.resetPasswordBtn.setEnable(!e),
|
||||
// this.copyBtn.setEnable(e)
|
||||
// },
|
||||
// password: function (e) {
|
||||
// this.resetPasswordBtn.setText(e ? BI.i18nText("Dec-Reset_Password_Done", e) : BI.i18nText("Dec-Reset_Password_Button"))
|
||||
// }
|
||||
// },
|
||||
// render: function () {
|
||||
// var e = this;
|
||||
// return {
|
||||
// type: "bi.vtape",
|
||||
// items: [{
|
||||
// el: this._rebuildCenter()
|
||||
// }, {
|
||||
// type: "bi.right_vertical_adapt",
|
||||
// lgap: 10,
|
||||
// height: 44,
|
||||
// items: [{
|
||||
// type: "bi.button",
|
||||
// text: BI.i18nText("Dec-Basic_Cancel"),
|
||||
// level: "ignore",
|
||||
// handler: function () {
|
||||
// e._close()
|
||||
// }
|
||||
// }, {
|
||||
// type: "bi.button",
|
||||
// text: BI.i18nText("Dec-Basic_Sure"),
|
||||
// handler: function () {
|
||||
// e._end()
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// },
|
||||
// _rebuildCenter: function () {
|
||||
// var t = this,
|
||||
// e = this.options.info;
|
||||
// return {
|
||||
// type: "bi.form",
|
||||
// cls: "dec-add-user-popup",
|
||||
// layouts: [{
|
||||
// type: "bi.vertical",
|
||||
// bgap: 15
|
||||
// }
|
||||
// ],
|
||||
// ref: function (e) {
|
||||
// t.form = e
|
||||
// },
|
||||
// items: [{
|
||||
// type: "bi.htape",
|
||||
// cls: "bi-tips",
|
||||
// height: 36,
|
||||
// items: [{
|
||||
// type: "bi.label",
|
||||
// textAlign: "left",
|
||||
// text: BI.i18nText("Dec-Basic_Tip") + ":",
|
||||
// height: 24,
|
||||
// width: 40
|
||||
// }, {
|
||||
// type: "bi.label",
|
||||
// whiteSpace: "normal",
|
||||
// textAlign: "left",
|
||||
// text: BI.i18nText("Dec-Add_User_Tips")
|
||||
// }
|
||||
// ]
|
||||
// }, {
|
||||
// label: {
|
||||
// type: "bi.label",
|
||||
// width: 80,
|
||||
// textAlign: "left",
|
||||
// text: BI.i18nText("Dec-User_Name")
|
||||
// },
|
||||
// el: {
|
||||
// type: "bi.label",
|
||||
// cls: "bi-border",
|
||||
// width: 428,
|
||||
// height: 22,
|
||||
// value: e.username,
|
||||
// textAlign: "left",
|
||||
// lgap: 4,
|
||||
// disabled: !0
|
||||
// }
|
||||
// }, {
|
||||
// type: "dec.form.editor",
|
||||
// $value: "real-name",
|
||||
// textWidth: 80,
|
||||
// editorWidth: 430,
|
||||
// text: BI.i18nText("Dec-Real_Name"),
|
||||
// watermark: BI.i18nText("Dec-Real_Name"),
|
||||
// value: e.realName,
|
||||
// rules: {
|
||||
// required: {
|
||||
// message: BI.i18nText("Dec-Real_Name_Can_Not_Null")
|
||||
// },
|
||||
// max: DecCst.STRING_SHORT_TEXT_LENGTH
|
||||
// },
|
||||
// ref: function (e) {
|
||||
// t.realName = e
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// type: "bi.vertical_adapt",
|
||||
// invisible: !this.options.passwordEditable,
|
||||
// items: [{
|
||||
// type: "bi.label",
|
||||
// textAlign: "left",
|
||||
// width: 80,
|
||||
// text: BI.i18nText("Dec-Reset_Password"),
|
||||
// title: BI.i18nText("Dec-Reset_Password")
|
||||
// }, {
|
||||
// type: "bi.form.error.item",
|
||||
// width: 350,
|
||||
// el: {
|
||||
// type: "bi.button",
|
||||
// $value: "reset-pwd",
|
||||
// text: BI.i18nText("Dec-Reset_Password_Button"),
|
||||
// handler: function () {
|
||||
// t.resetPasswordRow.hideError(),
|
||||
// t.store.genPassword(t._generatePassword())
|
||||
// },
|
||||
// ref: function (e) {
|
||||
// t.resetPasswordBtn = e
|
||||
// }
|
||||
// },
|
||||
// ref: function (e) {
|
||||
// t.resetPasswordRow = e
|
||||
// }
|
||||
// }, {
|
||||
// type: "bi.clipboard",
|
||||
// width: 80,
|
||||
// height: 24,
|
||||
// disabled: !this.model.ableCopy,
|
||||
// el: {
|
||||
// type: "bi.button",
|
||||
// clear: !0,
|
||||
// level: "ignore",
|
||||
// text: BI.i18nText("Dec-Copy_Password"),
|
||||
// tipType: "success",
|
||||
// title: BI.i18nText("Dec-Copy_Password"),
|
||||
// handler: function () {
|
||||
// BI.Msg.toast(BI.i18nText("Dec-Basic_Copy_Success"), {
|
||||
// level: "success"
|
||||
// })
|
||||
// }
|
||||
// },
|
||||
// copy: function () {
|
||||
// return t.model.password
|
||||
// },
|
||||
// ref: function (e) {
|
||||
// t.copyBtn = e
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// }, {
|
||||
// type: "dec.form.editor",
|
||||
// $value: "email",
|
||||
// textWidth: 80,
|
||||
// editorWidth: 430,
|
||||
// text: BI.i18nText("Dec-User_Email"),
|
||||
// watermark: BI.i18nText("Dec-User_Email"),
|
||||
// value: e.email,
|
||||
// rules: {
|
||||
// email: !0
|
||||
// },
|
||||
// ref: function (e) {
|
||||
// t.email = e
|
||||
// }
|
||||
// }, {
|
||||
// type: "dec.form.editor",
|
||||
// $value: "mobile",
|
||||
// textWidth: 80,
|
||||
// editorWidth: 430,
|
||||
// text: BI.i18nText("Dec-User_Mobile"),
|
||||
// watermark: BI.i18nText("Dec-User_Mobile"),
|
||||
// value: e.mobile,
|
||||
// rules: {
|
||||
// phone: !0
|
||||
// },
|
||||
// ref: function (e) {
|
||||
// t.mobile = e
|
||||
// }
|
||||
// }, {
|
||||
// type: "bi.vertical",
|
||||
// items: [{
|
||||
// type: "bi.vertical_adapt",
|
||||
// items: [{
|
||||
// type: "bi.label",
|
||||
// textAlign: "left",
|
||||
// width: 80,
|
||||
// text: BI.i18nText("Dec-Role")
|
||||
// }, {
|
||||
// type: "dec.select.role.combo",
|
||||
// ref: function (e) {
|
||||
// t.role = e
|
||||
// },
|
||||
// disabled: !this.options.roleEditable,
|
||||
// width: 430,
|
||||
// roleNames: e.roleNames,
|
||||
// roleIds: e.roleIds
|
||||
// }
|
||||
// ]
|
||||
// }, {
|
||||
// el: {
|
||||
// type: "bi.label",
|
||||
// textAlign: "left",
|
||||
// cls: "bi-tips",
|
||||
// text: BI.i18nText("Dec-User_Edit_User_Role_Column_Tip"),
|
||||
// invisible: !this.store.checkRoleEditTipVisible()
|
||||
// },
|
||||
// vgap: 10,
|
||||
// lgap: 80
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// },
|
||||
// getValue: function () {
|
||||
// var e = this.model.ableCopy ? {
|
||||
// password: BI.Providers.getProvider("dec.provider.cipher").getCipher(this.model.password)
|
||||
// }
|
||||
// : {};
|
||||
// return BI.extend({
|
||||
// username: this.options.info.username,
|
||||
// realName: this.realName.getValue(),
|
||||
// email: this.email.getValue(),
|
||||
// mobile: this.mobile.getValue(),
|
||||
// roleIds: this.role.getValue(),
|
||||
// roleNames: this.role.getText(),
|
||||
// enable: this.options.info.enable,
|
||||
// resetPassword: this.model.ableCopy
|
||||
// }, e)
|
||||
// },
|
||||
// _close: function () {
|
||||
// this.fireEvent("EVENT_CLOSE")
|
||||
// },
|
||||
// _end: function () {
|
||||
// var t = this,
|
||||
// i = this.options;
|
||||
// this.form.submit(function () {
|
||||
// i.onClickConfirm(t.getValue(), function (e) {
|
||||
// BI.isNotNull(e.data) ? (i.info.id === Dec.personal.userId && (Dec.UserInfo.displayName = t.realName.getValue()), BI.Msg.toast(BI.i18nText("Dec-Basic_Success_Save"), {
|
||||
// level: "success"
|
||||
// }), t._close()) : e.errorCode && e.errorCode === DecCst.ErrorCode.HISTORY_PASSWORD_LIMIT ? (t.resetPasswordRow.showError(BI.i18nText("Dec-Error_Reset_Password")), t.store.resetPassword()) : BI.Msg.toast(BI.i18nText("Dec-Basic_Save_Fail"), {
|
||||
// level: "error"
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// },
|
||||
// _generatePassword: function () {
|
||||
// return Dec.Utils.generateRandomString(6)
|
||||
// }
|
||||
// });
|
||||
// e.EVENT_CLICK_CONFIRM = "EVENT_CONFIRM",
|
||||
// BI.shortcut("dec.user.edit.popup", e)
|
||||
//
|
||||
// var e = BI.inherit(BI.Widget, {
|
||||
// props: {
|
||||
// editControll: {},
|
||||
// userInfo: {}
|
||||
// },
|
||||
// render: function () {
|
||||
// var t = this,
|
||||
// e = this.options;
|
||||
// e.userInfo;
|
||||
// return {
|
||||
// type: "bi.vertical_adapt",
|
||||
// invisible: !e.editControll.passwordEditable,
|
||||
// items: [{
|
||||
// type: "bi.label",
|
||||
// textAlign: "left",
|
||||
// width: 90,
|
||||
// text: BI.i18nText("Dec-Reset_Password"),
|
||||
// title: BI.i18nText("Dec-Reset_Password")
|
||||
// }, {
|
||||
// type: "bi.form.error.item",
|
||||
// width: 340,
|
||||
// el: {
|
||||
// type: "bi.button",
|
||||
// $value: "reset-pwd",
|
||||
// text: BI.i18nText("Dec-Reset_Password_Button"),
|
||||
// handler: function () {
|
||||
// t.resetPasswordRow.hideError(),
|
||||
// t.genPassword()
|
||||
// },
|
||||
// ref: function (e) {
|
||||
// t.resetPasswordBtn = e
|
||||
// }
|
||||
// },
|
||||
// ref: function (e) {
|
||||
// t.resetPasswordRow = e
|
||||
// }
|
||||
// }, {
|
||||
// type: "bi.clipboard",
|
||||
// width: 80,
|
||||
// height: 24,
|
||||
// disabled: !this.ableCopy,
|
||||
// el: {
|
||||
// type: "bi.button",
|
||||
// clear: !0,
|
||||
// level: "ignore",
|
||||
// text: BI.i18nText("Dec-Copy_Password"),
|
||||
// tipType: "success",
|
||||
// title: BI.i18nText("Dec-Copy_Password"),
|
||||
// handler: function () {
|
||||
// BI.Msg.toast(BI.i18nText("Dec-Basic_Copy_Success"), {
|
||||
// level: "success"
|
||||
// })
|
||||
// }
|
||||
// },
|
||||
// copy: function () {
|
||||
// return t.password
|
||||
// },
|
||||
// ref: function (e) {
|
||||
// t.copyBtn = e
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// },
|
||||
// genPassword: function (e) {
|
||||
// var t = this;
|
||||
// BI.Services.getService("dec.service.user.management").generatePassword(function (e) {
|
||||
// t.password = e,
|
||||
// t.resetPassword = !0,
|
||||
// // t.resetPasswordBtn.setText(e ? BI.i18nText("Dec-Reset_Password_Done", e) : BI.i18nText("Dec-Reset_Password_Button")),
|
||||
// t.resetPasswordBtn.setText(e ? '生成成功' : BI.i18nText("Dec-Reset_Password_Button")),
|
||||
// t.resetPasswordBtn.setEnable(!1),
|
||||
// t.copyBtn.setEnable(!0)
|
||||
// })
|
||||
// },
|
||||
// getValue: function () {
|
||||
// return {
|
||||
// resetPassword: !!this.resetPassword,
|
||||
// password: BI.Providers.getProvider("dec.provider.cipher").getCipher(this.password),
|
||||
// realPassword: this.password
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// BI.shortcut("dec.user.edit_user.item.password", e)
|
||||
//
|
||||
function sendEamil(userinfo){ |
||||
$.ajax({ |
||||
async:'false', |
||||
type:'POST', |
||||
url:'/decision/url/sendEmail', |
||||
data:userinfo, |
||||
function(){ |
||||
|
||||
} |
||||
}) |
||||
} |
Binary file not shown.
Loading…
Reference in new issue