遇到了一些问题,请求成功后对应的code显示是未定义


getCountAboutLogink({
        year:2021
      }).then(res => {
        // 获取数据成功后的其他操作
         console.log(res.code);
        
        if (res.code == 200) {
        console.log(res.column1)
        this.details.会员数量 =res.column1;
        }
      });

console一下res,
控制台network看一下后端返回得格式

应该加个data,你打印一下res

 
getCountAboutLogink({
        year:2021
      }).then(res => {
        // 获取数据成功后的其他操作
         console.log(res);
        
        if (res.data.code == 200) {
        console.log(res.data.column1)
        this.details.会员数量 =res.data.column1;
        }
      });

打印 一下 res