mofada / pinia-plugin-persist-bug-recurrent

pinia-plugin-persist bug recurrent

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pinia-plugin-persist bug recurrent

  1. On the home page, click the login out button to log out
  2. On the login page, enter your email address and name to enter the home page
  3. Click Refresh (F5) to refresh the interface, user information will be lost (upper right corner)

tip: However, directly enter the login (http://localhost:3000/login), enter the email address and name, click login, and enter the home page. At this time, clicking refresh will not lose user information.

Temporary solution

actions: {
	/**
	 * save user info
	 * @param userInfo
	 */
	setUserInfo(userInfo: IUserInfo) {
		this.$patch(userInfo)
        
		//  fixme save to localStorage
		localStorage.setItem(STORE_KEY, JSON.stringify(userInfo))
	}
},

About

pinia-plugin-persist bug recurrent


Languages

Language:Vue 70.0%Language:TypeScript 24.3%Language:HTML 5.7%