In h5 development, when you encounter oppo mobile phones, you always empty the data in session storage. Is there any way to solve this problem?

In

h5 development, when you encounter an oppo phone, you always empty the data in the session storage. Is there any way to solve the problem

?
Mar.06,2021

in fact, localStorage sessionStorage cannot be used in trace-free mode. My previous solution to the trackless mode is to set / get locally stored data first, if you don't find cookie. If the data is too large, you can consider hanging in window!

LS () {
  return {
    setItem (key, val) {
      try {
        localStorage.setItem(key, val)
      } catch (e) {
        cookie.set(key, val)
      }
    },
    getItem (key) {
      return localStorage.getItem(key) || cookie.get(key)
    },
    removeItem (key) {
      localStorage.removeItem(key)
      cookie.remove(key)
    }
  }
}

renren-fast-vue build development based on vue and element-ui, realize the front-end function of renren-fast background management, and provide a better front-end solution.


I also met, did the landlord solve the problem

Menu