<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link href="${base}/assets/attorney/css/mui.min.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="${base}/assets/attorney/css/wyhs.css" />
<link rel="stylesheet" type="text/css" href="${base}/assets/attorney/css/weuix.min.css" />
<script type="text/javascript" src="${base}/assets/attorney/js/mui.min.js" ></script>
<script src="${base}/assets/attorney/js/jquery-3.3.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="${base}/assets/attorney/js/app.js"></script>
</head>
<body >
<div id="content" class="mui-content-bg" >
<form action="${base}/messageAdd" method="post" class="mui-input-groups" >
<span class="mui-input-tipcontent">您可以反映侵害未成年人合法权益的相关问题,我们会及时处理,并通过预留电话或者邮箱回复您的问题。</span>
<div class="mui-input-row">
<label>您的称呼</label>
<input type="text" name="userName" id="userName" value="" placeholder="请输入您的称呼" />
</div>
<div class="mui-input-row">
<label>您的电话</label>
<input type="tel" name="linkPhone" id="linkPhone" value="" placeholder="请输入手机号或固定电话"/>
</div>
<div class="mui-input-row">
<label>您的邮箱</label>
<input type="email" name="email" id="email" value="" placeholder="请输入您的邮箱"/>
</div>
<div class="mui-input-row" style="height:120px;">
<label>反映内容</label>
<textarea name="preachContent" id="preachContent" cols="30" rows="4" value="" placeholder="请输入您的反映内容"></textarea>
</div>
提 交
这个是Controller
@At({"/messageAdd"})
@POST
@Ok("beetl:/platform/qt_attorney/message_tip.html")
@SLog(
tag = "我有话说",
msg = "${args[0].id}"
)
public void messageAdd(@Param("..") Attorney_Message attorneyMessage, HttpServletRequest req) {
try {
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
attorneyMessage.setCreateTime(sdf.format(date));
attorneyMessage.setStatus("01");
Wx_config config = (Wx_config)this.wxConfigService.fetch(Cnd.NEW().limit(1, 1));
String wxid = config.getId();
WxApi2 wxApi2 = this.wxConfigService.getWxApi2(wxid);
if (Lang.isEmpty(Globals.memoryJsapiTicketStore.get(wxid))) {
Globals.memoryJsapiTicketStore.put(wxid, new MemoryJsapiTicketStore());
}
MemoryJsapiTicketStore memoryJsapiTicketStore = (MemoryJsapiTicketStore)Globals.memoryJsapiTicketStore.get(wxid);
wxApi2.setJsapiTicketStore(memoryJsapiTicketStore);
String picPath = ";";
String picPaths = req.getParameter("picPath");
if (!StringUtils.isEmpty(picPaths)) {
String[] pics = picPaths.split(",");
for(int i = 1; i < pics.length; ++i) {
String var10000 = pics[i];
NutResource nutResource = wxApi2.media_get(pics[i]);
String p = Globals.AppRoot;
String f = Globals.AppUploadPath + "/image/" + DateUtil.format(new Date(), "yyyyMMdd") + "/" + R.UU32();
Files.write(new File(p + f + ".jpg"), nutResource.getInputStream());
picPath = picPath + Globals.AppBase + f + ".jpg;";
}
}
attorneyMessage.setPicPath(picPath);
if (!attorneyMessage.getUserName().isEmpty() && !attorneyMessage.getPreachContent().isEmpty()) {
this.attorneyMessageService.insert(attorneyMessage);
}
Result.success("system.success");
} catch (Exception var17) {
Result.error("system.error");
}
}
用nutzWk开发的微信公众号,服务器是linux,数据库是mysql(编码已经改成utf-8)
首次发布的都为乱码 之后就正常显示了