Vue axios encapsulation problem

1 / axios.js file

export function post(url,data){
    return new Promise((resolve,reject) => {    
        axios.post(url,data)
        .then(response => {
            resolve(response.data);
        },err => {
            reject(err)
        }).catch(err => {
            reject(err.data)
        })
    })
}

2 / login.vue file

methods: {
            submitForm(formName){
                this.$refs[formName].validate((valid) => {
                    if(valid) {
                        this.post("",{
                            username: this.loginForm.username,
                            password: this.loginForm.password 
                        })
                        .then( res=>{
                            console.log(res)
                        })
                    }else{
                        console.log("Error Submit!!")
                    }
                })
            }
        },
< hr >

Why the login result is

clipboard.png


:.

clipboard.png

< hr >

what is the problem? How should we solve this problem?

Mar.03,2022

the default parameter passed by axios is assigned under params, while post is the

to be received by data.
this.$axios({
    method: 'post',
    url:url,
    data:params
}).then((res)=>{
    
});

modify request header 'Content-Type': application/json;charset=UTF-8

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b389b5-2c134.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b389b5-2c134.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?