Commit d9d7174c authored by wangqinghua's avatar wangqinghua

文件上传的错误

parent 22a94492
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"proxies": [ "proxies": [
{ {
"path": "/wisdomgroup", "path": "/wisdomgroup",
"proxyUrl": "http://192.168.2.235:8080/wisdomgroup" "proxyUrl": "http://47.103.33.196:8080/wisdomgroup"
} }
] ]
} }
\ No newline at end of file
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<ion-item *ngIf="type == 'image'"> <ion-item *ngIf="type == 'image'">
<ion-row> <ion-row>
<ion-col class="imgList" col-4 *ngFor="let img of fileList"> <ion-col class="imgList" col-4 *ngFor="let img of fileList">
<img [src]="pictrue + img.filePath" alt="标题图片"> <img [src]="pictrue + img.path" alt="标题图片">
</ion-col> </ion-col>
<ion-col col-4> <ion-col col-4>
<div class="selectDiv" (click)="tackePic()"> <div class="selectDiv" (click)="tackePic()">
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<ion-item *ngIf="type == 'video'"> <ion-item *ngIf="type == 'video'">
<ion-row> <ion-row>
<ion-col class="imgList" col-4 *ngFor="let video of fileList"> <ion-col class="imgList" col-4 *ngFor="let video of fileList">
<video [src]="pictrue + video.filePath"></video> <video [src]="pictrue + video.path"></video>
</ion-col> </ion-col>
<ion-col col-4> <ion-col col-4>
<div class="selectDiv" (click)="selectVideo()"> <div class="selectDiv" (click)="selectVideo()">
......
...@@ -112,11 +112,13 @@ export class PublishPage { ...@@ -112,11 +112,13 @@ export class PublishPage {
fileName:'image.png' fileName:'image.png'
}; };
this.camera.getPicture(options).then((imagedata) => { this.camera.getPicture(options).then((imagedata) => {
if(imagedata.indexOf('?') !== -1){ //获取文件名 let filePath = imagedata;
imagedata = imagedata.split('?')[0]; if(filePath.indexOf('?') !== -1){ //获取文件名
filePath = filePath.split('?')[0];
} }
let arr = imagedata.split('/'); let arr = filePath.split('/');
this.upload(arr[arr.length -1], option); option.fileName = arr[arr.length -1];
this.upload(imagedata, option);
}) })
} }
...@@ -137,11 +139,12 @@ export class PublishPage { ...@@ -137,11 +139,12 @@ export class PublishPage {
mimeType:'mp4' mimeType:'mp4'
}; };
this.camera.getPicture(options).then((videoData) => { this.camera.getPicture(options).then((videoData) => {
if(videoData.indexOf('?') !== -1){ //获取文件名 let filePath = videoData;
videoData = videoData.split('?')[0]; if(filePath.indexOf('?') !== -1){ //获取文件名
filePath = filePath.split('?')[0];
} }
let arr = videoData.split('/'); let arr = filePath.split('/');
this.upload(arr[arr.length -1], option); option.fileName = arr[arr.length -1];
this.upload(videoData, option); this.upload(videoData, option);
}) })
...@@ -199,13 +202,13 @@ export class PublishPage { ...@@ -199,13 +202,13 @@ export class PublishPage {
content: this.obj.content, content: this.obj.content,
publishRange: this.obj.publishRange, publishRange: this.obj.publishRange,
submitter: this.userid, submitter: this.userid,
stuffType: 1, stuffType: this.type === 'image'?1:2, //视频 2 图片 1
attachments: this.fileList, attachments: this.fileList,
}; };
this.commonSer.alert('确定提交审核当前内容?', () => { this.commonSer.alert('确定提交审核当前内容?', () => {
this.tabSer.stuffSave(data).subscribe( this.tabSer.stuffSave(data).subscribe(
(res) => { (res) => {
this.commonSer.toast('已提交审核') this.commonSer.toast('已提交审核');
setTimeout(() => { setTimeout(() => {
this.navCtrl.pop() this.navCtrl.pop()
}, 800) }, 800)
......
...@@ -15,8 +15,8 @@ export class AppGlobal { ...@@ -15,8 +15,8 @@ export class AppGlobal {
//接口基地址 //接口基地址
// static domain = "http://101.89.112.92:80"; //正式环境 // static domain = "http://101.89.112.92:80"; //正式环境
// static domain = "http://192.168.2.235:8080"; //测试环境 // static domain = "http://192.168.2.235:8080"; //测试环境
// static domain = "http://47.103.35.216:8080"; //阿里云地址 static domain = "http://47.103.33.196:8080"; //阿里云地址
static domain = ""; //本地环境 // static domain = ""; //本地环境
//图片地址 //图片地址
// static picture = AppGlobal.domain + "/wisdomgroup/manager/getIcon/"; //正式地址 // static picture = AppGlobal.domain + "/wisdomgroup/manager/getIcon/"; //正式地址
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment