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 9
9
import java .io .UnsupportedEncodingException ;
10
10
import java .security .MessageDigest ;
11
11
import java .security .NoSuchAlgorithmException ;
12
+ import java .util .Arrays ;
12
13
import java .util .Collection ;
13
14
import java .util .Date ;
14
15
import java .util .List ;
@@ -493,18 +494,22 @@ public Object stopApi(@Param("json") String jsonTask) {
493
494
*
494
495
* @param jsonTask
495
496
* @return
497
+ * @throws UnsupportedEncodingException
496
498
*/
497
499
@ At ("/api_diff" )
498
500
@ Ok ("json" )
499
- public Object diff (String name , String code ) {
501
+ public Object diff (String name , String code ) throws UnsupportedEncodingException {
500
502
501
503
Task task = TaskService .findTaskByCache (name );
502
504
503
505
if (task == null ) {
504
506
return Restful .instance (false , "notFound" );
505
507
}
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 ())) {
508
513
return Restful .instance (true , "same" );
509
514
}
510
515
You can’t perform that action at this time.
0 commit comments