File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
src/main/java/org/nlpcn/jcoder/controller Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 99import java .io .UnsupportedEncodingException ;
1010import java .security .MessageDigest ;
1111import java .security .NoSuchAlgorithmException ;
12+ import java .util .Arrays ;
1213import java .util .Collection ;
1314import java .util .Date ;
1415import java .util .List ;
@@ -493,18 +494,22 @@ public Object stopApi(@Param("json") String jsonTask) {
493494 *
494495 * @param jsonTask
495496 * @return
497+ * @throws UnsupportedEncodingException
496498 */
497499 @ At ("/api_diff" )
498500 @ Ok ("json" )
499- public Object diff (String name , String code ) {
501+ public Object diff (String name , String code ) throws UnsupportedEncodingException {
500502
501503 Task task = TaskService .findTaskByCache (name );
502504
503505 if (task == null ) {
504506 return Restful .instance (false , "notFound" );
505507 }
506-
507- if (code .trim ().equals (task .getCode ().trim ())) {
508+
509+ code = code .replace ("\r " , "" ) ;
510+ String tCode = task .getCode ().replaceAll ("\r " , "" ) ;
511+
512+ if (code .trim ().equals (tCode .trim ())) {
508513 return Restful .instance (true , "same" );
509514 }
510515
You can’t perform that action at this time.
0 commit comments