diff --git a/manager/src/App.vue b/manager/src/App.vue index 7086249c..8181bd5c 100644 --- a/manager/src/App.vue +++ b/manager/src/App.vue @@ -5,7 +5,6 @@ diff --git a/manager/src/libs/axios.js b/manager/src/libs/axios.js index 9a97047d..d1f5da3c 100644 --- a/manager/src/libs/axios.js +++ b/manager/src/libs/axios.js @@ -4,6 +4,7 @@ import { router } from "../router/index"; import { Message } from "view-design"; import Cookies from "js-cookie"; import { handleRefreshToken } from "../api/index"; +import {v4 as uuidv4} from 'uuid'; // 统一请求路径前缀 export const commonUrl = @@ -29,7 +30,11 @@ service.interceptors.request.use( ...config.params }; } - const uuid = getStore("uuid"); + let uuid = getStore("uuid"); + if (!uuid) { + uuid = uuidv4(); + setStore('uuid', uuid); + } config.headers["uuid"] = uuid; return config; },