diff --git a/.env.production b/.env.production index b3199a9..40abbc8 100644 --- a/.env.production +++ b/.env.production @@ -1,7 +1,7 @@ # 变量必须以 VITE_ 为前缀才能暴露给外部读取 NODE_ENV = 'production' -VITE_APP_BASE_API = 'https://tools.1024tool.vip/' -VITE_SERVE = "https://tools.1024tool.vip/" +VITE_APP_BASE_API = 'https://ddbs.1024tool.vip/' +VITE_SERVE = "https://ddbs.1024tool.vip/" VITE_OSS_ACCESS_KEY_ID = "LTAI5tCpvXC17uuPwWvb5oRo" VITE_OSS_ACCESS_KEY_SECRET = "44EqDghVI0UVF0rVaea7gwOsPkXZ1z" \ No newline at end of file diff --git a/.env.test b/.env.test index 0f8c01f..4e8f60d 100644 --- a/.env.test +++ b/.env.test @@ -1,5 +1,7 @@ NODE_ENV = 'development' -VITE_APP_BASE_API = 'http://129.204.101.51:9999/' -VITE_SERVE = "http://129.204.101.51:9999/" +VITE_APP_BASE_API = 'https://ddbs.1024tool.vip/' +VITE_SERVE = "https://ddbs.1024tool.vip/" +VITE_OSS_ACCESS_KEY_ID = "LTAI5tCpvXC17uuPwWvb5oRo" +VITE_OSS_ACCESS_KEY_SECRET = "44EqDghVI0UVF0rVaea7gwOsPkXZ1z" \ No newline at end of file diff --git a/package.json b/package.json index 67dad6b..efad0b9 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "@iconify-json/ep": "^1.1.11", "@typescript-eslint/eslint-plugin": "^6.2.0", "@typescript-eslint/parser": "^6.2.0", + "@vitejs/plugin-basic-ssl": "^2.0.0", "@vitejs/plugin-vue": "^4.2.3", "eslint": "^8.45.0", "eslint-plugin-import": "^2.27.5", diff --git a/src/views/news/addNew.vue b/src/views/news/addNew.vue index 04bcd86..9f91d8e 100644 --- a/src/views/news/addNew.vue +++ b/src/views/news/addNew.vue @@ -141,11 +141,13 @@ editorConfig.MENU_CONF['uploadImage'] = { const code = await getCode() const client = new OSS({ region: "oss-cn-beijing", - authorizationV4: true, + // authorizationV4: true, accessKeyId: import.meta.env.VITE_OSS_ACCESS_KEY_ID, accessKeySecret: import.meta.env.VITE_OSS_ACCESS_KEY_SECRET, - stsToken: code.token, + stsToken: JSON.parse(code.token).security_token, bucket: "image-fudan", + secure: true, + // endpoint: 'https' }); // Generate unique filename with original extension @@ -153,8 +155,8 @@ editorConfig.MENU_CONF['uploadImage'] = { const fileName = `${Date.now()}-${Math.random().toString(36).substring(2)}.${fileExt}` const options = { - meta: { temp: "demo" }, - mime: file.type, + // meta: { temp: "demo" }, + // mime: file.type, headers: { "Content-Type": file.type }, }; diff --git a/vite.config.ts b/vite.config.ts index d9c07a4..4a1bd7a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -13,6 +13,7 @@ import IconsResolver from 'unplugin-icons/resolver' import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' import { viteMockServe } from 'vite-plugin-mock' +import pluginBasicSsl from '@vitejs/plugin-basic-ssl' // 引入 fs 模块 // import fs from 'fs' // const fs = require('fs'); @@ -23,7 +24,7 @@ export default defineConfig(({ command, mode }) => { return { plugins: [ vue(), - + pluginBasicSsl(), AutoImport({ resolvers: [ ElementPlusResolver(),