|
@@ -381,29 +381,33 @@
|
|
|
},
|
|
},
|
|
|
uploadrequest(option) {
|
|
uploadrequest(option) {
|
|
|
let _this = this
|
|
let _this = this
|
|
|
- axios.post(process.env.upfilehost, {})
|
|
|
|
|
- .then(function (res) {
|
|
|
|
|
- if (res.data && res.data.fid && res.data.fid !== '') {
|
|
|
|
|
- option.action = `http://${res.data.publicUrl}/${res.data.fid}`
|
|
|
|
|
- _this.waituploads.push({
|
|
|
|
|
- uid: option.file.uid,
|
|
|
|
|
- url: res.data.publicUrl,
|
|
|
|
|
- fid: res.data.fid
|
|
|
|
|
- })
|
|
|
|
|
- uploadajax(option)
|
|
|
|
|
- } else {
|
|
|
|
|
|
|
+ if (process.client) {
|
|
|
|
|
+ const myDomain = window.location.host
|
|
|
|
|
+ axios.post(process.env.upfilehost, {})
|
|
|
|
|
+ .then(function (res) {
|
|
|
|
|
+ if (res.data && res.data.fid && res.data.fid !== '') {
|
|
|
|
|
+ option.action = `http://${myDomain}/${res.data.publicUrl}/${res.data.fid}`
|
|
|
|
|
+ //option.action = `http://${res.data.publicUrl}/${res.data.fid}`
|
|
|
|
|
+ _this.waituploads.push({
|
|
|
|
|
+ uid: option.file.uid,
|
|
|
|
|
+ url: res.data.publicUrl,
|
|
|
|
|
+ fid: res.data.fid
|
|
|
|
|
+ })
|
|
|
|
|
+ uploadajax(option)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ _this.$message({
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ message: '未上传成功!请刷新界面重新上传!'
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(function (error) {
|
|
|
_this.$message({
|
|
_this.$message({
|
|
|
type: 'warning',
|
|
type: 'warning',
|
|
|
- message: '未上传成功!请刷新界面重新上传!'
|
|
|
|
|
|
|
+ message: '未上传成功!请重新上传!'
|
|
|
})
|
|
})
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- .catch(function (error) {
|
|
|
|
|
- _this.$message({
|
|
|
|
|
- type: 'warning',
|
|
|
|
|
- message: '未上传成功!请重新上传!'
|
|
|
|
|
})
|
|
})
|
|
|
- })
|
|
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
// 判断附件是否上传成功
|
|
// 判断附件是否上传成功
|
|
|
attachissuccess() {
|
|
attachissuccess() {
|