wuxw
2023-10-27 a3f3bdb9d56cb9b4d1527b0306758df3fc2cb8b6
java110-bean/src/main/java/com/java110/vo/ResultVo.java
@@ -2,6 +2,8 @@
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import org.slf4j.Logger;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@@ -17,6 +19,8 @@
 * add by wuxw 2020/5/28
 **/
public class ResultVo implements Serializable {
    public static final int CODE_ERROR = 404;// 未知异常
@@ -212,6 +216,9 @@
        return JSONObject.toJSONString(this, SerializerFeature.DisableCircularReferenceDetect, SerializerFeature.WriteDateUseDateFormat);
    }
    public static ResultVo ok(){
        return new ResultVo(ResultVo.CODE_OK,ResultVo.MSG_OK);
    }
    /**
     * 创建ResponseEntity对象
@@ -316,6 +323,7 @@
     * @return
     */
    public static ResponseEntity<String> redirectPage(String url) {
        HttpHeaders headers = new HttpHeaders();
        headers.add(HttpHeaders.LOCATION, url);
        ResponseEntity<String> responseEntity = new ResponseEntity<String>("", headers, HttpStatus.FOUND);