Blame view

src/utils/header.js 590 Bytes
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
1
2
  import { getUuid } from '@/utils/commonUtil'
  import { getDateYYYYMMDDHHMISS } from '@/utils/dateUtil'
37593bd5   wuxw   优化
3
  import config from '@/conf/config'
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
4
5
6
7
8
9
10
11
12
13
  
  export function getHeader() {
      // 这里可以添加token等认证信息
      const token = localStorage.getItem('token')
      let authorization = ""
      if (token) {
          authorization = `Bearer ${token}`
      }
      return {
          Authorization: authorization, // Adjust as needed
37593bd5   wuxw   优化
14
          'app-id': config.appId,
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
15
16
17
18
19
20
          'TRANSACTION-ID': getUuid(),
          'REQ-TIME': getDateYYYYMMDDHHMISS(),
          'SIGN': '',
          'user-id': '-1'
      }
  }