|
|
|
@ -2,14 +2,19 @@
|
|
|
|
|
* @Author: ch
|
|
|
|
|
* @Date: 2022-05-04 17:11:07
|
|
|
|
|
* @LastEditors: ch
|
|
|
|
|
* @LastEditTime: 2022-06-09 19:22:06
|
|
|
|
|
* @LastEditTime: 2022-06-10 11:01:21
|
|
|
|
|
* @Description: file content
|
|
|
|
|
*/
|
|
|
|
|
import { CreatUuid } from "@/plugins/utils";
|
|
|
|
|
import { UUID_KEY } from "@/constants";
|
|
|
|
|
let axiosTk = null;
|
|
|
|
|
export default function ({$axios, store, route}, inject) {
|
|
|
|
|
export default function ({$axios, store, route, req}, inject) {
|
|
|
|
|
const $axiosTk = $axios.create();
|
|
|
|
|
let uuid = store.state.uuid;
|
|
|
|
|
if (!uuid && req.headers.cookie) {
|
|
|
|
|
uuid = req.headers.cookie.split(';').find(i => i.includes(UUID_KEY));
|
|
|
|
|
uuid = uuid.replace(`${UUID_KEY}=`,'')
|
|
|
|
|
}
|
|
|
|
|
if (!uuid) {
|
|
|
|
|
uuid = CreatUuid(16, 2);
|
|
|
|
|
store.commit('setUUID', uuid);
|
|
|
|
|