diff --git a/.env.development b/.env.development index 159efbd..ab35fbc 100644 --- a/.env.development +++ b/.env.development @@ -3,3 +3,5 @@ NODE_ENV = 'development' VITE_APP_BASE_API = 'https://ddbs.1024tool.vip/' VITE_SERVE = "https://ddbs.1024tool.vip/" # VITE_SERVE = "http://192.168.210.29:18100/" +VITE_OSS_ACCESS_KEY_ID = "LTAI5tCpvXC17uuPwWvb5oRo" +VITE_OSS_ACCESS_KEY_SECRET = "44EqDghVI0UVF0rVaea7gwOsPkXZ1z" \ No newline at end of file diff --git a/.env.production b/.env.production index a092139..b3199a9 100644 --- a/.env.production +++ b/.env.production @@ -3,3 +3,5 @@ NODE_ENV = 'production' VITE_APP_BASE_API = 'https://tools.1024tool.vip/' VITE_SERVE = "https://tools.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 328791f..67dad6b 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "@element-plus/icons-vue": "2.1.0", "@wangeditor/editor": "^5.1.23", "@wangeditor/editor-for-vue": "next", + "ali-oss": "^6.23.0", "axios": "^1.4.0", "default-passive-events": "^2.0.0", "echarts": "^5.6.0", diff --git a/src/api/upload.js b/src/api/upload.js new file mode 100644 index 0000000..e9cc6ec --- /dev/null +++ b/src/api/upload.js @@ -0,0 +1,19 @@ + +import request from '@/utils/request' + +export const getCode = () =>{ + return request({ + url: 'admin/policy_token', + method: 'post', + }) +} + +export const uploadFile = (data) =>{ + + request({ + url: 'https://image-fudan.oss-cn-beijing.aliyuncs.com', + method: 'get', + data + }) + +} diff --git a/src/router/index.ts b/src/router/index.ts index 7e47d41..59bc1aa 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -99,7 +99,6 @@ const whiteList = ['/login'] router.beforeEach(async (to, from, next) => { // Nprogress.start() const token = GET_TOKEN() - console.log(token) if (token) { if (to.path === '/login') { next('/index') diff --git a/src/views/news/addNew.vue b/src/views/news/addNew.vue index c4cd43b..04bcd86 100644 --- a/src/views/news/addNew.vue +++ b/src/views/news/addNew.vue @@ -26,11 +26,11 @@ 预览 - - - - + + + +
{{ newTitle }}
@@ -43,19 +43,21 @@ 关闭 - +