parent
3fef91a6a7
commit
869d01cd9b
|
|
@ -326,8 +326,8 @@ export const tabs_style = (color: string, style: string | number | boolean | und
|
||||||
*/
|
*/
|
||||||
export const online_url = async () => {
|
export const online_url = async () => {
|
||||||
if (import.meta.env.VITE_APP_BASE_API == '/dev-api') {
|
if (import.meta.env.VITE_APP_BASE_API == '/dev-api') {
|
||||||
let temp_value = await import('../../temp.d');
|
let temp_data = await import(import.meta.env.VITE_APP_BASE_API == '/dev-api' ? '../../temp.d' : '../../temp_pro.d');
|
||||||
return temp_value.default.temp_attachment_host + '/static/app/tabbar/';
|
return temp_data.default.temp_attachment_host + '/static/app/tabbar/';
|
||||||
} else {
|
} else {
|
||||||
return (await get_cookie('temp_attachment_host')) + '/static/app/tabbar/';
|
return (await get_cookie('temp_attachment_host')) + '/static/app/tabbar/';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,13 +9,14 @@ const service = axios.create({
|
||||||
timeout: 50000,
|
timeout: 50000,
|
||||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||||
});
|
});
|
||||||
|
/** @ts-ignore */
|
||||||
// 请求拦截器
|
// 请求拦截器
|
||||||
service.interceptors.request.use(
|
service.interceptors.request.use(
|
||||||
async (config: InternalAxiosRequestConfig) => {
|
async (config: InternalAxiosRequestConfig) => {
|
||||||
// 如果是本地则使用静态tonken如果是线上则使用cookie的token
|
// 如果是本地则使用静态tonken如果是线上则使用cookie的token
|
||||||
const cookie = get_cookie('admin_info');
|
const cookie = get_cookie('admin_info');
|
||||||
if (import.meta.env.VITE_APP_BASE_API == '/dev-api') {
|
if (import.meta.env.VITE_APP_BASE_API == '/dev-api') {
|
||||||
let temp_data = await import('../../temp.d');
|
let temp_data = await import(import.meta.env.VITE_APP_BASE_API == '/dev-api' ? '../../temp.d' : '../../temp_pro.d');
|
||||||
config.url = config.url + '?token=' + temp_data.default.temp_token;
|
config.url = config.url + '?token=' + temp_data.default.temp_token;
|
||||||
} else {
|
} else {
|
||||||
if (cookie) {
|
if (cookie) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue