首页 > 解决方案 > vue js get函数不起作用但post正在工作

问题描述

我正在尝试使用来自 vue 组件的 axios 发送获取请求。但是我无法从服务器获得任何响应。当我使用post方法时工作正常。

    created:function(){

        let Uri = process.env.VUE_APP_URL +'/apiF/customer/myOrders';
        this.axios.get(Uri).then((response) => {
            this.order_details = response.data
            
        }).catch(error => {
            this.errors_exist=true;
            if (error.response.status == 422){
            this.errors = error.response.data.errors;
            }
        })

    },

标签: vuejs2

解决方案


推荐阅读