Failed to load resource:9090/searchvideolist?mysearch%E8%B0%B7%E6%AD%8C:1

简介: Failed to load resource:9090/searchvideolist?mysearch%E8%B0%B7%E6%AD%8C:1

今天在做搜索接口的时候,出现这样一个bug

查了接口,不是接口的错误,排除了后端错误

最后通过查询路径发现他的路径请求路径给我打错了,打成了/searchvideolist?mysearch宠物,证明是请求路径写错了

之前的

现在的,加上一个=就好了

  let url = "/searchvideolist?mysearch"+"="+this.id;

正确版本的源码:

<template>
     <div style="margin-right: 4%;display: flex;flex-wrap:wrap;align-content:space-between;">
      <el-col :span="5" v-for="item in videoList" :key="item.id" :offset="1" style="margin-bottom: 25px;">
        <el-card :body-style="{ padding: '0px' }" style="padding-bottom: 17px">
          <router-link :to="'/video?video=' + item.id" style="line-height: 0;color: black;text-decoration:none;">
          <img :src="getImgURL(item.id)" style="margin-bottom: 7px;">
          <!-- <template #footer>{{ item.name }}</template> -->
          <!-- <p>{{ item.name }}</p> -->
          <!-- <template #footer>Footer content</template> -->
          <span style="line-height: 17px;">{{item.name}}</span>
          </router-link>
        </el-card>
      </el-col>
    </div>
</template>
 
<script>
import axios from "axios";
export default {
    name: "searchView",
    data(){
        return{
            id:"",
            videoList:[]
        }
    },
    methods:{
        GetVideoList(){
            let url = "/searchvideolist?mysearch"+"="+this.id;
            console.log(url)
            axios.get(url).then((res) => {
                this.videoList = res.data;
            })
        },
        getImgURL(imgId){
            return "http://localhost:9090/static/img/"+ imgId + ".jpg"
        }
    },
    mounted(){
        this.id = localStorage.getItem("searchid");
        this.GetVideoList();
    }
}
</script>
 
<style>
 
</style>

这样就可以查了

相关文章
|
3月前
Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed with multiple
Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed with multiple
23 1
|
5天前
|
前端开发
Request method ‘POST‘ not supported。 Failed to load resource: net::ERR_FAILED
这篇文章讲述了在前后端分离的项目中,由于前端错误地使用了GET请求方法而不是支持的POST,导致请求被后端拒绝的问题,并提供了相应的解决方法和HTTP方法的CRUD映射知识。
Request method ‘POST‘ not supported。 Failed to load resource: net::ERR_FAILED
|
3月前
Error:Execution failed for task ':app:javaPreCompileDebug'. > Annotation processors must be explicit
Error:Execution failed for task ':app:javaPreCompileDebug'. > Annotation processors must be explicit
84 0
|
8月前
DevTools failed to load source map: Could not load content for…System error: net::ERR_FILE_NOT_FOUN
DevTools failed to load source map: Could not load content for…System error: net::ERR_FILE_NOT_FOUN
|
前端开发 数据库
Failed to load response dataNo data found for resource with given identifier
Failed to load response dataNo data found for resource with given identifier
1245 0
ui5 resource file 404 error
Created by Jerry Wang, last modified on Nov 07, 2014
ui5 resource file 404 error
ERROR Failed to load driver
ERROR Failed to load driver
170 0