You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

无法通过Flickr API获取数据的Vue.js项目问题求助

Vue调用Flickr API请求失败求助

我正在学习Vue.js,尝试搭建一个简易图片画廊Web应用,计划调用Flickr公共照片API获取数据,API地址为 https://api.flickr.com/services/feeds/photos_public.gne?format=json。目前仅尝试在控制台打印响应结果,但请求失败并报错;不过用Postman测试该API能正常得到目标响应,希望得到解决帮助。

以下是我的Vue组件代码:

<template>
  <div class="container">
    <div>
      <h1>TEST</h1>
      <tbody>
        <td v-for="(image, index) in images" :key="index">
          {{ image }}
        </td>
      </tbody>
    </div>
  </div>
</template>

<script>
import axios from "axios";

export default {
  name: "ImageFeed",
  data() {
    return {
      images: [],
    };
  },
  methods: {},
  computed: {},
  mounted() {
    axios
      .get(
        "https://api.flickr.com/services/feeds/photos_public.gne?format=json"
      )
      .then((response) => {
        console.log(response);
      });
  },
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped></style>

控制台报错截图:
控制台报错截图

Postman响应截图:
Postman响应截图

内容的提问来源于stack exchange,提问作者80andabove

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.19 06:00:16