Skip to content

Commit 19a20a1

Browse files
committed
fix:image path double /
1 parent 31d23c8 commit 19a20a1

File tree

9 files changed

+42
-42
lines changed

9 files changed

+42
-42
lines changed

admin/src/views/about/components/CreateUpdate.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export default {
9090
props: {
9191
type: {
9292
type: String,
93-
default: function() {
93+
default: function () {
9494
return 'create'
9595
},
9696
},
@@ -201,7 +201,7 @@ export default {
201201
},
202202
methods: {
203203
submitForm(formName) {
204-
this.$refs[formName].validate(valid => {
204+
this.$refs[formName].validate((valid) => {
205205
/* if (true) {
206206
console.log('formData', this.formData)
207207
return
@@ -302,13 +302,13 @@ export default {
302302
getDetail() {
303303
this.loading = true
304304
305-
getDetail(this.querys.id).then(res => {
305+
getDetail(this.querys.id).then((res) => {
306306
this.loading = false
307307
308308
const { banner } = res
309309
this.uploadFile.list.push({
310310
name: banner,
311-
url: baseHost + banner.replace('public/', '/'),
311+
url: baseHost + banner.replace('public/', ''),
312312
})
313313
314314
this.formData = res

admin/src/views/home/about/components/CreateUpdate.vue

+5-5
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default {
6060
props: {
6161
type: {
6262
type: String,
63-
default: function() {
63+
default: function () {
6464
return 'create'
6565
},
6666
},
@@ -113,7 +113,7 @@ export default {
113113
},
114114
methods: {
115115
submitForm(formName) {
116-
this.$refs[formName].validate(valid => {
116+
this.$refs[formName].validate((valid) => {
117117
/* if (true) {
118118
console.log('formData', this.formData)
119119
return
@@ -165,7 +165,7 @@ export default {
165165
166166
// 添加
167167
postCreate() {
168-
create(this.formData).then(res => {
168+
create(this.formData).then((res) => {
169169
this.loading = false
170170
171171
this.$message({
@@ -201,13 +201,13 @@ export default {
201201
getDetail() {
202202
this.loading = true
203203
204-
getDetail(this.querys.id).then(res => {
204+
getDetail(this.querys.id).then((res) => {
205205
this.loading = false
206206
207207
const { pic } = res
208208
this.uploadFile.list.push({
209209
name: pic,
210-
url: baseHost + pic.replace('public/', '/'),
210+
url: baseHost + pic.replace('public/', ''),
211211
})
212212
213213
this.formData = res

admin/src/views/home/about/list.vue

+7-7
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<div class="filter-container__ctrl">
2121
<el-button
2222
class="filter-item"
23-
style="margin-left: 10px;"
23+
style="margin-left: 10px"
2424
type="primary"
2525
plain
2626
icon="el-icon-edit"
@@ -50,8 +50,8 @@
5050
<el-table-column label="图片" align="center">
5151
<template slot-scope="{ row }">
5252
<el-popover placement="right" width="230" trigger="hover">
53-
<img :src="row.pic" style="width: 200px;" />
54-
<img :src="row.pic" slot="reference" style="width: 40px;" />
53+
<img :src="row.pic" style="width: 200px" />
54+
<img :src="row.pic" slot="reference" style="width: 40px" />
5555
</el-popover>
5656
</template>
5757
</el-table-column>
@@ -176,13 +176,13 @@ export default {
176176
// 列表
177177
getList() {
178178
this.listLoading = true
179-
fetchList(this.listQuery).then(res => {
179+
fetchList(this.listQuery).then((res) => {
180180
const { data = [], total = 0 } = res
181181
182-
this.list = data.map(v => {
182+
this.list = data.map((v) => {
183183
let pic = v.pic
184184
if (pic) {
185-
v.pic = baseHost + pic.replace('public/', '/')
185+
v.pic = baseHost + pic.replace('public/', '')
186186
}
187187
return v
188188
})
@@ -210,7 +210,7 @@ export default {
210210
handleDelete(row) {
211211
let ids = []
212212
if (Array.isArray(row)) {
213-
ids = row.map(v => v.id)
213+
ids = row.map((v) => v.id)
214214
} else {
215215
ids.push(row.id)
216216
}

admin/src/views/home/banner/components/CreateUpdate.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default {
6969
props: {
7070
type: {
7171
type: String,
72-
default: function() {
72+
default: function () {
7373
return 'create'
7474
},
7575
},
@@ -129,7 +129,7 @@ export default {
129129
},
130130
methods: {
131131
submitForm(formName) {
132-
this.$refs[formName].validate(valid => {
132+
this.$refs[formName].validate((valid) => {
133133
if (!valid) {
134134
return false
135135
}
@@ -213,13 +213,13 @@ export default {
213213
getDetail() {
214214
this.loading = true
215215
216-
getDetail(this.querys.id).then(res => {
216+
getDetail(this.querys.id).then((res) => {
217217
this.loading = false
218218
219219
const { pic } = res
220220
this.uploadFile.list.push({
221221
name: pic,
222-
url: baseHost + pic.replace('public/', '/'),
222+
url: baseHost + pic.replace('public/', ''),
223223
})
224224
225225
this.formData = res

admin/src/views/home/banner/list.vue

+7-7
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<div class="filter-container__ctrl">
2222
<el-button
2323
class="filter-item"
24-
style="margin-left: 10px;"
24+
style="margin-left: 10px"
2525
type="primary"
2626
plain
2727
icon="el-icon-edit"
@@ -51,8 +51,8 @@
5151
<el-table-column label="图片" align="center">
5252
<template slot-scope="{ row }">
5353
<el-popover placement="right" width="230" trigger="hover">
54-
<img :src="row.pic" style="width: 200px;" />
55-
<img :src="row.pic" slot="reference" style="width: 40px;" />
54+
<img :src="row.pic" style="width: 200px" />
55+
<img :src="row.pic" slot="reference" style="width: 40px" />
5656
</el-popover>
5757
</template>
5858
</el-table-column>
@@ -176,15 +176,15 @@ export default {
176176
// 列表
177177
getList() {
178178
this.listLoading = true
179-
fetchList(this.listQuery).then(res => {
179+
fetchList(this.listQuery).then((res) => {
180180
const { data = [], total = 0 } = res
181181
182182
this.total = total
183183
184-
this.list = data.map(v => {
184+
this.list = data.map((v) => {
185185
let pic = v.pic
186186
if (pic) {
187-
v.pic = baseHost + pic.replace('public/', '/')
187+
v.pic = baseHost + pic.replace('public/', '')
188188
}
189189
return v
190190
})
@@ -210,7 +210,7 @@ export default {
210210
handleDelete(row) {
211211
let ids = []
212212
if (Array.isArray(row)) {
213-
ids = row.map(v => v.id)
213+
ids = row.map((v) => v.id)
214214
} else {
215215
ids.push(row.id)
216216
}

admin/src/views/product/components/CreateUpdate.vue

+5-5
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export default {
9797
props: {
9898
type: {
9999
type: String,
100-
default: function() {
100+
default: function () {
101101
return 'create'
102102
},
103103
},
@@ -213,7 +213,7 @@ export default {
213213
},
214214
methods: {
215215
submitForm(formName) {
216-
this.$refs[formName].validate(valid => {
216+
this.$refs[formName].validate((valid) => {
217217
if (!valid) {
218218
return false
219219
}
@@ -316,14 +316,14 @@ export default {
316316
getDetail() {
317317
this.loading = true
318318
319-
getDetail(this.querys.id).then(res => {
319+
getDetail(this.querys.id).then((res) => {
320320
this.loading = false
321321
322322
const { pic } = res
323323
if (pic) {
324324
this.uploadFile.list.push({
325325
name: pic,
326-
url: baseHost + pic.replace('public/', '/'),
326+
url: baseHost + pic.replace('public/', ''),
327327
})
328328
}
329329
@@ -333,7 +333,7 @@ export default {
333333
334334
// 分类列表
335335
getCategoryList() {
336-
fetchList().then(res => {
336+
fetchList().then((res) => {
337337
this.categoryList = res.data || []
338338
})
339339
},

admin/src/views/product/list.vue

+8-8
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<div class="filter-container__ctrl">
2222
<el-button
2323
class="filter-item"
24-
style="margin-left: 10px;"
24+
style="margin-left: 10px"
2525
type="primary"
2626
plain
2727
icon="el-icon-edit"
@@ -51,8 +51,8 @@
5151
<el-table-column label="图片" align="center">
5252
<template slot-scope="{ row }">
5353
<el-popover placement="right" width="230" trigger="hover">
54-
<img :src="row.pic" style="width: 200px;" />
55-
<img :src="row.pic" slot="reference" style="width: 40px;" />
54+
<img :src="row.pic" style="width: 200px" />
55+
<img :src="row.pic" slot="reference" style="width: 40px" />
5656
</el-popover>
5757
</template>
5858
</el-table-column>
@@ -192,13 +192,13 @@ export default {
192192
// 列表
193193
getList() {
194194
this.listLoading = true
195-
fetchList(this.listQuery).then(res => {
195+
fetchList(this.listQuery).then((res) => {
196196
const { data = [], total = 0 } = res
197-
this.list = data.map(v => {
197+
this.list = data.map((v) => {
198198
let pic = v.pic
199199
200200
if (pic) {
201-
v.pic = baseHost + pic.replace('public/', '/')
201+
v.pic = baseHost + pic.replace('public/', '')
202202
}
203203
204204
return v
@@ -210,7 +210,7 @@ export default {
210210
211211
// 分类列表
212212
getCategory() {
213-
fetchCategoryList().then(res => {
213+
fetchCategoryList().then((res) => {
214214
const { data = [] } = res
215215
216216
let listObject = listToObject(data)
@@ -236,7 +236,7 @@ export default {
236236
handleDelete(row) {
237237
let ids = []
238238
if (Array.isArray(row)) {
239-
ids = row.map(v => v.id)
239+
ids = row.map((v) => v.id)
240240
} else {
241241
ids.push(row.id)
242242
}

web/components/ProductList.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export default {
150150
const pic = v.pic;
151151

152152
if (pic) {
153-
v.pic = pic.replace("public/", "/");
153+
v.pic = pic.replace("public/", "");
154154
}
155155
return v;
156156
});

web/pages/index.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export default {
121121
const pic = v.pic;
122122
123123
if (pic) {
124-
v.pic = pic.replace("public/", "/");
124+
v.pic = pic.replace("public/", "");
125125
}
126126
return v;
127127
});

0 commit comments

Comments
 (0)