Commit 73dc7b244ba8a198339988d391152f60c2727fed
1 parent
88ce3564
添加用户管理
Showing
7 changed files
with
15 additions
and
21 deletions
src/main/java/com/cnlive/mz/live/action/HttpPostArgumentTest2.java
| @@ -67,7 +67,7 @@ public class HttpPostArgumentTest2 { | @@ -67,7 +67,7 @@ public class HttpPostArgumentTest2 { | ||
| 67 | NameValuePair[] param = { new NameValuePair("relation_id", "283645"), new NameValuePair("video_type", "3"), | 67 | NameValuePair[] param = { new NameValuePair("relation_id", "283645"), new NameValuePair("video_type", "3"), |
| 68 | new NameValuePair("user_access_key", user_access_key), | 68 | new NameValuePair("user_access_key", user_access_key), |
| 69 | new NameValuePair("app_access_key", app_access_key) }; | 69 | new NameValuePair("app_access_key", app_access_key) }; |
| 70 | - String c = HttpReq.postRequestWidthResult("http://localhost:8080/cnlive_live_web/api/video/redirect", param); | 70 | + String c = HttpReq.postRequestWidthResult("http://bc.cnlive.com/api/video/redirect", param); |
| 71 | System.out.println(c); | 71 | System.out.println(c); |
| 72 | } | 72 | } |
| 73 | 73 | ||
| @@ -84,12 +84,12 @@ public class HttpPostArgumentTest2 { | @@ -84,12 +84,12 @@ public class HttpPostArgumentTest2 { | ||
| 84 | 84 | ||
| 85 | public static void supload() { | 85 | public static void supload() { |
| 86 | NameValuePair[] param = { new NameValuePair("app_access_key", app_access_key), | 86 | NameValuePair[] param = { new NameValuePair("app_access_key", app_access_key), |
| 87 | - new NameValuePair("user_access_key", user_access_key), new NameValuePair("video_type", "2"), | 87 | + new NameValuePair("user_access_key", user_access_key), new NameValuePair("video_type", "3"), |
| 88 | new NameValuePair("upload_type", "0"), new NameValuePair("direct", "1"), new NameValuePair("md5", md5), | 88 | new NameValuePair("upload_type", "0"), new NameValuePair("direct", "1"), new NameValuePair("md5", md5), |
| 89 | new NameValuePair("title", "tit三道恩le1"), new NameValuePair("relation_id", "615207"), | 89 | new NameValuePair("title", "tit三道恩le1"), new NameValuePair("relation_id", "615207"), |
| 90 | new NameValuePair("custom_args", "custom_args1"), new NameValuePair("name", "VID_20151224_105421.mp4"), | 90 | new NameValuePair("custom_args", "custom_args1"), new NameValuePair("name", "VID_20151224_105421.mp4"), |
| 91 | new NameValuePair("server_access_key", "3830ce241dad4b9f844d131c890231ae") }; | 91 | new NameValuePair("server_access_key", "3830ce241dad4b9f844d131c890231ae") }; |
| 92 | - String c = HttpReq.postRequestWidthResult("http://bc.cnlive.com/api/video/supload", param); | 92 | + String c = HttpReq.postRequestWidthResult("http://localhost:8080/cnlive_live_web/api/video/supload", param); |
| 93 | System.out.println(c); | 93 | System.out.println(c); |
| 94 | } | 94 | } |
| 95 | 95 | ||
| @@ -117,7 +117,7 @@ public class HttpPostArgumentTest2 { | @@ -117,7 +117,7 @@ public class HttpPostArgumentTest2 { | ||
| 117 | public static void main(String[] args) { | 117 | public static void main(String[] args) { |
| 118 | // new HttpPostArgumentTest2().delete(); | 118 | // new HttpPostArgumentTest2().delete(); |
| 119 | //HttpPostArgumentTest2.all(); | 119 | //HttpPostArgumentTest2.all(); |
| 120 | - HttpPostArgumentTest2.redirect(); | 120 | + HttpPostArgumentTest2.supload(); |
| 121 | // HttpReq.postRequestWidthResult("http://120.132.76.51:9696/cnlive_encoding_job/task", | 121 | // HttpReq.postRequestWidthResult("http://120.132.76.51:9696/cnlive_encoding_job/task", |
| 122 | // "json", "jsonjsonjsonjson");r | 122 | // "json", "jsonjsonjsonjson");r |
| 123 | } | 123 | } |
src/main/java/com/cnlive/mz/live/action/VideoAction.java
| @@ -73,9 +73,10 @@ public class VideoAction { | @@ -73,9 +73,10 @@ public class VideoAction { | ||
| 73 | title = title.substring(0, 50); | 73 | title = title.substring(0, 50); |
| 74 | } | 74 | } |
| 75 | String description = params.getString("description"); | 75 | String description = params.getString("description"); |
| 76 | - FilteredResult resTitle = WordFilterUtil.filterHtml(title, '*'); | 76 | + WordFilterUtil wf =new WordFilterUtil(); |
| 77 | + FilteredResult resTitle =wf.filterHtml(title, '*'); | ||
| 77 | title=resTitle.getFilteredContent().toString(); | 78 | title=resTitle.getFilteredContent().toString(); |
| 78 | - FilteredResult resDescr= WordFilterUtil.filterHtml(description, '*'); | 79 | + FilteredResult resDescr= wf.filterHtml(description, '*'); |
| 79 | description=resDescr.getFilteredContent().toString(); | 80 | description=resDescr.getFilteredContent().toString(); |
| 80 | 81 | ||
| 81 | String direct = params.getString("direct"); | 82 | String direct = params.getString("direct"); |
src/main/java/com/cnlive/mz/live/aspect/AuthFilter.java
| @@ -52,12 +52,14 @@ public class AuthFilter implements Filter { | @@ -52,12 +52,14 @@ public class AuthFilter implements Filter { | ||
| 52 | String requestUrl = request.getRequestURI(); | 52 | String requestUrl = request.getRequestURI(); |
| 53 | HttpSession session = request.getSession(); | 53 | HttpSession session = request.getSession(); |
| 54 | String webUrl = ConfigHelper.getString("website.url"); | 54 | String webUrl = ConfigHelper.getString("website.url"); |
| 55 | - if (session.getAttribute(LiveUtils.SESSION_KEY_NAME) == null) { | 55 | + String a=(String) session.getAttribute(LiveUtils.SESSION_KEY_NAME) ; |
| 56 | + if (a== null) { | ||
| 56 | boolean authEnable = ConfigHelper.getBoolean("auth.enable"); | 57 | boolean authEnable = ConfigHelper.getBoolean("auth.enable"); |
| 57 | String loginUrl = ConfigHelper.getString("auth.login.url"); | 58 | String loginUrl = ConfigHelper.getString("auth.login.url"); |
| 58 | if (authEnable) { | 59 | if (authEnable) { |
| 59 | //去登录认证 | 60 | //去登录认证 |
| 60 | - response.sendRedirect(loginUrl + webUrl+"/login/success"); | 61 | + String url=loginUrl + webUrl+"/login/success"; |
| 62 | + response.sendRedirect(url); | ||
| 61 | return; | 63 | return; |
| 62 | } else { | 64 | } else { |
| 63 | String userName = "liujicheng"; | 65 | String userName = "liujicheng"; |
src/main/resources/log4j.properties
| 1 | log4j.rootLogger=INFO,console,file,action,content,video,httpreq | 1 | log4j.rootLogger=INFO,console,file,action,content,video,httpreq |
| 2 | - | ||
| 3 | #Console | 2 | #Console |
| 4 | -log4j.appender.Threshold=INFO | ||
| 5 | log4j.appender.console.Target=System.out | 3 | log4j.appender.console.Target=System.out |
| 6 | log4j.appender.console=org.apache.log4j.ConsoleAppender | 4 | log4j.appender.console=org.apache.log4j.ConsoleAppender |
| 7 | log4j.appender.console.layout=org.apache.log4j.PatternLayout | 5 | log4j.appender.console.layout=org.apache.log4j.PatternLayout |
| 8 | -log4j.appender.console.layout.ConversionPattern=%d %-5p [%c] (%t:%x) %m%n | 6 | +log4j.appender.console.layout.ConversionPattern=%m%n |
| 9 | 7 | ||
| 10 | 8 | ||
| 11 | log4j.appender.file=org.apache.log4j.DailyRollingFileAppender | 9 | log4j.appender.file=org.apache.log4j.DailyRollingFileAppender |
| 12 | -log4j.appender.file.File=${catalina.base}/logs/cnlive_live_web/log | 10 | +log4j.appender.file.File=${catalina.home}/logs/cnlive_live_web/log |
| 13 | log4j.appender.file.DatePattern='_'yyyyMMdd | 11 | log4j.appender.file.DatePattern='_'yyyyMMdd |
| 14 | log4j.appender.file.encoding=UTF-8 | 12 | log4j.appender.file.encoding=UTF-8 |
| 15 | log4j.appender.file.layout=org.apache.log4j.PatternLayout | 13 | log4j.appender.file.layout=org.apache.log4j.PatternLayout |
| @@ -20,6 +18,7 @@ log4j.logger.org.smart4j=DEBUG | @@ -20,6 +18,7 @@ log4j.logger.org.smart4j=DEBUG | ||
| 20 | 18 | ||
| 21 | 19 | ||
| 22 | #action | 20 | #action |
| 21 | + | ||
| 23 | log4j.appender.action=org.apache.log4j.DailyRollingFileAppender | 22 | log4j.appender.action=org.apache.log4j.DailyRollingFileAppender |
| 24 | log4j.appender.action.File=${catalina.home}/logs/action.log | 23 | log4j.appender.action.File=${catalina.home}/logs/action.log |
| 25 | log4j.appender.action.layout=org.apache.log4j.PatternLayout | 24 | log4j.appender.action.layout=org.apache.log4j.PatternLayout |
src/main/webapp/static/assets/cnlive/js/global.js
| 1 | var BASE; // Context Path(在 script.jsp 中初始化) | 1 | var BASE; // Context Path(在 script.jsp 中初始化) |
| 2 | function next_page(pageNum){ | 2 | function next_page(pageNum){ |
| 3 | window.location.href = "" + pageNum+window.location.search; | 3 | window.location.href = "" + pageNum+window.location.search; |
| 4 | - alert(window.location.search); | ||
| 5 | } | 4 | } |
| 6 | var Smart = { | 5 | var Smart = { |
| 7 | /* -------------------------------------------------- 函数 -------------------------------------------------- */ | 6 | /* -------------------------------------------------- 函数 -------------------------------------------------- */ |
target/classes/com/cnlive/mz/live/aspect/AuthFilter.class
No preview for this file type
target/m2e-wtp/web-resources/META-INF/maven/com.cnlive.mz.live.web/cnlive_live_web/pom.properties
| 1 | #Generated by Maven Integration for Eclipse | 1 | #Generated by Maven Integration for Eclipse |
| 2 | -#Mon Jun 27 14:02:38 CST 2016 | 2 | +#Fri Jul 08 14:51:31 CST 2016 |
| 3 | version=0.0.1-SNAPSHOT | 3 | version=0.0.1-SNAPSHOT |
| 4 | groupId=com.cnlive.mz.live.web | 4 | groupId=com.cnlive.mz.live.web |
| 5 | m2e.projectName=cnlive_live_web | 5 | m2e.projectName=cnlive_live_web |
| 6 | m2e.projectLocation=D\:\\1_CNLIVE_JAVA_CODE\\cnlive_live_web | 6 | m2e.projectLocation=D\:\\1_CNLIVE_JAVA_CODE\\cnlive_live_web |
| 7 | artifactId=cnlive_live_web | 7 | artifactId=cnlive_live_web |
| 8 | -#Generated by Maven Integration for Eclipse | ||
| 9 | -#Fri Jun 24 09:13:59 CST 2016 | ||
| 10 | -version=0.0.1-SNAPSHOT | ||
| 11 | -groupId=com.cnlive.mz.live.web | ||
| 12 | -m2e.projectName=cnlive_live_web | ||
| 13 | -m2e.projectLocation=C\:\\Users\\Administrator\\git\\cnlive_live_web | ||
| 14 | -artifactId=cnlive_live_web |