This commit is contained in:
		
							parent
							
								
									8414d1c2ce
								
							
						
					
					
						commit
						e3d019ec7d
					
				| 
						 | 
				
			
			@ -7,6 +7,8 @@ import { tansParams, blobValidate } from '@/utils/bonus'
 | 
			
		|||
import cache from '@/plugins/cache'
 | 
			
		||||
import { saveAs } from 'file-saver'
 | 
			
		||||
import { decryptWithSM4, encryptWithSM4, hashWithSM3AndSalt } from '@/utils/sm'
 | 
			
		||||
import router from '@/router'
 | 
			
		||||
 | 
			
		||||
const systemConfig = JSON.parse(localStorage.getItem('systemConfig')) || {
 | 
			
		||||
  requestConfig: { encryptRequest: false, checkIntegrity: false, encryptResponse: false }
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			@ -110,20 +112,31 @@ service.interceptors.response.use(res => {
 | 
			
		|||
    if (code === 401) {
 | 
			
		||||
      if (!isRelogin.show) {
 | 
			
		||||
        isRelogin.show = true
 | 
			
		||||
        MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
 | 
			
		||||
          confirmButtonText: '重新登录',
 | 
			
		||||
          cancelButtonText: '取消',
 | 
			
		||||
          type: 'warning'
 | 
			
		||||
        }).then(() => {
 | 
			
		||||
          isRelogin.show = false
 | 
			
		||||
        // MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
 | 
			
		||||
        //   confirmButtonText: '重新登录',
 | 
			
		||||
        //   cancelButtonText: '取消',
 | 
			
		||||
        //   type: 'warning'
 | 
			
		||||
        // }).then(() => {
 | 
			
		||||
        //   isRelogin.show = false
 | 
			
		||||
        //   store.dispatch('LogOut').then(() => {
 | 
			
		||||
        //     location.href = process.env.VUE_APP_BASE_API == '/dev-api' ? '/index' : '/iws/glweb/index'
 | 
			
		||||
        //   })
 | 
			
		||||
        // }).catch(() => {
 | 
			
		||||
        //   isRelogin.show = false
 | 
			
		||||
        // })
 | 
			
		||||
        if (process.env.VUE_APP_BASE_API == '/iws/jxhzb-api') {
 | 
			
		||||
          Message({ message: '无效的会话,或者会话已过期,请重新登录。', type: 'error' })
 | 
			
		||||
          setTimeout(() => {
 | 
			
		||||
            // 关闭页面
 | 
			
		||||
            window.close()
 | 
			
		||||
          }, 1500)
 | 
			
		||||
        } else {
 | 
			
		||||
          store.dispatch('LogOut').then(() => {
 | 
			
		||||
            location.href = process.env.VUE_APP_BASE_API == '/dev-api' ? '/index' : '/iws/glweb/index'
 | 
			
		||||
            router.push({ path: '/login' })
 | 
			
		||||
            Message({ message: '无效的会话,或者会话已过期,请重新登录。', type: 'error' })
 | 
			
		||||
          })
 | 
			
		||||
        }).catch(() => {
 | 
			
		||||
          isRelogin.show = false
 | 
			
		||||
        })
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
 | 
			
		||||
    } else if (code === 500) {
 | 
			
		||||
      Message({ message: msg, type: 'error' })
 | 
			
		||||
      return Promise.reject(new Error(msg))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue