提交修改

This commit is contained in:
quyixiao 2021-01-26 19:31:03 +08:00
parent eae74ff36c
commit 0b84d70dd0

View File

@ -61,11 +61,16 @@ public class ThirdTaskController {
log.info("commandDto:" + a);
a = a.replaceAll("\\\\u0000", ""); //替换掉前面的空格
log.info("替换空格之后的命令:" + a);
commandDto = JSONObject.parseObject(a,CommandDto.class);
commandDto = JSONObject.parseObject(a, CommandDto.class);
String[] tokens = TaskCommand.parse(commandDto.getCommand());
log.info("parse data :" + Arrays.toString(tokens));
Object object = SpringContextUtils.getBean(tokens[0]);
if (object == null) {
Object object = null;
try {
object = SpringContextUtils.getBean(tokens[0]);
if (object == null) {
return R.error("命令不存在。");
}
} catch (Exception e) {
return R.error("命令不存在。");
}
ICommand iCommand = (ICommand) object;