How to write the post request in the plug-in of vue?

problem description

I want to emulate cnode"s function of giving likes to comments, using the vue framework, but I made a mistake when I clicked.

the environmental background of the problems and what methods you have tried

I write the post request as a plug-in in server/index.js, call it in comments.vue, and there will be an error. It"s no problem if you write the post request directly in the component.

related codes

/ / Please paste the code text below (do not replace the code with pictures)
comments.vue
methods: {
async up (id) {

  let accesstoken = Cookies.get("accesstoken");
  
  if(accesstoken){
    //
    //
    let {data} = await this.$api.up(id, {accesstoken});

    console.log(data);
    
    //
    axios.post(`https://cnodejs.org/api/v1/reply/${id}/ups`, {accesstoken}).then((res) => {
      console.log(res.data);
    });
  }else{
    //
    alert("");
  }
}

}

server/index.js
let instance = axios.create ({

)
baseURL: "https://cnodejs.org/api/v1"

});

/ / like the comments
export function up (id ="", params = {}) {

let defaults = {
    accesstoken: ""
};

Object.assign(defaults, params);
return instance.post(`/reply/${id}/ups`, { params: defaults });

};

export default {

install(vue) {
    vue.prototype.$api = {
        up
    };
}

};

what result do you expect? What is the error message actually seen?

should have printed a return value like this:
{"success": true, "action": "down"}
, but now it reports an error:
401 Unauthorized

Jul.29,2021

the post request configuration previously written in the api plug-in is miswritten. It should be data instead of params.

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-1eb6aa5-25e9.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-1eb6aa5-25e9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?