|
@@ -162,7 +162,6 @@ import getLessLimitSizeImage from '@/utils/imageCompress.js'
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- action: 'https://newxxpw.xianmxkj.com/sqx_fast/alioss/upload',
|
|
|
|
|
fileList: [],
|
|
fileList: [],
|
|
|
show: false,
|
|
show: false,
|
|
|
params: {
|
|
params: {
|
|
@@ -214,6 +213,8 @@ export default {
|
|
|
methods: {
|
|
methods: {
|
|
|
// 上传视频
|
|
// 上传视频
|
|
|
addVideo() {
|
|
addVideo() {
|
|
|
|
|
+ let that=this
|
|
|
|
|
+ let token = uni.getStorageSync('token')
|
|
|
uni.chooseVideo({
|
|
uni.chooseVideo({
|
|
|
count: 1,
|
|
count: 1,
|
|
|
sourceType: ['album', 'camera'],
|
|
sourceType: ['album', 'camera'],
|
|
@@ -223,9 +224,12 @@ export default {
|
|
|
console.log(res.tempFilePath)
|
|
console.log(res.tempFilePath)
|
|
|
uni.uploadFile({
|
|
uni.uploadFile({
|
|
|
// 上传接口
|
|
// 上传接口
|
|
|
- // url: this.config("APIHOST1") + '/alioss/upload', //真实的接口地址
|
|
|
|
|
- url: 'https://newxxpw.xianmxkj.com/sqx_fast/alioss/upload',
|
|
|
|
|
|
|
+ // url: this.config("APIHOST1") + '/app/new-file/upload', //真实的接口地址
|
|
|
|
|
+ url: that.config('APIHOST1') + '/app/new-file/upload',
|
|
|
filePath: res.tempFilePath,
|
|
filePath: res.tempFilePath,
|
|
|
|
|
+ header: {
|
|
|
|
|
+ token: token
|
|
|
|
|
+ },
|
|
|
name: 'file',
|
|
name: 'file',
|
|
|
timeout: '30000',
|
|
timeout: '30000',
|
|
|
success: (uploadFileRes) => {
|
|
success: (uploadFileRes) => {
|
|
@@ -257,13 +261,17 @@ export default {
|
|
|
//初始绘画区域是画布自身的宽度也就是屏幕宽度
|
|
//初始绘画区域是画布自身的宽度也就是屏幕宽度
|
|
|
let drawWidth = uni.getSystemInfoSync().windowWidth
|
|
let drawWidth = uni.getSystemInfoSync().windowWidth
|
|
|
let that = this
|
|
let that = this
|
|
|
|
|
+ let token = uni.getStorageSync('token')
|
|
|
getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, that, (resPath) => {
|
|
getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, that, (resPath) => {
|
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
|
title: '上传中'
|
|
title: '上传中'
|
|
|
})
|
|
})
|
|
|
uni.uploadFile({
|
|
uni.uploadFile({
|
|
|
- url: 'https://newxxpw.xianmxkj.com/sqx_fast/alioss/upload',
|
|
|
|
|
|
|
+ url: that.config('APIHOST1') + '/app/new-file/upload',
|
|
|
filePath: resPath,
|
|
filePath: resPath,
|
|
|
|
|
+ header: {
|
|
|
|
|
+ token: token
|
|
|
|
|
+ },
|
|
|
name: 'file',
|
|
name: 'file',
|
|
|
success: (uploadFileRes) => {
|
|
success: (uploadFileRes) => {
|
|
|
if (e == 1) {
|
|
if (e == 1) {
|
|
@@ -301,13 +309,17 @@ export default {
|
|
|
//初始绘画区域是画布自身的宽度也就是屏幕宽度
|
|
//初始绘画区域是画布自身的宽度也就是屏幕宽度
|
|
|
let drawWidth = uni.getSystemInfoSync().windowWidth
|
|
let drawWidth = uni.getSystemInfoSync().windowWidth
|
|
|
let that = this
|
|
let that = this
|
|
|
|
|
+ let token = uni.getStorageSync('token')
|
|
|
getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, that, (resPath) => {
|
|
getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, that, (resPath) => {
|
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
|
title: '上传中'
|
|
title: '上传中'
|
|
|
})
|
|
})
|
|
|
uni.uploadFile({
|
|
uni.uploadFile({
|
|
|
- url: 'https://newxxpw.xianmxkj.com/sqx_fast/alioss/upload',
|
|
|
|
|
|
|
+ url: that.config('APIHOST1') + '/app/new-file/upload',
|
|
|
filePath: resPath,
|
|
filePath: resPath,
|
|
|
|
|
+ header: {
|
|
|
|
|
+ token: token
|
|
|
|
|
+ },
|
|
|
name: 'file',
|
|
name: 'file',
|
|
|
success: (uploadFileRes) => {
|
|
success: (uploadFileRes) => {
|
|
|
if (this.infantImgs.length < 9) {
|
|
if (this.infantImgs.length < 9) {
|