What is the nuxtServerInit method for? Where should I add it?

nuxtServerInit ({ commit }, { req }) {
  if (req.session && req.session.authUser) {
    commit("SET_USER", req.session.authUser)
  }
}

where should this method be added to store/index.js?

Jul.08,2021

used for to operate store on the server is essentially an Action, written in actions . Its payload is the context object of Nuxt App.

Resources:

  1. ide/vuex-store-sharpthe-nuxtserverinit-action" rel=" nofollow noreferrer "> The nuxtServerInit Action
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-1b3bdf5-2bb1f.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-1b3bdf5-2bb1f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?