【update】- 请求头中增加externalTerminalShow参数

This commit is contained in:
fengchenchen
2023-08-23 18:00:34 +08:00
parent 377c32a2fb
commit 9de29dfdb9
8 changed files with 34 additions and 6 deletions
+3
View File
@@ -3,6 +3,7 @@ import axios from 'axios'
import store from '@/store'
import {Modal, notification} from 'ant-design-vue'
import { ACCESS_TOKEN, TENANT_ID } from '@/store/mutation-types'
import {isExternalTerminal} from './util'
/**
* 【指定 axios的 baseURL】
@@ -95,6 +96,8 @@ const err = (error) => {
// request interceptor
service.interceptors.request.use(config => {
// 请求头里面放是否是外网展示的标识
config.headers['externalTerminalShow'] = isExternalTerminal ? 'external' : 'inside'
const token = Vue.ls.get(ACCESS_TOKEN)
if (token) {
config.headers[ 'X-Access-Token' ] = token // 让每个请求携带自定义 token 请根据实际情况自行修改