返回值判断
This commit is contained in:
+4
-4
@@ -44,7 +44,7 @@ public class XxlJobOpenApiUtil {
|
||||
int status = response.getStatus();
|
||||
log.info("[XxlJob] addJob status:{}", status);
|
||||
// 新增成功200重定向到列表页
|
||||
return status == 200;
|
||||
return status == 200 || status == 302;
|
||||
} catch (Exception e) {
|
||||
log.error("[XxlJob] addJob异常", e);
|
||||
return false;
|
||||
@@ -131,7 +131,7 @@ public class XxlJobOpenApiUtil {
|
||||
.header("Cookie", cookie)
|
||||
.form("id", jobId)
|
||||
.execute();
|
||||
return response.getStatus() == 200;
|
||||
return response.getStatus() == 200 || response.getStatus() == 302;
|
||||
} catch (Exception e) {
|
||||
log.error("[XxlJob] pauseJob jobId:{}异常", jobId, e);
|
||||
return false;
|
||||
@@ -153,7 +153,7 @@ public class XxlJobOpenApiUtil {
|
||||
.header("Cookie", cookie)
|
||||
.form("id", jobId)
|
||||
.execute();
|
||||
return response.getStatus() == 200;
|
||||
return response.getStatus() == 200 || response.getStatus() == 302;
|
||||
} catch (Exception e) {
|
||||
log.error("[XxlJob] startJob jobId:{}异常", jobId, e);
|
||||
return false;
|
||||
@@ -175,7 +175,7 @@ public class XxlJobOpenApiUtil {
|
||||
.header("Cookie", cookie)
|
||||
.form("id", jobId)
|
||||
.execute();
|
||||
return response.getStatus() == 200;
|
||||
return response.getStatus() == 200 || response.getStatus() == 302;
|
||||
} catch (Exception e) {
|
||||
log.error("[XxlJob] removeJob jobId:{}异常", jobId, e);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user