This.$store, the this here is pointing incorrectly.

const doLogin = function (username, password, v, callback) {
};
doLogin(localStorage.username, localStorage.password, this, function (res, msg) {
        if (res) {
          this.$store.commit({
            type: "login",
            username: res.name,
            token: res.token,
          });
      });

this.$store the this here points to incorrect how to bind the outer this to the callback function

May.28,2021

use the arrow function

const doLogin = function (username, password, v, callback) {
};
doLogin(localStorage.username, localStorage.password, this, (res, msg) => {
        if (res) {
          this.$store.commit({
            type: 'login',
            username: res.name,
            token: res.token,
          });
        }
});
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-1eaca32-20ed.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-1eaca32-20ed.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?