Commit d9d7174c authored by wangqinghua's avatar wangqinghua

文件上传的错误

parent 22a94492
......@@ -7,7 +7,7 @@
"proxies": [
{
"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 @@
<ion-item *ngIf="type == 'image'">
<ion-row>
<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 col-4>
<div class="selectDiv" (click)="tackePic()">
......@@ -46,7 +46,7 @@
<ion-item *ngIf="type == 'video'">
<ion-row>
<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 col-4>
<div class="selectDiv" (click)="selectVideo()">
......
......@@ -112,11 +112,13 @@ export class PublishPage {
fileName:'image.png'
};
this.camera.getPicture(options).then((imagedata) => {
if(imagedata.indexOf('?') !== -1){ //获取文件名
imagedata = imagedata.split('?')[0];
let filePath = imagedata;
if(filePath.indexOf('?') !== -1){ //获取文件名
filePath = filePath.split('?')[0];
}
let arr = imagedata.split('/');
this.upload(arr[arr.length -1], option);
let arr = filePath.split('/');
option.fileName = arr[arr.length -1];
this.upload(imagedata, option);
})
}
......@@ -137,11 +139,12 @@ export class PublishPage {
mimeType:'mp4'
};
this.camera.getPicture(options).then((videoData) => {
if(videoData.indexOf('?') !== -1){ //获取文件名
videoData = videoData.split('?')[0];
let filePath = videoData;
if(filePath.indexOf('?') !== -1){ //获取文件名
filePath = filePath.split('?')[0];
}
let arr = videoData.split('/');
this.upload(arr[arr.length -1], option);
let arr = filePath.split('/');
option.fileName = arr[arr.length -1];
this.upload(videoData, option);
})
......@@ -199,13 +202,13 @@ export class PublishPage {
content: this.obj.content,
publishRange: this.obj.publishRange,
submitter: this.userid,
stuffType: 1,
stuffType: this.type === 'image'?1:2, //视频 2 图片 1
attachments: this.fileList,
};
this.commonSer.alert('确定提交审核当前内容?', () => {
this.tabSer.stuffSave(data).subscribe(
(res) => {
this.commonSer.toast('已提交审核')
this.commonSer.toast('已提交审核');
setTimeout(() => {
this.navCtrl.pop()
}, 800)
......
......@@ -15,8 +15,8 @@ export class AppGlobal {
//接口基地址
// static domain = "http://101.89.112.92:80"; //正式环境
// static domain = "http://192.168.2.235:8080"; //测试环境
// static domain = "http://47.103.35.216:8080"; //阿里云地址
static domain = ""; //本地环境
static domain = "http://47.103.33.196:8080"; //阿里云地址
// static domain = ""; //本地环境
//图片地址
// 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