Pre Merge pull request !57 from Ordinary/master

pull/57/MERGE
Ordinary 2024-07-11 15:29:39 +00:00 committed by Gitee
commit d4b3ee299a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 14 additions and 7 deletions

3
.env
View File

@ -19,3 +19,6 @@ SHOPRO_STATIC_URL = https://file.sheepjs.com
# 是否开启直播 1 开启直播 | 0 关闭直播 (小程序官方后台未审核开通直播权限时请勿开启) # 是否开启直播 1 开启直播 | 0 关闭直播 (小程序官方后台未审核开通直播权限时请勿开启)
SHOPRO_MPLIVE_ON = 0 SHOPRO_MPLIVE_ON = 0
# 多租户配置
SHOPRO_TENANT_ID = 1

View File

@ -1,4 +1,6 @@
import { baseUrl, apiPath } from '@/sheep/config'; import { apiPath, baseUrl } from '@/sheep/config';
const tenantId = import.meta.env.TENANT_ID;
const FileApi = { const FileApi = {
// 上传文件 // 上传文件
@ -15,8 +17,8 @@ const FileApi = {
name: 'file', name: 'file',
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) => {

View File

@ -11,9 +11,11 @@ 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 default { export default {
baseUrl, baseUrl,
apiPath, apiPath,
staticUrl, staticUrl,
tenantId
}; };

View File

@ -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 {
@ -97,8 +97,8 @@ http.interceptors.request.use(
} }
// 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'] = '10';
// config.header['Authorization'] = 'Bearer test247'; // config.header['Authorization'] = 'Bearer test247';
return config; return config;
}, },
@ -299,4 +299,4 @@ const request = (config) => {
return http.middleware(config); return http.middleware(config);
}; };
export default request; export default request;