mirror of
https://github.com/fantasticit/think.git
synced 2026-09-21 12:49:42 +08:00
fix(client): don't import config in runtime
This commit is contained in:
@@ -10,6 +10,7 @@ const nextConfig = semi({
|
||||
env: {
|
||||
SERVER_API_URL: config.apiUrl,
|
||||
COLLABORATION_API_URL: config.collaborationUrl,
|
||||
ENABLE_ALIYUN_OSS: config?.oss?.aliyun?.accessKeyId,
|
||||
},
|
||||
webpack: (config, { dev, isServer }) => {
|
||||
config.resolve.plugins.push(new TsconfigPathsPlugin());
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
import { getConfig } from "@think/config";
|
||||
import { HttpClient } from "./HttpClient";
|
||||
|
||||
const config = getConfig();
|
||||
|
||||
// @ts-ignore
|
||||
const hasOssConfig = config?.oss?.aliyun?.accessKeyId;
|
||||
|
||||
export const uploadFile = async (file: Blob): Promise<string> => {
|
||||
if (!hasOssConfig) {
|
||||
if (process.env.ENABLE_ALIYUN_OSS) {
|
||||
return Promise.reject(
|
||||
new Error("阿里云OSS配置不完善,请自行实现上传文件!")
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user