testaxios2.vue 921 Bytes
<template>
    <div>
       <blockquote> 22222222222222222222222222</blockquote>
    </div>
</template>
<script>
export default {
    name: 'content',
    data() {
        return {
            data: {
                username: '',
                password: '',
                // token: ''
            },
        }
    },
    methods: {
        login() {
            var self = this;
            console.log(self.data.username);
            this.axios.get("public/act/getAll").then((res) => {
                console.log(JSON.stringify(error));
                console.log("页面里面:" + res);
            })
        },
        loginError(){
            this.axios.get("test/axioserror").then((res) => {
                console.log("页面里面:" + res);
            }).catch((error)=>{
                console.log(error);
            })
        }
    },
    created() {

    },
    mounted() {

    }
}
</script>