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 | 67 | NameValuePair[] param = { new NameValuePair("relation_id", "283645"), new NameValuePair("video_type", "3"), |
| 68 | 68 | new NameValuePair("user_access_key", user_access_key), |
| 69 | 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 | 71 | System.out.println(c); |
| 72 | 72 | } |
| 73 | 73 | |
| ... | ... | @@ -84,12 +84,12 @@ public class HttpPostArgumentTest2 { |
| 84 | 84 | |
| 85 | 85 | public static void supload() { |
| 86 | 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 | 88 | new NameValuePair("upload_type", "0"), new NameValuePair("direct", "1"), new NameValuePair("md5", md5), |
| 89 | 89 | new NameValuePair("title", "tit三道恩le1"), new NameValuePair("relation_id", "615207"), |
| 90 | 90 | new NameValuePair("custom_args", "custom_args1"), new NameValuePair("name", "VID_20151224_105421.mp4"), |
| 91 | 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 | 93 | System.out.println(c); |
| 94 | 94 | } |
| 95 | 95 | |
| ... | ... | @@ -117,7 +117,7 @@ public class HttpPostArgumentTest2 { |
| 117 | 117 | public static void main(String[] args) { |
| 118 | 118 | // new HttpPostArgumentTest2().delete(); |
| 119 | 119 | //HttpPostArgumentTest2.all(); |
| 120 | - HttpPostArgumentTest2.redirect(); | |
| 120 | + HttpPostArgumentTest2.supload(); | |
| 121 | 121 | // HttpReq.postRequestWidthResult("http://120.132.76.51:9696/cnlive_encoding_job/task", |
| 122 | 122 | // "json", "jsonjsonjsonjson");r |
| 123 | 123 | } | ... | ... |
src/main/java/com/cnlive/mz/live/action/VideoAction.java
| ... | ... | @@ -73,9 +73,10 @@ public class VideoAction { |
| 73 | 73 | title = title.substring(0, 50); |
| 74 | 74 | } |
| 75 | 75 | String description = params.getString("description"); |
| 76 | - FilteredResult resTitle = WordFilterUtil.filterHtml(title, '*'); | |
| 76 | + WordFilterUtil wf =new WordFilterUtil(); | |
| 77 | + FilteredResult resTitle =wf.filterHtml(title, '*'); | |
| 77 | 78 | title=resTitle.getFilteredContent().toString(); |
| 78 | - FilteredResult resDescr= WordFilterUtil.filterHtml(description, '*'); | |
| 79 | + FilteredResult resDescr= wf.filterHtml(description, '*'); | |
| 79 | 80 | description=resDescr.getFilteredContent().toString(); |
| 80 | 81 | |
| 81 | 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 | 52 | String requestUrl = request.getRequestURI(); |
| 53 | 53 | HttpSession session = request.getSession(); |
| 54 | 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 | 57 | boolean authEnable = ConfigHelper.getBoolean("auth.enable"); |
| 57 | 58 | String loginUrl = ConfigHelper.getString("auth.login.url"); |
| 58 | 59 | if (authEnable) { |
| 59 | 60 | //去登录认证 |
| 60 | - response.sendRedirect(loginUrl + webUrl+"/login/success"); | |
| 61 | + String url=loginUrl + webUrl+"/login/success"; | |
| 62 | + response.sendRedirect(url); | |
| 61 | 63 | return; |
| 62 | 64 | } else { |
| 63 | 65 | String userName = "liujicheng"; | ... | ... |
src/main/resources/log4j.properties
| 1 | 1 | log4j.rootLogger=INFO,console,file,action,content,video,httpreq |
| 2 | - | |
| 3 | 2 | #Console |
| 4 | -log4j.appender.Threshold=INFO | |
| 5 | 3 | log4j.appender.console.Target=System.out |
| 6 | 4 | log4j.appender.console=org.apache.log4j.ConsoleAppender |
| 7 | 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 | 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 | 11 | log4j.appender.file.DatePattern='_'yyyyMMdd |
| 14 | 12 | log4j.appender.file.encoding=UTF-8 |
| 15 | 13 | log4j.appender.file.layout=org.apache.log4j.PatternLayout |
| ... | ... | @@ -20,6 +18,7 @@ log4j.logger.org.smart4j=DEBUG |
| 20 | 18 | |
| 21 | 19 | |
| 22 | 20 | #action |
| 21 | + | |
| 23 | 22 | log4j.appender.action=org.apache.log4j.DailyRollingFileAppender |
| 24 | 23 | log4j.appender.action.File=${catalina.home}/logs/action.log |
| 25 | 24 | log4j.appender.action.layout=org.apache.log4j.PatternLayout | ... | ... |
src/main/webapp/static/assets/cnlive/js/global.js
| 1 | 1 | var BASE; // Context Path(在 script.jsp 中初始化) |
| 2 | 2 | function next_page(pageNum){ |
| 3 | 3 | window.location.href = "" + pageNum+window.location.search; |
| 4 | - alert(window.location.search); | |
| 5 | 4 | } |
| 6 | 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 | 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 | 3 | version=0.0.1-SNAPSHOT |
| 4 | 4 | groupId=com.cnlive.mz.live.web |
| 5 | 5 | m2e.projectName=cnlive_live_web |
| 6 | 6 | m2e.projectLocation=D\:\\1_CNLIVE_JAVA_CODE\\cnlive_live_web |
| 7 | 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 | ... | ... |