How to use the iview.LoadingBar.start function in iview

To help you get started, we’ve selected a few iview examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lscho / ThinkJS-Vue.js-blog / client / src / axios / index.js View on Github external
axios.interceptors.request.use(config => {
	// 进度条开始
	LoadingBar.start();
	//token
	if (localStorage.getItem('token')) {
		config.headers.Authorization = localStorage.getItem('token')
	}
	return config;
}, error => {
	LoadingBar.error();
github lscho / ThinkJS-Vue.js-blog / admin / src / axios / index.js View on Github external
axios.interceptors.request.use(config => {
  // 进度条开始
  LoadingBar.start()
  // token
  if (localStorage.getItem('token')) {
    config.headers.Authorization = localStorage.getItem('token')
  }
  // 防止缓存
  if (config.method === 'post' && config.headers['Content-Type'] !== 'multipart/form-data') {
    config.data = {
      ...config.data,
      _t: Date.parse(new Date()) / 1000
    }
  } else if (config.method === 'get') {
    config.params = {
      _t: Date.parse(new Date()) / 1000,
      ...config.params
    }
  }
github Abiel1024 / vue-project / src / router / index.js View on Github external
myRouter.beforeEach((to, from, next) => {
  window.aaaa = LoadingBar
  LoadingBar.start()
  next()
})
myRouter.afterEach((to, from) => {
github largezhou / admin / resources / src / router / permission.js View on Github external
router.beforeEach(async (to, from, next) => {
  LoadingBar.start()
  if (getToken()) {
    if (to.name === 'login') {
      next('/')
    } else {
      if (store.getters.loggedIn) {
        next()
      } else {
        try {
          await store.dispatch('getUser')
        } catch (e) {
          LoadingBar.error()
          return next(false)
        }
        next()
      }
    }