\n <\/div>\n<\/div>",
81 | "ChatWindowTheme": "beauty_01",
82 | "CustomTitle": "CC\u5ba2\u670d",
83 | "CCKFHome": "http:\/\/www.qycn.com\/kf",
84 | "debug": "",
85 | "logurl": "http:\/\/kefu.qycn.com\/index.php?c=writeLog&type=vclient",
86 | "isautoonline": 0,
87 | "customizedIconHeight": 0,
88 | "customizedIconWeight": 0,
89 | "robotListOpen": 0,
90 | "showListInIcon": 0,
91 | "robotName": "\u667a\u80fd\u5ba2\u670d\u5c0fC",
92 | "robotOpenState": 1,
93 | "RobotListOpen": 0,
94 | "areaKey": "5",
95 | "languageXMLContent": "",
96 | "leavingMessageSetting": 1,
97 | "dialogList": null,
98 | "qiyeQQImage": "http:\/\/kefu.qycn.com\/vclient\/chat\/assets\/images\/qq.gif",
99 | "chDockFontDisplayContent": ""
100 | };
101 |
102 |
103 | document.writeln("
");
104 | document.writeln("
");
105 | document.writeln("");
106 |
107 |
--------------------------------------------------------------------------------
/src/main/java/com/minchat/sys/controller/LoginController.java:
--------------------------------------------------------------------------------
1 | package com.minchat.sys.controller;
2 |
3 | import com.minchat.core.encrypt.EncryptUtil;
4 | import com.minchat.core.util.VerifyCodeUtil;
5 | import org.apache.commons.lang3.StringUtils;
6 | import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
7 | import org.apache.commons.lang3.builder.ToStringStyle;
8 | import org.apache.shiro.SecurityUtils;
9 | import org.apache.shiro.authc.*;
10 | import org.apache.shiro.subject.Subject;
11 | import org.apache.shiro.web.util.WebUtils;
12 | import org.slf4j.Logger;
13 | import org.slf4j.LoggerFactory;
14 | import org.springframework.stereotype.Controller;
15 | import org.springframework.web.bind.annotation.RequestMapping;
16 | import org.springframework.web.bind.annotation.RequestMethod;
17 | import org.springframework.web.servlet.view.InternalResourceViewResolver;
18 |
19 | import javax.imageio.ImageIO;
20 | import javax.servlet.http.HttpServletRequest;
21 | import javax.servlet.http.HttpServletResponse;
22 | import java.awt.*;
23 | import java.awt.image.BufferedImage;
24 | import java.io.IOException;
25 |
26 | @Controller
27 | @RequestMapping("/")
28 | public class LoginController {
29 |
30 | private static final Logger logger = LoggerFactory.getLogger(LoginController.class);
31 |
32 | /**
33 | * 获取验证码图片和文本(验证码文本会保存在HttpSession中)
34 | */
35 | @RequestMapping("getVerifyCodeImage")
36 | public void getVerifyCodeImage(HttpServletRequest request, HttpServletResponse response) throws IOException {
37 | //设置页面不缓存
38 | response.setHeader("Pragma", "no-cache");
39 | response.setHeader("Cache-Control", "no-cache");
40 | response.setDateHeader("Expires", 0);
41 | String verifyCode = VerifyCodeUtil.generateTextCode(VerifyCodeUtil.TYPE_NUM_ONLY, 4, null);
42 | //将验证码放到HttpSession里面
43 | request.getSession().setAttribute("verifyCode", verifyCode);
44 | logger.info("本次生成的验证码为[{}],已存放到HttpSession中", verifyCode);
45 | //设置输出的内容的类型为JPEG图像
46 | response.setContentType("image/jpeg");
47 | BufferedImage bufferedImage = VerifyCodeUtil.generateImageCode(verifyCode, 90, 30, 3, true, Color.WHITE, Color.BLACK, null);
48 | //写给浏览器
49 | ImageIO.write(bufferedImage, "JPEG", response.getOutputStream());
50 | }
51 |
52 | /**
53 | * 用户登录页面
54 | */
55 | @RequestMapping(value = "login", method = RequestMethod.GET)
56 | public String tologin(HttpServletRequest request) {
57 | return "login";
58 | }
59 |
60 | /**
61 | * 用户登录验证
62 | */
63 | @RequestMapping(value = "login", method = RequestMethod.POST)
64 | public String login(HttpServletRequest request) {
65 | String resultPageURL = InternalResourceViewResolver.FORWARD_URL_PREFIX + "/";
66 | String username = request.getParameter("username");
67 | String password = request.getParameter("password");
68 | String reminder = request.getParameter("reminder");
69 | //获取HttpSession中的验证码
70 | String verifyCode = (String) request.getSession().getAttribute("verifyCode");
71 | //获取用户请求表单中输入的验证码
72 | String submitCode = WebUtils.getCleanParam(request, "verifyCode");
73 | logger.info("用户[" + username + "]登录时输入的验证码为[" + submitCode + "],HttpSession中的验证码为[" + verifyCode + "]");
74 | if (StringUtils.isEmpty(submitCode) || !StringUtils.equals(verifyCode, submitCode.toLowerCase())) {
75 | request.setAttribute("message_login", "验证码不正确");
76 | return "login";
77 | }
78 | String encrptPassword = EncryptUtil.encryptSha256(password);
79 | UsernamePasswordToken token = new UsernamePasswordToken(username, encrptPassword);
80 | if ("1".equals(reminder)) {
81 | token.setRememberMe(true);
82 | }
83 |
84 | logger.info("为了验证登录用户而封装的token为" + ReflectionToStringBuilder.toString(token, ToStringStyle.MULTI_LINE_STYLE));
85 | //获取当前的Subject
86 | Subject currentUser = SecurityUtils.getSubject();
87 | try {
88 | //在调用了login方法后,SecurityManager会收到AuthenticationToken,并将其发送给已配置的Realm执行必须的认证检查
89 | //每个Realm都能在必要时对提交的AuthenticationTokens作出反应
90 | //所以这一步在调用login(token)方法时,它会走到MyRealm.doGetAuthenticationInfo()方法中,具体验证方式详见此方法
91 | logger.info("对用户[" + username + "]进行登录验证..验证开始");
92 | currentUser.login(token);
93 | logger.info("对用户[" + username + "]进行登录验证..验证通过");
94 | //resultPageURL = "user";
95 | } catch (UnknownAccountException uae) {
96 | logger.info("对用户[" + username + "]进行登录验证..验证未通过,未知账户");
97 | request.setAttribute("message_login", "未知账户");
98 | } catch (IncorrectCredentialsException ice) {
99 | logger.info("对用户[" + username + "]进行登录验证..验证未通过,错误的凭证");
100 | request.setAttribute("message_login", "密码不正确");
101 | } catch (LockedAccountException lae) {
102 | logger.info("对用户[" + username + "]进行登录验证..验证未通过,账户已锁定");
103 | request.setAttribute("message_login", "账户已锁定");
104 | } catch (ExcessiveAttemptsException eae) {
105 | logger.info("对用户[" + username + "]进行登录验证..验证未通过,错误次数过多");
106 | request.setAttribute("message_login", "用户名或密码错误次数过多");
107 | } catch (AuthenticationException ae) {
108 | //通过处理Shiro的运行时AuthenticationException就可以控制用户登录失败或密码错误时的情景
109 | logger.info("对用户[" + username + "]进行登录验证..验证未通过,堆栈轨迹如下");
110 | ae.printStackTrace();
111 | request.setAttribute("message_login", "用户名或密码不正确");
112 | }
113 | //验证是否登录成功
114 | if (currentUser.isAuthenticated()) {
115 | logger.info("用户[" + username + "]登录认证通过(这里可以进行一些认证通过后的一些系统参数初始化操作)");
116 | request.setAttribute("message_login", "success");
117 | resultPageURL = "turnToMain";
118 | } else {
119 | token.clear();
120 | }
121 | return resultPageURL;
122 | }
123 |
124 |
125 | /**
126 | * 用户登出
127 | */
128 | @RequestMapping("/logout")
129 | public String logout(HttpServletRequest request) {
130 | SecurityUtils.getSubject().logout();
131 | return InternalResourceViewResolver.REDIRECT_URL_PREFIX + "/";
132 | }
133 |
134 | /**
135 | * 跳转页面
136 | */
137 | @RequestMapping("/turnToMain")
138 | public String turnToMain(HttpServletRequest request) {
139 | return "turnToMain";
140 | }
141 |
142 | // /**
143 | // * 加上用户登录的remember me 的cookie
144 | // * @param request
145 | // * @param response
146 | // * @param username
147 | // * @param enPassword
148 | // */
149 | // private void writeRememberMeCookie(HttpServletRequest request,HttpServletResponse response,String username,String enPassword){
150 | // String rememberMe=request.getParameter("_spring_security_remember_me");
151 | // if("1".equals(rememberMe)){
152 | // long tokenValiditySeconds = 1209600; // 14 days
153 | // long tokenExpiryTime = System.currentTimeMillis() + (tokenValiditySeconds * 1000);
154 | // String signatureValue = DigestUtils.md5Hex(username + ":" + tokenExpiryTime + ":" + enPassword + ":" + rememberPrivateKey);
155 | // String tokenValue = username + ":" + tokenExpiryTime + ":" + signatureValue;
156 | // String tokenValueBase64 = new String(Base64.encodeBase64(tokenValue.getBytes()));
157 | // Cookie cookie = new Cookie(TokenBasedRememberMeServices.SPRING_SECURITY_REMEMBER_ME_COOKIE_KEY, tokenValueBase64);
158 | // cookie.setMaxAge(60 * 60 * 24 * 365 * 5); // 5 years
159 | // cookie.setPath(org.springframework.util.StringUtils.hasLength(request.getContextPath()) ? request.getContextPath() : "/");
160 | // response.addCookie(cookie);
161 | // }
162 | // }
163 | }
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
3 | 4.0.0
4 | com
5 | minchat
6 | war
7 | 0.0.1-SNAPSHOT
8 | minchat Maven Webapp
9 | http://maven.apache.org
10 |
11 |
12 | 4.1.6.RELEASE
13 |
14 | 3.2.3
15 |
16 | 1.6.6
17 | 1.2.17
18 | 2.5
19 | 1.2.3
20 |
21 |
22 |
23 |
24 |
25 | org.springframework
26 | spring-core
27 | ${spring.version}
28 |
29 |
30 |
31 | org.springframework
32 | spring-web
33 | ${spring.version}
34 |
35 |
36 |
37 | org.springframework
38 | spring-oxm
39 | ${spring.version}
40 |
41 |
42 |
43 | org.springframework
44 | spring-tx
45 | ${spring.version}
46 |
47 |
48 |
49 | org.springframework
50 | spring-jdbc
51 | ${spring.version}
52 |
53 |
54 |
55 | org.springframework
56 | spring-webmvc
57 | ${spring.version}
58 |
59 |
60 |
61 | org.springframework
62 | spring-aop
63 | ${spring.version}
64 |
65 |
66 |
67 | org.springframework
68 | spring-context-support
69 | ${spring.version}
70 |
71 |
72 |
73 | org.springframework
74 | spring-aop
75 | ${spring.version}
76 |
77 |
78 |
79 | org.springframework
80 | spring-test
81 | ${spring.version}
82 |
83 |
84 |
85 |
86 |
87 | javax.servlet
88 | servlet-api
89 | ${servlet.version}
90 |
91 |
92 |
93 | taglibs
94 | standard
95 | 1.1.2
96 |
97 |
98 |
99 | jstl
100 | jstl
101 | 1.2
102 |
103 |
110 |
111 |
112 |
113 | commons-codec
114 | commons-codec
115 | 1.10
116 |
117 |
118 |
119 |
120 |
121 | org.mybatis
122 | mybatis
123 | ${mybatis.version}
124 |
125 |
126 |
127 | org.mybatis
128 | mybatis-spring
129 | 1.2.2
130 |
131 |
132 |
133 | mysql
134 | mysql-connector-java
135 | 5.1.29
136 |
137 |
138 |
139 | junit
140 | junit
141 | 3.8.1
142 | test
143 |
144 |
145 |
146 | com.alibaba
147 | druid
148 | 1.0.2
149 |
150 |
151 |
152 |
153 | org.codehaus.jackson
154 | jackson-mapper-asl
155 | 1.9.13
156 |
157 |
158 |
159 |
160 | org.apache.shiro
161 | shiro-core
162 | ${shiro.version}
163 |
164 |
165 | org.apache.shiro
166 | shiro-web
167 | ${shiro.version}
168 |
169 |
170 | org.apache.shiro
171 | shiro-spring
172 | ${shiro.version}
173 |
174 |
175 |
176 |
177 | org.apache.commons
178 | commons-lang3
179 | 3.2.1
180 |
181 |
185 |
186 | com.alibaba
187 | fastjson
188 | 1.2.5
189 |
190 |
191 |
192 |
193 | com.googlecode.ehcache-spring-annotations
194 | ehcache-spring-annotations
195 | 1.2.0
196 |
197 |
198 | net.sf.ehcache
199 | ehcache
200 | 2.7.4
201 |
202 |
203 |
204 |
205 | ch.qos.logback
206 | logback-classic
207 | 1.1.3
208 |
209 |
210 | org.logback-extensions
211 | logback-ext-spring
212 | 0.1.2
213 |
214 |
215 | org.slf4j
216 | jcl-over-slf4j
217 | 1.7.12
218 |
219 |
220 |
221 |
222 |
223 | org.apache.tomcat
224 | tomcat7-websocket
225 | 7.0.47
226 | provided
227 |
228 |
229 |
230 | minchat
231 |
232 |
233 |
--------------------------------------------------------------------------------
/src/main/java/com/minchat/core/util/VerifyCodeUtil.java:
--------------------------------------------------------------------------------
1 | package com.minchat.core.util;
2 |
3 | import java.awt.*;
4 | import java.awt.image.BufferedImage;
5 | import java.util.Random;
6 |
7 | /**
8 | * 验证码生成器
9 | *
10 | * @author 玄玉
11 | * @create Sep 29, 2013 4:23:13 PM
12 | * @see --------------------------------------------------------------------------------------------------------------
13 | * @see 可生成数字、大写、小写字母及三者混合类型的验证码
14 | * @see 支持自定义验证码字符数量,支持自定义验证码图片的大小,支持自定义需排除的特殊字符,支持自定义干扰线的数量,支持自定义验证码图文颜色
15 | * @see --------------------------------------------------------------------------------------------------------------
16 | * @see 另外,给Shiro加入验证码有多种方式,也可以通过继承修改FormAuthenticationFilter类,通过Shiro去验证验证码
17 | * @see 而这里既然使用了SpringMVC,也为了简化操作,就使用此工具生成验证码,并在Controller中处理验证码的校验
18 | * @see --------------------------------------------------------------------------------------------------------------
19 | */
20 | public class VerifyCodeUtil {
21 | /**
22 | * 验证码类型为仅数字,即0~9
23 | */
24 | public static final int TYPE_NUM_ONLY = 0;
25 |
26 | /**
27 | * 验证码类型为仅字母,即大小写字母混合
28 | */
29 | public static final int TYPE_LETTER_ONLY = 1;
30 |
31 | /**
32 | * 验证码类型为数字和大小写字母混合
33 | */
34 | public static final int TYPE_ALL_MIXED = 2;
35 |
36 | /**
37 | * 验证码类型为数字和大写字母混合
38 | */
39 | public static final int TYPE_NUM_UPPER = 3;
40 |
41 | /**
42 | * 验证码类型为数字和小写字母混合
43 | */
44 | public static final int TYPE_NUM_LOWER = 4;
45 |
46 | /**
47 | * 验证码类型为仅大写字母
48 | */
49 | public static final int TYPE_UPPER_ONLY = 5;
50 |
51 | /**
52 | * 验证码类型为仅小写字母
53 | */
54 | public static final int TYPE_LOWER_ONLY = 6;
55 |
56 | private VerifyCodeUtil() {
57 | }
58 |
59 | /**
60 | * 生成随机颜色
61 | */
62 | private static Color generateRandomColor() {
63 | Random random = new Random();
64 | return new Color(random.nextInt(255), random.nextInt(255), random.nextInt(255));
65 | }
66 |
67 |
68 | /**
69 | * 生成图片验证码
70 | *
71 | * @param type 验证码类型,参见本类的静态属性
72 | * @param length 验证码字符长度,要求大于0的整数
73 | * @param excludeString 需排除的特殊字符
74 | * @param width 图片宽度(注意此宽度若过小,容易造成验证码文本显示不全,如4个字符的文本可使用85到90的宽度)
75 | * @param height 图片高度
76 | * @param interLine 图片中干扰线的条数
77 | * @param randomLocation 每个字符的高低位置是否随机
78 | * @param backColor 图片颜色,若为null则表示采用随机颜色
79 | * @param foreColor 字体颜色,若为null则表示采用随机颜色
80 | * @param lineColor 干扰线颜色,若为null则表示采用随机颜色
81 | * @return 图片缓存对象
82 | */
83 | public static BufferedImage generateImageCode(int type, int length, String excludeString, int width, int height, int interLine, boolean randomLocation, Color backColor, Color foreColor, Color lineColor) {
84 | String textCode = generateTextCode(type, length, excludeString);
85 | return generateImageCode(textCode, width, height, interLine, randomLocation, backColor, foreColor, lineColor);
86 | }
87 |
88 |
89 | /**
90 | * 生成验证码字符串
91 | *
92 | * @param type 验证码类型,参见本类的静态属性
93 | * @param length 验证码长度,要求大于0的整数
94 | * @param excludeString 需排除的特殊字符(无需排除则为null)
95 | * @return 验证码字符串
96 | */
97 | public static String generateTextCode(int type, int length, String excludeString) {
98 | if (length <= 0) {
99 | return "";
100 | }
101 | StringBuffer verifyCode = new StringBuffer();
102 | int i = 0;
103 | Random random = new Random();
104 | switch (type) {
105 | case TYPE_NUM_ONLY:
106 | while (i < length) {
107 | int t = random.nextInt(10);
108 | //排除特殊字符
109 | if (null == excludeString || excludeString.indexOf(t + "") < 0) {
110 | verifyCode.append(t);
111 | i++;
112 | }
113 | }
114 | break;
115 | case TYPE_LETTER_ONLY:
116 | while (i < length) {
117 | int t = random.nextInt(123);
118 | if ((t >= 97 || (t >= 65 && t <= 90)) && (null == excludeString || excludeString.indexOf((char) t) < 0)) {
119 | verifyCode.append((char) t);
120 | i++;
121 | }
122 | }
123 | break;
124 | case TYPE_ALL_MIXED:
125 | while (i < length) {
126 | int t = random.nextInt(123);
127 | if ((t >= 97 || (t >= 65 && t <= 90) || (t >= 48 && t <= 57)) && (null == excludeString || excludeString.indexOf((char) t) < 0)) {
128 | verifyCode.append((char) t);
129 | i++;
130 | }
131 | }
132 | break;
133 | case TYPE_NUM_UPPER:
134 | while (i < length) {
135 | int t = random.nextInt(91);
136 | if ((t >= 65 || (t >= 48 && t <= 57)) && (null == excludeString || excludeString.indexOf((char) t) < 0)) {
137 | verifyCode.append((char) t);
138 | i++;
139 | }
140 | }
141 | break;
142 | case TYPE_NUM_LOWER:
143 | while (i < length) {
144 | int t = random.nextInt(123);
145 | if ((t >= 97 || (t >= 48 && t <= 57)) && (null == excludeString || excludeString.indexOf((char) t) < 0)) {
146 | verifyCode.append((char) t);
147 | i++;
148 | }
149 | }
150 | break;
151 | case TYPE_UPPER_ONLY:
152 | while (i < length) {
153 | int t = random.nextInt(91);
154 | if ((t >= 65) && (null == excludeString || excludeString.indexOf((char) t) < 0)) {
155 | verifyCode.append((char) t);
156 | i++;
157 | }
158 | }
159 | break;
160 | case TYPE_LOWER_ONLY:
161 | while (i < length) {
162 | int t = random.nextInt(123);
163 | if ((t >= 97) && (null == excludeString || excludeString.indexOf((char) t) < 0)) {
164 | verifyCode.append((char) t);
165 | i++;
166 | }
167 | }
168 | break;
169 | }
170 | return verifyCode.toString();
171 | }
172 |
173 | /**
174 | * 已有验证码,生成验证码图片
175 | *
176 | * @param textCode 文本验证码
177 | * @param width 图片宽度(注意此宽度若过小,容易造成验证码文本显示不全,如4个字符的文本可使用85到90的宽度)
178 | * @param height 图片高度
179 | * @param interLine 图片中干扰线的条数
180 | * @param randomLocation 每个字符的高低位置是否随机
181 | * @param backColor 图片颜色,若为null则表示采用随机颜色
182 | * @param foreColor 字体颜色,若为null则表示采用随机颜色
183 | * @param lineColor 干扰线颜色,若为null则表示采用随机颜色
184 | * @return 图片缓存对象
185 | */
186 | public static BufferedImage generateImageCode(String textCode, int width, int height, int interLine, boolean randomLocation, Color backColor, Color foreColor, Color lineColor) {
187 | //创建内存图像
188 | BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
189 | //获取图形上下文
190 | Graphics graphics = bufferedImage.getGraphics();
191 | //画背景图
192 | graphics.setColor(null == backColor ? generateRandomColor() : backColor);
193 | graphics.fillRect(0, 0, width, height);
194 | //画干扰线
195 | Random random = new Random();
196 | if (interLine > 0) {
197 | int x = 0, y = 0, x1 = width, y1 = 0;
198 | for (int i = 0; i < interLine; i++) {
199 | graphics.setColor(null == lineColor ? generateRandomColor() : lineColor);
200 | y = random.nextInt(height);
201 | y1 = random.nextInt(height);
202 | graphics.drawLine(x, y, x1, y1);
203 | }
204 | }
205 | //字体大小为图片高度的80%
206 | int fsize = (int) (height * 0.8);
207 | int fx = height - fsize;
208 | int fy = fsize;
209 | //设定字体
210 | graphics.setFont(new Font("Default", Font.PLAIN, fsize));
211 | //写验证码字符
212 | for (int i = 0; i < textCode.length(); i++) {
213 | fy = randomLocation ? (int) ((Math.random() * 0.3 + 0.6) * height) : fy;
214 | graphics.setColor(null == foreColor ? generateRandomColor() : foreColor);
215 | //将验证码字符显示到图象中
216 | graphics.drawString(textCode.charAt(i) + "", fx, fy);
217 | fx += fsize * 0.9;
218 | }
219 | graphics.dispose();
220 | return bufferedImage;
221 | }
222 | }
--------------------------------------------------------------------------------
/src/main/webapp/resources/css/jscrollpane1.css:
--------------------------------------------------------------------------------
1 | @charset "utf-8";
2 | html, body {
3 | margin: 0;
4 | height: 100%;
5 | }
6 |
7 | body {
8 | font-family: verdana, Arial, Helvetica, "宋体", sans-serif;
9 | font-size: 12px;
10 | }
11 |
12 | body, div, dl, dt, dd, ol, li, h1, h2, h3, h4, h5, h6, pre, form, fieldset, input, P, blockquote, th, td, img,
13 | INS {
14 | margin: 0px;
15 | padding: 0px;
16 | border: 0;
17 | }
18 |
19 | ol {
20 | list-style-type: none;
21 | }
22 |
23 | img, input {
24 | border: none;
25 | }
26 |
27 | a {
28 | color: #198DD0;
29 | text-decoration: none;
30 | }
31 |
32 | a:hover {
33 | color: #ba2636;
34 | text-decoration: underline;
35 | }
36 |
37 | a {
38 | blr: expression(this.onFocus=this.blur())
39 | }
40 |
41 | /*去掉a标签的虚线框,避免出现奇怪的选中区域*/
42 | :focus {
43 | outline: 0;
44 | }
45 |
46 | /*讨论留言添加表情*/
47 | .add_face {
48 | background-image: url(../images/add_emoticons.png);
49 | background-repeat: no-repeat;
50 | height: 24px;
51 | width: 24px;
52 | background-color: transparent;
53 | }
54 |
55 | /*视频聊天区*/
56 | .talk {
57 | height: 100%;
58 | width: 100%;
59 | margin: 0 auto;
60 | border-left-width: 1px;
61 | border-left-style: solid;
62 | border-left-color: #444;
63 | }
64 |
65 | .talk_title {
66 | width: 100%;
67 | height: 8%;
68 | line-height: 40px;
69 | text-indent: 12px;
70 | font-size: 16px;
71 | font-weight: bold;
72 | color: #afafaf;
73 | background: #212121;
74 | border-bottom-width: 1px;
75 | border-bottom-style: solid;
76 | border-bottom-color: #434343;
77 | font-family: "微软雅黑";
78 | }
79 |
80 | .talk_title span {
81 | float: left
82 | }
83 |
84 | .talk_title_c {
85 | width: 100%;
86 | height: 30px;
87 | line-height: 30px;
88 | }
89 |
90 | .talk_record {
91 | width: 100%;
92 | height: 84%;
93 | overflow: hidden;
94 | border-bottom-width: 1px;
95 | border-bottom-style: solid;
96 | border-bottom-color: #434343;
97 | margin: 0px;
98 | background-image: url(../images/graybg.jpg);
99 | }
100 |
101 | .talk_word {
102 | line-height: 40px;
103 | height: 8%;
104 | width: 100%;
105 | background: #212121;
106 | }
107 |
108 | .messages {
109 | height: 24px;
110 | width: 240px;
111 | text-indent: 5px;
112 | overflow: hidden;
113 | font-size: 12px;
114 | line-height: 24px;
115 | color: #666;
116 | background-color: #ccc;
117 | border-radius: 3px;
118 | -moz-border-radius: 3px;
119 | -webkit-border-radius: 3px;
120 | }
121 |
122 | .messages:hover {
123 | background-color: #fff;
124 | }
125 |
126 | .talk_send {
127 | width: 50px;
128 | height: 24px;
129 | line-height: 24px;
130 | font-size: 12px;
131 | border: 0px;
132 | margin-left: 2px;
133 | color: #fff;
134 | background-image: url(../images/talk_send_btn.png);
135 | background-repeat: no-repeat;
136 | background-position: 0px 0px;
137 | background-color: transparent;
138 | font-family: "微软雅黑";
139 | }
140 |
141 | .talk_send:hover {
142 | background-position: 0px -24px;
143 | }
144 |
145 | .talk_record ul {
146 | padding-left: 5px;
147 | }
148 |
149 | .talk_record li {
150 | line-height: 25px;
151 | }
152 |
153 | .talk_word .controlbtn a {
154 | margin: 12px;
155 | }
156 |
157 | .talk .talk_word .order {
158 | float: left;
159 | display: block;
160 | height: 14px;
161 | width: 16px;
162 | background-image: url(../images/loop.png);
163 | background-repeat: no-repeat;
164 | background-position: 0px 0px;
165 | }
166 |
167 | .talk .talk_word .loop {
168 | float: left;
169 | display: block;
170 | height: 14px;
171 | width: 16px;
172 | background-image: url(../images/loop.png);
173 | background-repeat: no-repeat;
174 | background-position: -30px 0px;
175 | }
176 |
177 | .talk .talk_word .single {
178 | float: left;
179 | display: block;
180 | height: 14px;
181 | width: 16px;
182 | background-image: url(../images/loop.png);
183 | background-repeat: no-repeat;
184 | background-position: -60px 0px;
185 | }
186 |
187 | .talk .talk_word .order:hover, .talk .talk_word .active {
188 | background-position: 0px -20px;
189 | text-decoration: none;
190 | }
191 |
192 | .talk .talk_word .loop:hover {
193 | background-position: -30px -20px;
194 | text-decoration: none;
195 | }
196 |
197 | .talk .talk_word .single:hover {
198 | background-position: -60px -20px;
199 | text-decoration: none;
200 | }
201 |
202 | /* * CSS Styles that are needed by jScrollPane for it to operate correctly. * * Include this stylesheet in your site or copy and paste the styles below into your stylesheet - jScrollPane * may not operate correctly without them. */
203 | .jspContainer {
204 | overflow: hidden;
205 | position: relative;
206 | }
207 |
208 | .jspPane {
209 | position: absolute;
210 | }
211 |
212 | .jspVerticalBar {
213 | position: absolute;
214 | top: 0;
215 | right: 0;
216 | width: 8px;
217 | height: 100%;
218 | background-color: transparent;
219 | }
220 |
221 | .jspHorizontalBar {
222 | position: absolute;
223 | bottom: 0;
224 | left: 0;
225 | width: 100%;
226 | height: 8px;
227 | background-color: transparent;
228 | }
229 |
230 | .jspVerticalBar *, .jspHorizontalBar * {
231 | margin: 0;
232 | padding: 0;
233 | }
234 |
235 | .jspCap {
236 | display: none;
237 | }
238 |
239 | .jspHorizontalBar .jspCap {
240 | float: left;
241 | }
242 |
243 | .jspTrack {
244 | position: relative;
245 | background-color: transparent;
246 | }
247 |
248 | .jspDrag {
249 | background: #ccc;
250 | position: relative;
251 | top: 0;
252 | left: 0;
253 | cursor: pointer;
254 | border: 1px solid #333;
255 | -moz-border-radius: 5px;
256 | -webkit-border-radius: 5px;
257 | border-radius: 5px;
258 | }
259 |
260 | .jspHorizontalBar .jspTrack, .jspHorizontalBar .jspDrag {
261 | float: left;
262 | height: 100%;
263 | }
264 |
265 | .jspArrow {
266 | background: #50506d;
267 | text-indent: -20000px;
268 | display: block;
269 | cursor: pointer;
270 | }
271 |
272 | .jspArrow.jspDisabled {
273 | cursor: default;
274 | background: #80808d;
275 | }
276 |
277 | .jspVerticalBar .jspArrow {
278 | height: 8px;
279 | }
280 |
281 | .jspHorizontalBar .jspArrow {
282 | width: 8px;
283 | float: left;
284 | height: 100%;
285 | }
286 |
287 | .jspVerticalBar .jspArrow:focus {
288 | outline: none;
289 | }
290 |
291 | .jspCorner {
292 | background: #eeeef4;
293 | float: left;
294 | height: 100%;
295 | }
296 |
297 | /* Yuk! CSS Hack for IE6 3 pixel bug :( */
298 | * html .jspCorner {
299 | margin: 0 -3px 0 0;
300 | }
301 |
302 | .jp-container {
303 | width: 100%;
304 | height: 100%;
305 | position: relative;
306 | background-color: transparent;
307 | float: left;
308 | }
309 |
310 | /*讨论区*/
311 | .jp-container .talk_recordbox {
312 | min-height: 80px;
313 | color: #afafaf;
314 | padding-top: 5px;
315 | padding-right: 10px;
316 | padding-left: 10px;
317 | padding-bottom: 0px;
318 | }
319 |
320 | .jp-container .talk_recordbox:first-child {
321 | border-top: none;
322 | }
323 |
324 | .jp-container .talk_recordbox:last-child {
325 | border-bottom: none;
326 | }
327 |
328 | .jp-container .talk_recordbox .talk_recordtextbg {
329 | float: left;
330 | width: 10px;
331 | height: 30px;
332 | display: block;
333 | background-image: url(../images/talk_recordtext.png);
334 | background-repeat: no-repeat;
335 | background-position: left top;
336 | }
337 |
338 | .jp-container .talk_recordbox .talk_recordtext {
339 | -moz-border-radius: 5px;
340 | -webkit-border-radius: 5px;
341 | border-radius: 5px;
342 | background-color: #b8d45c;
343 | width: 240px;
344 | height: auto;
345 | display: block;
346 | padding: 5px;
347 | float: left;
348 | color: #333333;
349 | }
350 |
351 | .jp-container .talk_recordbox h3 {
352 | font-size: 3em;
353 | padding: 2px 0 5px 0;
354 | text-transform: uppercase;
355 | font-weight: 100;
356 |
357 | }
358 |
359 | .jp-container .talk_recordbox .user {
360 | float: left;
361 | display: inline;
362 | height: 45px;
363 | width: 45px;
364 | margin-top: 0px;
365 | margin-right: 5px;
366 | margin-bottom: 0px;
367 | margin-left: 0px;
368 | font-size: 12px;
369 | line-height: 20px;
370 | text-align: center;
371 | }
372 |
373 | /*自己发言样式*/
374 | .jp-container .talk_recordboxme {
375 | display: block;
376 | min-height: 80px;
377 | color: #afafaf;
378 | padding-top: 5px;
379 | padding-right: 10px;
380 | padding-left: 10px;
381 | padding-bottom: 0px;
382 | }
383 |
384 | .jp-container .talk_recordboxme .talk_recordtextbg {
385 | float: right;
386 | width: 10px;
387 | height: 30px;
388 | display: block;
389 | background-image: url(../images/talk_recordtextme.png);
390 | background-repeat: no-repeat;
391 | background-position: left top;
392 | }
393 |
394 | .jp-container .talk_recordboxme .talk_recordtext {
395 | -moz-border-radius: 5px;
396 | -webkit-border-radius: 5px;
397 | border-radius: 5px;
398 | background-color: #fcfcfc;
399 | width: 240px;
400 | height: auto;
401 | padding: 5px;
402 | color: #666;
403 | font-size: 12px;
404 | float: right;
405 |
406 | }
407 |
408 | .jp-container .talk_recordboxme h3 {
409 | font-size: 14px;
410 | padding: 2px 0 5px 0;
411 | text-transform: uppercase;
412 | font-weight: 100;
413 | color: #333333;
414 |
415 | }
416 |
417 | .jp-container .talk_recordboxme .user {
418 | float: right;
419 | height: 45px;
420 | width: 45px;
421 | margin-top: 0px;
422 | margin-right: 10px;
423 | margin-bottom: 0px;
424 | margin-left: 5px;
425 | font-size: 12px;
426 | line-height: 20px;
427 | text-align: center;
428 | display: inline;
429 | }
430 |
431 | .talk_time {
432 | color: #666;
433 | text-align: right;
434 | width: 240px;
435 | display: block;
436 | }
--------------------------------------------------------------------------------
/src/main/resources/mapper/SysUserMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
29 | USERID, FULLNAME, NICKNAME, ACCOUNT, PASSWORD, ISEXPIRED, ISLOCK, CREATETIME, STATUS,
30 | EMAIL, MOBILE, PHONE, SEX, PICTURE
31 |
32 |
42 |
43 |
47 | delete from sys_user
48 | where USERID = #{userid,jdbcType=BIGINT}
49 |
50 |
51 |
55 | insert into sys_user (USERID, FULLNAME, NICKNAME,
56 | ACCOUNT, PASSWORD, ISEXPIRED,
57 | ISLOCK, CREATETIME, STATUS,
58 | EMAIL, MOBILE, PHONE,
59 | SEX, PICTURE)
60 | values (#{userid,jdbcType=BIGINT}, #{fullname,jdbcType=VARCHAR}, #{nickname,jdbcType=VARCHAR},
61 | #{account,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, #{isexpired,jdbcType=SMALLINT},
62 | #{islock,jdbcType=SMALLINT}, #{createtime,jdbcType=TIMESTAMP}, #{status,jdbcType=SMALLINT},
63 | #{email,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
64 | #{sex,jdbcType=VARCHAR}, #{picture,jdbcType=VARCHAR})
65 |
66 |
67 |
71 | insert into sys_user
72 |
73 |
74 | USERID,
75 |
76 |
77 | FULLNAME,
78 |
79 |
80 | NICKNAME,
81 |
82 |
83 | ACCOUNT,
84 |
85 |
86 | PASSWORD,
87 |
88 |
89 | ISEXPIRED,
90 |
91 |
92 | ISLOCK,
93 |
94 |
95 | CREATETIME,
96 |
97 |
98 | STATUS,
99 |
100 |
101 | EMAIL,
102 |
103 |
104 | MOBILE,
105 |
106 |
107 | PHONE,
108 |
109 |
110 | SEX,
111 |
112 |
113 | PICTURE,
114 |
115 |
116 |
117 |
118 |
119 | #{userid,jdbcType=BIGINT},
120 |
121 |
122 | #{fullname,jdbcType=VARCHAR},
123 |
124 |
125 | #{nickname,jdbcType=VARCHAR},
126 |
127 |
128 | #{account,jdbcType=VARCHAR},
129 |
130 |
131 | #{password,jdbcType=VARCHAR},
132 |
133 |
134 | #{isexpired,jdbcType=SMALLINT},
135 |
136 |
137 | #{islock,jdbcType=SMALLINT},
138 |
139 |
140 | #{createtime,jdbcType=TIMESTAMP},
141 |
142 |
143 | #{status,jdbcType=SMALLINT},
144 |
145 |
146 | #{email,jdbcType=VARCHAR},
147 |
148 |
149 | #{mobile,jdbcType=VARCHAR},
150 |
151 |
152 | #{phone,jdbcType=VARCHAR},
153 |
154 |
155 | #{sex,jdbcType=VARCHAR},
156 |
157 |
158 | #{picture,jdbcType=VARCHAR},
159 |
160 |
161 |
162 |
163 |
167 | update sys_user
168 |
169 |
170 | FULLNAME = #{fullname,jdbcType=VARCHAR},
171 |
172 |
173 | NICKNAME = #{nickname,jdbcType=VARCHAR},
174 |
175 |
176 | ACCOUNT = #{account,jdbcType=VARCHAR},
177 |
178 |
179 | PASSWORD = #{password,jdbcType=VARCHAR},
180 |
181 |
182 | ISEXPIRED = #{isexpired,jdbcType=SMALLINT},
183 |
184 |
185 | ISLOCK = #{islock,jdbcType=SMALLINT},
186 |
187 |
188 | CREATETIME = #{createtime,jdbcType=TIMESTAMP},
189 |
190 |
191 | STATUS = #{status,jdbcType=SMALLINT},
192 |
193 |
194 | EMAIL = #{email,jdbcType=VARCHAR},
195 |
196 |
197 | MOBILE = #{mobile,jdbcType=VARCHAR},
198 |
199 |
200 | PHONE = #{phone,jdbcType=VARCHAR},
201 |
202 |
203 | SEX = #{sex,jdbcType=VARCHAR},
204 |
205 |
206 | PICTURE = #{picture,jdbcType=VARCHAR},
207 |
208 |
209 |
210 | where USERID = #{userid,jdbcType=BIGINT}
211 |
212 |
213 |
217 | update sys_user
218 | set FULLNAME = #{fullname,jdbcType=VARCHAR},
219 | NICKNAME = #{nickname,jdbcType=VARCHAR},
220 | ACCOUNT = #{account,jdbcType=VARCHAR},
221 | PASSWORD = #{password,jdbcType=VARCHAR},
222 | ISEXPIRED = #{isexpired,jdbcType=SMALLINT},
223 | ISLOCK = #{islock,jdbcType=SMALLINT},
224 | CREATETIME = #{createtime,jdbcType=TIMESTAMP},
225 | STATUS = #{status,jdbcType=SMALLINT},
226 | EMAIL = #{email,jdbcType=VARCHAR},
227 | MOBILE = #{mobile,jdbcType=VARCHAR},
228 | PHONE = #{phone,jdbcType=VARCHAR},
229 | SEX = #{sex,jdbcType=VARCHAR},
230 | PICTURE = #{picture,jdbcType=VARCHAR}
231 | where USERID = #{userid,jdbcType=BIGINT}
232 |
233 |
234 |
244 |
245 |
246 |
--------------------------------------------------------------------------------