Merge branch 'dev-sws' into dev-yxl

v1.0.0
于肖磊 2024-08-26 16:50:52 +08:00
commit 45a03d6042
3 changed files with 6 additions and 6 deletions

2
.gitignore vendored
View File

@ -12,7 +12,7 @@ node_modules
dist
src/types/auto-imports.d.ts
src/types/components.d.ts
src/types/temp.d.ts
temp.d.ts
dist-ssr
coverage
*.local

View File

@ -1,8 +1,8 @@
<template>
<div :style="style_container">
<div class="video re" :style="style">
<image-empty v-if="!video_img" error-img-style="width:60px;height:60px;"></image-empty>
<video v-else :src="video" :poster="video_img" class="w h"></video>
<image-empty v-if="!video_img" v-model="video_img" error-img-style="width:60px;height:60px;"></image-empty>
<video :src="video" :poster="video_img" class="w h"></video>
<img src="@/assets/images/components/model-video/video.png" class="middle box-shadow-sm round" width="60" height="60" />
</div>
</div>

View File

@ -1,7 +1,6 @@
import axios, { InternalAxiosRequestConfig, AxiosResponse } from 'axios';
import { ElMessage, ElMessageBox } from 'element-plus';
import { get_cookie } from './index';
import temp_token from '@/types/temp.d';
// 创建 axios 实例
const index = window.location.href.lastIndexOf('?s=');
const pro_url = window.location.href.substring(0, index);
@ -12,11 +11,12 @@ const service = axios.create({
});
// 请求拦截器
service.interceptors.request.use(
(config: InternalAxiosRequestConfig) => {
async (config: InternalAxiosRequestConfig) => {
// 如果是本地则使用静态tonken如果是线上则使用cookie的token
const cookie = get_cookie('admin_info');
if (import.meta.env.VITE_APP_BASE_API == '/dev-api') {
config.url = config.url + '?token=' + temp_token;
let temp_token = await import('../../temp.d');
config.url = config.url + '?token=' + temp_token.default;
} else {
if (cookie) {
config.url = config.url + '&token=' + JSON.parse(cookie).token;