国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

javascript - Regarding development using axios and vue. When the mobile browser returns, it reads the cache and cannot execute js and vue components.
高洛峰
高洛峰 2017-07-05 10:48:12
0
2
1056

A mobile website has tested login restrictions on a page. If you are not logged in, you will go to the login page. However, when you reach the login page and press the return key, you can still return to the first page without reading any data or pictures. How can I do this? When he goes back, he refreshes the web page instead of reading the cached website

高洛峰
高洛峰

擁有18年軟件開發(fā)和IT教學(xué)經(jīng)驗(yàn)。曾任多家上市公司技術(shù)總監(jiān)、架構(gòu)師、項(xiàng)目經(jīng)理、高級(jí)軟件工程師等職務(wù)。 網(wǎng)絡(luò)人氣名人講師,...

reply all(2)
滿天的星座

The window.location.replace() parameter writes the routing address you want to jump to (this page will not generate a cache, and the browser will not have a back option. If you need to generate a back option, replace "replace" with assign);

給我你的懷抱

If you use vue-router in your project, you can use router.beforeEach
Refer to the code below

router.beforeEach((to, from, next) => {
  store.commit('SET_MODULE', to.meta.module)
  if (to.matched.some(record => record.meta.requiresAuth === true)) {
    if (store.getters.token === '') { 
      next({
        path: '/sign',
        query: {redirect: to.fullPath}
      })
    } else {
      next()
    }
  } else if (to.matched.some(record => record.meta.requiresAuth === false)) {
    if (store.getters.token !== '') {
      next(to.query.redirect || '/m')
    } else {
      next()
    }
  } else {
    next()
  }
})

https://github.com/ycloud/cno...

If vue-router is not used, you can put the login judgment in beforeCreate for detection

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template