parent
ebc44e37b6
commit
10ed9418ef
|
|
@ -12,6 +12,7 @@ node_modules
|
|||
dist
|
||||
src/types/auto-imports.d.ts
|
||||
src/types/components.d.ts
|
||||
src/types/temp.d.ts
|
||||
dist-ssr
|
||||
coverage
|
||||
*.local
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
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);
|
||||
|
|
@ -15,7 +16,7 @@ service.interceptors.request.use(
|
|||
// 如果是本地则使用静态tonken如果是线上则使用cookie的token
|
||||
const cookie = get_cookie('admin_info');
|
||||
if (import.meta.env.VITE_APP_BASE_API == '/dev-api') {
|
||||
config.url = config.url + '?token=' + 'e1bd7d4c5e94c2680c359a982896e524';
|
||||
config.url = config.url + '?token=' + temp_token;
|
||||
} else {
|
||||
if (cookie) {
|
||||
config.url = config.url + '&token=' + JSON.parse(cookie).token;
|
||||
|
|
|
|||
Loading…
Reference in New Issue