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