diff --git a/.env.development b/.env.development index 6785ab0..58e6be1 100644 --- a/.env.development +++ b/.env.development @@ -4,8 +4,8 @@ ENV = 'development' # base api #VUE_APP_BASE_API = '/dev-api' #VUE_APP_BASE_API = 'http://app.rt.xianci.info/' -VUE_APP_BASE_API = 'http://office.xianci.info:18904/' -#VUE_APP_BASE_API = 'http://api.rt.myntv.cn/' +# VUE_APP_BASE_API = 'http://office.xianci.info:18904/' +VUE_APP_BASE_API = 'https://api.rt.rtrmt.cn/' # base url VUE_APP_BASE_URL = 'http://admin.rt.xianci.info' diff --git a/convenience-prod.zip b/convenience-prod.zip new file mode 100644 index 0000000..63747f1 Binary files /dev/null and b/convenience-prod.zip differ diff --git a/src/api/staff.js b/src/api/staff.js index 4c086fa..5278e56 100644 --- a/src/api/staff.js +++ b/src/api/staff.js @@ -1,4 +1,4 @@ -import request from "@/utils/request"; +import request from '@/utils/request' /** * 通讯录 @@ -26,8 +26,21 @@ export function staffList(data) { */ export function info(data) { return request({ - url: "/api/convenience/v2/staff/info", - method: "get", + url: '/api/convenience/v2/staff/info', + method: 'get', params: data - }); + }) +} + +/** + * 文件上传 + * @param data + */ +export function upload(data) { + return request({ + url: '/api/common/upload/upload', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data + }) } diff --git a/src/components/AliOSS/index.vue b/src/components/AliOSS/index.vue index 324f3f8..ae0bd65 100644 --- a/src/components/AliOSS/index.vue +++ b/src/components/AliOSS/index.vue @@ -20,6 +20,8 @@ import OSS from '@/utils/aliOSS' import UUID from 'uuidjs' +import { upload } from '@/api/staff' + export default { props: { value: { @@ -58,10 +60,18 @@ export default { const suffix = item.name.substr(item.name.lastIndexOf('.')+1) const fileName = UUID.generate() + '.' + suffix item.name = fileName - OSS(item.raw, fileName).then(res => { + + const formData = new FormData() + formData.append('file', item.raw, fileName) + upload(formData).then(res => { + console.log(res) + // OSS(item.raw, fileName).then(res => { - this.$emit('input', 'http://storage.myntv.cn/'+res.name) - item.url = 'http://storage.myntv.cn/'+res.name + // this.$emit('input', 'http://storage.myntv.cn/'+res.name) + // item.url = 'http://storage.myntv.cn/'+res.name + this.$emit('input', res.d) + item.url = res.d + item.status = 'success' const list = fileList.filter(item => item.status === 'success').map(item => item.url) console.log(list); @@ -70,13 +80,17 @@ export default { } }) } else { - // const suffix = file.name.split('.')[0] - const suffix = item.name.substr(item.name.lastIndexOf('.')+1) + const suffix = file.name.split('.')[0] const fileName = UUID.generate() + '.' + suffix file.name = fileName this.fileList = [file] - OSS(file.raw, fileName).then(res => { - this.$emit('input', 'http://storage.myntv.cn/'+res.name) + + const formData = new FormData() + formData.append('file', file.raw, fileName) + upload(formData).then(res => { + // OSS(file.raw, fileName).then(res => { + // this.$emit('input', 'http://storage.myntv.cn/'+res.name) + this.$emit('input', res.d) }) } }, diff --git a/src/components/UEditor/index.vue b/src/components/UEditor/index.vue index 89a7540..72394c5 100644 --- a/src/components/UEditor/index.vue +++ b/src/components/UEditor/index.vue @@ -41,6 +41,8 @@ import { Loading } from 'element-ui' import OSS from '@/utils/aliOSS' import UUID from 'uuidjs' +import { upload } from '@/api/staff' + export default { components: { Preview }, props: { @@ -178,8 +180,13 @@ export default { file = item }) const suffix = file.name.split('.')[1] - OSS(file, UUID.generate() + '.' + suffix).then(res => { - resolve(res.url) + + const form = new FormData() + form.append('file', file) + upload(form).then(res => { + // OSS(file, UUID.generate() + '.' + suffix).then(res => { + // resolve(res.url) + resolve(res.d) loadingInstance.close() }).catch(() => { console.log('文件上传失败!') diff --git a/src/components/cutUploadImage/index.vue b/src/components/cutUploadImage/index.vue index 7bf557b..2a431bc 100644 --- a/src/components/cutUploadImage/index.vue +++ b/src/components/cutUploadImage/index.vue @@ -32,7 +32,7 @@ :style="{ width: width + 'px', height: height + 'px' }" @mouseenter="mouseEnter" @mouseleave="mouseLeave" - /> + > - +