mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-17 16:35:53 +08:00
修复登出账号、修改密码等操作会清除uuidbug
This commit is contained in:
@@ -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;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user