Browse Source

更新图片身份认证

1410417013 8 months ago
parent
commit
3adba92f95

+ 2 - 1
common/httpRequest.js

@@ -449,7 +449,8 @@ module.exports = {
 						// console.log(result.data+'ppo')
 						const decryptData =decrypt(urlSafeBase64Decode(result.data))
 						result.data=JSON.parse(decryptData)
-						// console.log('解密:'+decryptData+'--------'+result.data.code)
+						// const aac="CJd_exM-7HE6UXeV5Ai_gzavMNsUHJLlvQKWNYgNFszSC-Ahieu4OCoM2bqcGCUM"
+						// console.log('解密:'+decrypt(urlSafeBase64Decode(aac))+'--------')
 					}
 					
 					if (result.data.code == 401 && token) {

+ 5 - 1
my/other/cashDetail.vue

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

+ 18 - 8
my/publish/goods.vue

@@ -886,15 +886,20 @@ export default {
 						//初始绘画区域是画布自身的宽度也就是屏幕宽度
 						let drawWidth = uni.getSystemInfoSync().windowWidth
 						let that = this
+						let token = uni.getStorageSync("shopToken");
 						getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, that, (resPath) => {
-							uni.showLoading({
-								title: '上传中'
-							})
+							// uni.showLoading({
+							// 	title: '上传中'
+							// })
 							uni.uploadFile({
-								url: that.config('APIHOST1') + '/alioss/upload',
+								url: that.config('APIHOST1') + '/admin/new-file/upload',
 								filePath: resPath,
+								header: {
+									token: token
+								},
 								name: 'file',
 								success: (uploadFileRes) => {
+									console.log(uploadFileRes,'l')
 									if (e == 1) {
 										if (that.goodsPicture.length < 6) {
 											that.goodsPicture.push(JSON.parse(uploadFileRes.data).data)
@@ -936,15 +941,20 @@ export default {
 						//初始绘画区域是画布自身的宽度也就是屏幕宽度
 						let drawWidth = uni.getSystemInfoSync().windowWidth
 						let that = this
+						let token = uni.getStorageSync("shopToken");
 						getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, that, (resPath) => {
-							uni.showLoading({
-								title: '上传中'
-							})
+							// uni.showLoading({
+							// 	title: '上传中'
+							// })
 							uni.uploadFile({
-								url: that.config('APIHOST1') + '/alioss/upload',
+								url: that.config('APIHOST1') + '/admin/new-file/upload',
 								filePath: resPath,
+								header: {
+									token: token
+								},
 								name: 'file',
 								success: (uploadFileRes) => {
+									console.log(uploadFileRes,'l')
 									if (e == 1) {
 										that.shop.goodsCover = JSON.parse(uploadFileRes.data).data
 									}

+ 10 - 2
my/publish/index.vue

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

+ 10 - 2
my/store/index.vue

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

+ 1 - 2
my/yhq/add.vue

@@ -44,7 +44,6 @@
 		data() {
 			return {
 				action: '',
-				// action: config.APIHOST+'/alioss/upload',
 				fileList: [],
 				form: {
 					couponName: '',
@@ -59,7 +58,7 @@
 		},
 		onShow() {
 			let that = this
-			that.action=that.config("APIHOST1") + '/alioss/upload'
+			that.action=that.config("APIHOST1") + '/admin/new-file/upload'
 		},
 		methods: {
 			onRemove(e){

+ 1 - 1
my/yhq/edit.vue

@@ -60,7 +60,7 @@
 		},
 		onShow() {
 			let that = this
-			that.action=that.config("APIHOST1") + '/alioss/upload'
+			that.action=that.config("APIHOST1") + '/admin/new-file/upload'
 		},
 		onLoad(option) {
 			let info = JSON.parse(option.info)

+ 5 - 1
pages/my/chat.vue

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

+ 5 - 1
pages/my/im.vue

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

+ 2 - 2
pages/my/userinfo.vue

@@ -151,10 +151,10 @@ export default {
 										uni.showLoading({
 											title: '上传中'
 										})
-										let token = uni.getStorageSync('token')
+										let token = uni.getStorageSync('shopToken')
 
 										uni.uploadFile({
-											url: that.config('APIHOST1') + '/alioss/upload',
+											url: that.config('APIHOST1') + '/admin/new-file/upload',
 											filePath: resPath,
 											header: {
 												token: token

+ 5 - 1
pages/order/index.vue

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