Prechádzať zdrojové kódy

上传图片加身份认证

1410417013 8 mesiacov pred
rodič
commit
3eda585b02

+ 5 - 1
pages/index/index.vue

@@ -2790,13 +2790,17 @@ export default {
 						//初始绘画区域是画布自身的宽度也就是屏幕宽度
 						let drawWidth = uni.getSystemInfoSync().windowWidth
 						let that = this
+						let token = uni.getStorageSync('token')
 						getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, that, (resPath) => {
 							uni.showLoading({
 								title: '上传中'
 							})
 							uni.uploadFile({
-								url: that.config('APIHOST1') + '/alioss/upload',
+								url: that.config('APIHOST1') + '/app/new-file/upload',
 								filePath: resPath,
+								header: {
+									token: token
+								},
 								name: 'file',
 								success: (uploadFileRes) => {
 									if (e == 1) {

+ 5 - 1
pages/index/luma.vue

@@ -1695,13 +1695,17 @@ export default {
 						//初始绘画区域是画布自身的宽度也就是屏幕宽度
 						let drawWidth = uni.getSystemInfoSync().windowWidth
 						let that = this
+						let token = uni.getStorageSync('token')
 						getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, that, (resPath) => {
 							uni.showLoading({
 								title: '上传中'
 							})
 							uni.uploadFile({
-								url: that.config('APIHOST1') + '/alioss/upload',
+								url: that.config('APIHOST1') + '/app/new-file/upload',
 								filePath: resPath,
+								header: {
+									token: token
+								},
 								name: 'file',
 								success: (uploadFileRes) => {
 									if (e == 1) {

+ 5 - 1
pages/index/orderdetail/orderdetail.vue

@@ -628,13 +628,17 @@ export default {
 						//初始绘画区域是画布自身的宽度也就是屏幕宽度
 						let drawWidth = uni.getSystemInfoSync().windowWidth
 						let that = this
+						let token = uni.getStorageSync('token')
 						getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, that, (resPath) => {
 							uni.showLoading({
 								title: '上传中'
 							})
 							uni.uploadFile({
-								url: that.config('APIHOST1') + '/alioss/upload',
+								url: that.config('APIHOST1') + '/app/new-file/upload',
 								filePath: resPath,
+								header: {
+									token: token
+								},
 								name: 'file',
 								success: (uploadFileRes) => {
 									if (e == 1) {

+ 2 - 2
pages/riderMy/approve/approve.vue

@@ -361,7 +361,6 @@ export default {
 				sourceType: ['album', 'camera'],
 				success: (res) => {
 					for (let i = 0; i < 1; i++) {
-						let token = uni.getStorageSync('token')
 
 						//这里的id和页面中写的html代码的canvas的id要一致
 						let canvasId = 'zipCanvas'
@@ -372,12 +371,13 @@ export default {
 						//初始绘画区域是画布自身的宽度也就是屏幕宽度
 						let drawWidth = uni.getSystemInfoSync().windowWidth
 						let that = this
+						let token = uni.getStorageSync('token')
 						getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, that, (resPath) => {
 							uni.showLoading({
 								title: '上传中'
 							})
 							uni.uploadFile({
-								url: configurl.APIHOST2 + '/alioss/upload',
+								url: configurl.APIHOST2 + '/app/new-file/upload',
 								filePath: resPath,
 								header: {
 									token: token

+ 5 - 1
pages/riderMy/kefu/chat.vue

@@ -623,13 +623,17 @@ export default {
 						//初始绘画区域是画布自身的宽度也就是屏幕宽度
 						let drawWidth = uni.getSystemInfoSync().windowWidth
 						let that = this
+						let token = uni.getStorageSync('token')
 						getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, that, (resPath) => {
 							uni.showLoading({
 								title: '上传中'
 							})
 							uni.uploadFile({
-								url: this.config('APIHOST') + '/alioss/upload',
+								url: this.config('APIHOST') + '/app/new-file/upload',
 								filePath: resPath,
+								header: {
+									token: token
+								},
 								name: 'file',
 								success: (uploadFileRes) => {
 									this.content = JSON.parse(uploadFileRes.data).data

+ 5 - 1
pages/riderMy/kefu/liaotianshi.vue

@@ -448,13 +448,17 @@ export default {
 						//初始绘画区域是画布自身的宽度也就是屏幕宽度
 						let drawWidth = uni.getSystemInfoSync().windowWidth
 						let that = this
+						let token = uni.getStorageSync('token')
 						getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, that, (resPath) => {
 							uni.showLoading({
 								title: '上传中'
 							})
 							uni.uploadFile({
-								url: this.config('APIHOST1') + '/alioss/upload',
+								url: this.config('APIHOST1') + '/app/new-file/upload',
 								filePath: resPath,
+								header: {
+									token: token
+								},
 								name: 'file',
 								success: (uploadFileRes) => {
 									console.log(uploadFileRes)

+ 5 - 1
pages/riderMy/myAccount/Txmoney/Txmoney.vue

@@ -517,13 +517,17 @@ export default {
 						//初始绘画区域是画布自身的宽度也就是屏幕宽度
 						let drawWidth = uni.getSystemInfoSync().windowWidth
 						let that = this
+						let token = uni.getStorageSync('token')
 						getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, that, (resPath) => {
 							uni.showLoading({
 								title: '上传中'
 							})
 							uni.uploadFile({
-								url: that.config('APIHOST1') + '/alioss/upload',
+								url: that.config('APIHOST1') + '/app/new-file/upload',
 								filePath: resPath,
+								header: {
+									token: token
+								},
 								name: 'file',
 								success: (uploadFileRes) => {
 									let img = JSON.parse(uploadFileRes.data).data

+ 5 - 1
pages/riderMy/order.vue

@@ -1136,13 +1136,17 @@ export default {
 						//初始绘画区域是画布自身的宽度也就是屏幕宽度
 						let drawWidth = uni.getSystemInfoSync().windowWidth
 						let that = this
+						let token = uni.getStorageSync('token')
 						getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, that, (resPath) => {
 							uni.showLoading({
 								title: '上传中'
 							})
 							uni.uploadFile({
-								url: that.config('APIHOST1') + '/alioss/upload',
+								url: that.config('APIHOST1') + '/app/new-file/upload',
 								filePath: resPath,
+								header: {
+									token: token
+								},
 								name: 'file',
 								success: (uploadFileRes) => {
 									if (e == 1) {

+ 4 - 3
pages/riderMy/riderMy.vue

@@ -284,8 +284,8 @@ export default {
 				mask: true // 是否显示透明蒙层,防止触摸穿透
 			})
 			uni.uploadFile({
-				// url: config.APIHOST1 + '/alioss/upload', //仅为示例,非真实的接口地址
-				url: configurl.APIHOST2 + '/alioss/upload', //仅为示例,非真实的接口地址
+				// url: config.APIHOST1 + '/app/new-file/upload', //仅为示例,非真实的接口地址
+				url: configurl.APIHOST2 + '/app/new-file/upload', //仅为示例,非真实的接口地址
 				filePath: e.detail.avatarUrl,
 				header: {
 					token: token
@@ -352,12 +352,13 @@ export default {
 									//初始绘画区域是画布自身的宽度也就是屏幕宽度
 									let drawWidth = uni.getSystemInfoSync().windowWidth
 									let that = this
+									let token = uni.getStorageSync('token')
 									getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, that, (resPath) => {
 										uni.showLoading({
 											title: '上传中'
 										})
 										uni.uploadFile({
-											url: 'https://mxys.chuanghai-tech.com/sqx_fast/alioss/upload',
+											url: configurl.APIHOST2 + '/app/new-file/upload',
 											filePath: resPath,
 											header: {
 												token: token