A JSONArray text must start with at 1

 A JSONArray text must start with at 1 [character 2 line 1]

A JSONArray text must start with at 1_第1张图片

起因:String数组转 JSON 后端调用出错

JSONUtil.toList(xx.getTags(), String.class) 

A JSONArray text must start with at 1_第2张图片

 数据库对象entity转包装类 方法 ,其中数据库字段tags是String类型,在包装类中想转换为 JSON

public static PostVO objToVo(Post post) {
        if (post == null) {
            return null;
        }
        PostVO postVO = new PostVO();
        BeanUtils.copyProperties(post, postVO);
        postVO.setTagList(JSONUtil.toList(post.getTags(), String.class));
        return postVO;
    }

原因:数据库存入的字段不对,不应该是 xx ,而是应该是 [XX,XX]

你可能感兴趣的:(BUG,数据库)