feat: 增加租户ID自定义配置支持
parent
3d7f63868f
commit
20f937a4ed
3
.env
3
.env
|
@ -22,3 +22,6 @@ SHOPRO_STATIC_URL = https://file.sheepjs.com
|
||||||
|
|
||||||
# 是否开启直播 1 开启直播 | 0 关闭直播 (小程序官方后台未审核开通直播权限时请勿开启)
|
# 是否开启直播 1 开启直播 | 0 关闭直播 (小程序官方后台未审核开通直播权限时请勿开启)
|
||||||
SHOPRO_MPLIVE_ON = 0
|
SHOPRO_MPLIVE_ON = 0
|
||||||
|
|
||||||
|
# 租户ID 默认 1
|
||||||
|
SHOPRO_TENANT_ID = 1
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { baseUrl, apiPath } from '@/sheep/config';
|
import { baseUrl, apiPath, tenantId } from '@/sheep/config';
|
||||||
|
|
||||||
const FileApi = {
|
const FileApi = {
|
||||||
// 上传文件
|
// 上传文件
|
||||||
|
@ -16,7 +16,7 @@ const FileApi = {
|
||||||
header: {
|
header: {
|
||||||
// Accept: 'text/json',
|
// Accept: 'text/json',
|
||||||
Accept: '*/*',
|
Accept: '*/*',
|
||||||
'tenant-id' :'1',
|
'tenant-id': tenantId,
|
||||||
// Authorization: 'Bearer test247',
|
// Authorization: 'Bearer test247',
|
||||||
},
|
},
|
||||||
success: (uploadFileRes) => {
|
success: (uploadFileRes) => {
|
||||||
|
|
|
@ -11,10 +11,13 @@ console.log(`[芋道商城 ${version}] http://doc.iocoder.cn`);
|
||||||
|
|
||||||
export const apiPath = import.meta.env.SHOPRO_API_PATH;
|
export const apiPath = import.meta.env.SHOPRO_API_PATH;
|
||||||
export const staticUrl = import.meta.env.SHOPRO_STATIC_URL;
|
export const staticUrl = import.meta.env.SHOPRO_STATIC_URL;
|
||||||
|
export const tenantId = import.meta.env.SHOPRO_TENANT_ID;
|
||||||
export const websocketPath = import.meta.env.SHOPRO_WEBSOCKET_PATH;
|
export const websocketPath = import.meta.env.SHOPRO_WEBSOCKET_PATH;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
baseUrl,
|
baseUrl,
|
||||||
apiPath,
|
apiPath,
|
||||||
staticUrl,
|
staticUrl,
|
||||||
websocketPath
|
tenantId,
|
||||||
|
websocketPath,
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Request from 'luch-request';
|
import Request from 'luch-request';
|
||||||
import { baseUrl, apiPath } from '@/sheep/config';
|
import { baseUrl, apiPath, tenantId } from '@/sheep/config';
|
||||||
import $store from '@/sheep/store';
|
import $store from '@/sheep/store';
|
||||||
import $platform from '@/sheep/platform';
|
import $platform from '@/sheep/platform';
|
||||||
import {
|
import {
|
||||||
|
@ -96,8 +96,8 @@ http.interceptors.request.use(
|
||||||
config.header['Authorization'] = token;
|
config.header['Authorization'] = token;
|
||||||
}
|
}
|
||||||
// TODO 芋艿:特殊处理
|
// TODO 芋艿:特殊处理
|
||||||
config.header['Accept'] = '*/*'
|
config.header['Accept'] = '*/*';
|
||||||
config.header['tenant-id'] = '1';
|
config.header['tenant-id'] = tenantId;
|
||||||
config.header['terminal'] = '20';
|
config.header['terminal'] = '20';
|
||||||
// config.header['Authorization'] = 'Bearer test247';
|
// config.header['Authorization'] = 'Bearer test247';
|
||||||
return config;
|
return config;
|
||||||
|
|
Loading…
Reference in New Issue