Commit 2cfb8c6a authored by 前端-许佳敏's avatar 前端-许佳敏

fix: 修改网关

parent 3e8c4bda
......@@ -168,9 +168,9 @@ module.exports = {
// 阿里云demo站更新
"v2-ali-demo": {
SITE_ID: '1',
BACK_GATEWAY: 'http://lingxi-scm-gateway.shushangyun.com:13880',
BACK_GATEWAY: 'http://lingxi-scm-gateway.shushangyun.com',
USE_ROUTE_CONFIG: true,
SOCKET_URL: 'ws://lingxi-scm-gateway.shushangyun.com:13880',
SOCKET_URL: 'ws://lingxi-scm-gateway.shushangyun.com',
YAPI_URL: 'http://10.0.0.25:4000/'
}
}
......@@ -77,6 +77,7 @@ async function batchAxiosHttps() {
asyncHttpQueue[item][subItem] = null
}
} catch (err) {
console.log(err)
httpErrorQueue.push({ ...serviceConfig[item][subItem], ...err.response.data })
}
}
......
......@@ -32,7 +32,7 @@ export interface SiteInfo {
name: string;
logo: string;
siteUrl: string;
symbol?: any;
symbol: string;
}
export interface Global {
......
import { extend, ResponseError, OnionOptions, RequestOptionsInit, ResponseInterceptor, OnionMiddleware, Context, RequestMethod } from 'umi-request';
import responseCode from '@/constants/responseCode'
import { IRequestError, IRequestSuccess } from '..';
import { history } from 'umi'
import { getLocale, history } from 'umi'
import { message } from 'antd'
import { getAuth, removeAuth, removeRouters } from './auth';
import { isDev } from '@/constants';
......@@ -44,6 +44,12 @@ const defaultHeaders = {
'source': '99'
}
const requestLanguageMaps = {
'zh-CN': 'zh',
'en-US': 'en',
'ko-KR': 'ko',
}
/**
* 配置request请求时的默认参数, 底层使用fetch进行请求
*/
......@@ -59,6 +65,7 @@ baseRequest.interceptors.request.use((url: string, options: RequestOptionsInit):
// 判断是否有权限
const { userId, memberId, token } = getAuth() || {}
const headers = {
'Accept-Language': requestLanguageMaps[getLocale() as any],
...options.headers,
userId,
memberId,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment