Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
9eaf2db3
Commit
9eaf2db3
authored
Aug 01, 2018
by
Menethil
Browse files
修复上传TOKEN问题
parent
23311bab
Changes
14
Show whitespace changes
Inline
Side-by-side
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/annotation/support/LoginAdminHandlerMethodArgumentResolver.java
View file @
9eaf2db3
...
@@ -10,7 +10,7 @@ import org.springframework.web.method.support.ModelAndViewContainer;
...
@@ -10,7 +10,7 @@ import org.springframework.web.method.support.ModelAndViewContainer;
public
class
LoginAdminHandlerMethodArgumentResolver
implements
HandlerMethodArgumentResolver
{
public
class
LoginAdminHandlerMethodArgumentResolver
implements
HandlerMethodArgumentResolver
{
public
static
final
String
LOGIN_TOKEN_KEY
=
"
X
-Token"
;
public
static
final
String
LOGIN_TOKEN_KEY
=
"
Admin
-Token"
;
@Override
@Override
public
boolean
supportsParameter
(
MethodParameter
parameter
)
{
public
boolean
supportsParameter
(
MethodParameter
parameter
)
{
return
parameter
.
getParameterType
().
isAssignableFrom
(
Integer
.
class
)&&
parameter
.
hasParameterAnnotation
(
LoginAdmin
.
class
);
return
parameter
.
getParameterType
().
isAssignableFrom
(
Integer
.
class
)&&
parameter
.
hasParameterAnnotation
(
LoginAdmin
.
class
);
...
...
litemall-admin/config/dep.env.js
View file @
9eaf2db3
module
.
exports
=
{
module
.
exports
=
{
NODE_ENV
:
'
"production"
'
,
NODE_ENV
:
'
"production"
'
,
ENV_CONFIG
:
'
"dep"
'
,
ENV_CONFIG
:
'
"dep"
'
,
BASE_API
:
'
"http://
122.152.206.172
:8080/admin"
'
BASE_API
:
'
"http://
localhost
:8080/admin"
'
}
}
litemall-admin/src/components/Upload/singleImage.vue
View file @
9eaf2db3
<
template
>
<
template
>
<div
class=
"upload-container"
>
<div
class=
"upload-container"
>
<el-upload
class=
"image-uploader"
:data=
"dataObj"
drag
:multiple=
"false"
:show-file-list=
"false"
action=
"https://httpbin.org/post"
<el-upload
class=
"image-uploader"
:data=
"dataObj"
:headers=
"headers"
drag
:multiple=
"false"
:show-file-list=
"false"
action=
"https://httpbin.org/post"
:on-success=
"handleImageScucess"
>
:on-success=
"handleImageScucess"
>
<i
class=
"el-icon-upload"
></i>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em></div>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em></div>
...
@@ -28,6 +28,11 @@ export default {
...
@@ -28,6 +28,11 @@ export default {
computed
:
{
computed
:
{
imageUrl
()
{
imageUrl
()
{
return
this
.
value
return
this
.
value
},
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
}
},
},
data
()
{
data
()
{
...
...
litemall-admin/src/components/Upload/singleImage2.vue
View file @
9eaf2db3
<
template
>
<
template
>
<div
class=
"singleImageUpload2 upload-container"
>
<div
class=
"singleImageUpload2 upload-container"
>
<el-upload
class=
"image-uploader"
:data=
"dataObj"
drag
:multiple=
"false"
:show-file-list=
"false"
action=
"https://httpbin.org/post"
<el-upload
class=
"image-uploader"
:data=
"dataObj"
:headers=
"headers"
drag
:multiple=
"false"
:show-file-list=
"false"
action=
"https://httpbin.org/post"
:on-success=
"handleImageScucess"
>
:on-success=
"handleImageScucess"
>
<i
class=
"el-icon-upload"
></i>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
Drag或
<em>
点击上传
</em></div>
<div
class=
"el-upload__text"
>
Drag或
<em>
点击上传
</em></div>
...
@@ -27,6 +27,11 @@ export default {
...
@@ -27,6 +27,11 @@ export default {
computed
:
{
computed
:
{
imageUrl
()
{
imageUrl
()
{
return
this
.
value
return
this
.
value
},
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
}
},
},
data
()
{
data
()
{
...
...
litemall-admin/src/components/Upload/singleImage3.vue
View file @
9eaf2db3
<
template
>
<
template
>
<div
class=
"upload-container"
>
<div
class=
"upload-container"
>
<el-upload
class=
"image-uploader"
:data=
"dataObj"
drag
:multiple=
"false"
:show-file-list=
"false"
action=
"https://httpbin.org/post"
<el-upload
class=
"image-uploader"
:data=
"dataObj"
:headers=
"headers"
drag
:multiple=
"false"
:show-file-list=
"false"
action=
"https://httpbin.org/post"
:on-success=
"handleImageScucess"
>
:on-success=
"handleImageScucess"
>
<i
class=
"el-icon-upload"
></i>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em></div>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em></div>
...
@@ -35,6 +35,11 @@ export default {
...
@@ -35,6 +35,11 @@ export default {
computed
:
{
computed
:
{
imageUrl
()
{
imageUrl
()
{
return
this
.
value
return
this
.
value
},
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
}
},
},
data
()
{
data
()
{
...
...
litemall-admin/src/utils/request.js
View file @
9eaf2db3
...
@@ -13,7 +13,7 @@ const service = axios.create({
...
@@ -13,7 +13,7 @@ const service = axios.create({
service
.
interceptors
.
request
.
use
(
config
=>
{
service
.
interceptors
.
request
.
use
(
config
=>
{
// Do something before request is sent
// Do something before request is sent
if
(
store
.
getters
.
token
)
{
if
(
store
.
getters
.
token
)
{
config
.
headers
[
'
X
-Token
'
]
=
getToken
()
// 让每个请求携带token-- ['
X
-Token']为自定义key 请根据实际情况自行修改
config
.
headers
[
'
Admin
-Token
'
]
=
getToken
()
// 让每个请求携带token-- ['
Admin
-Token']为自定义key 请根据实际情况自行修改
}
}
return
config
return
config
},
error
=>
{
},
error
=>
{
...
...
litemall-admin/src/views/goods/comment.vue
View file @
9eaf2db3
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
</el-form-item>
</el-form-item>
<el-form-item
label=
"评论图片"
prop=
"picUrls"
>
<el-form-item
label=
"评论图片"
prop=
"picUrls"
>
<!-- <el-input v-model="dataForm.picUrls"></el-input> -->
<!-- <el-input v-model="dataForm.picUrls"></el-input> -->
<el-upload
action=
"#"
list-type=
"picture"
:show-file-list=
"false"
:limit=
"5"
:http-request=
"uploadPicUrls"
>
<el-upload
action=
"#"
list-type=
"picture"
:headers=
"headers"
:show-file-list=
"false"
:limit=
"5"
:http-request=
"uploadPicUrls"
>
<el-button
size=
"small"
type=
"primary"
>
点击上传
</el-button>
<el-button
size=
"small"
type=
"primary"
>
点击上传
</el-button>
</el-upload>
</el-upload>
</el-form-item>
</el-form-item>
...
@@ -98,9 +98,17 @@
...
@@ -98,9 +98,17 @@
<
script
>
<
script
>
import
{
listComment
,
createComment
,
updateComment
,
deleteComment
}
from
'
@/api/comment
'
import
{
listComment
,
createComment
,
updateComment
,
deleteComment
}
from
'
@/api/comment
'
import
{
createStorage
}
from
'
@/api/storage
'
import
{
createStorage
}
from
'
@/api/storage
'
import
{
getToken
}
from
'
@/utils/auth
'
export
default
{
export
default
{
name
:
'
Comment
'
,
name
:
'
Comment
'
,
computed
:
{
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
},
data
()
{
data
()
{
return
{
return
{
list
:
undefined
,
list
:
undefined
,
...
...
litemall-admin/src/views/goods/create.vue
View file @
9eaf2db3
...
@@ -40,14 +40,16 @@
...
@@ -40,14 +40,16 @@
</el-form-item>
</el-form-item>
<el-form-item
label=
"商品图片"
>
<el-form-item
label=
"商品图片"
>
<el-upload
class=
"avatar-uploader"
:action=
"uploadPath"
list-type=
"picture-card"
:show-file-list=
"false"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadPicUrl"
>
<el-upload
class=
"avatar-uploader"
:action=
"uploadPath"
list-type=
"picture-card"
:show-file-list=
"false"
:headers=
"headers"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadPicUrl"
>
<img
v-if=
"goods.picUrl"
:src=
"goods.picUrl"
class=
"avatar"
>
<img
v-if=
"goods.picUrl"
:src=
"goods.picUrl"
class=
"avatar"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-upload>
</el-form-item>
</el-form-item>
<el-form-item
label=
"宣传画廊"
>
<el-form-item
label=
"宣传画廊"
>
<el-upload
:action=
"uploadPath"
:limit=
"5"
multiple
accept=
".jpg,.jpeg,.png,.gif"
list-type=
"picture-card"
:on-exceed=
"uploadOverrun"
:on-success=
"handleGalleryUrl"
:on-remove=
"handleRemove"
>
<el-upload
:action=
"uploadPath"
:limit=
"5"
multiple
accept=
".jpg,.jpeg,.png,.gif"
list-type=
"picture-card"
:headers=
"headers"
:on-exceed=
"uploadOverrun"
:on-success=
"handleGalleryUrl"
:on-remove=
"handleRemove"
>
<i
class=
"el-icon-plus"
></i>
<i
class=
"el-icon-plus"
></i>
</el-upload>
</el-upload>
</el-form-item>
</el-form-item>
...
@@ -60,7 +62,8 @@
...
@@ -60,7 +62,8 @@
<el-tag
:key=
"tag"
v-for=
"tag in keywords"
closable
type=
"primary"
@
close=
"handleClose(tag)"
>
<el-tag
:key=
"tag"
v-for=
"tag in keywords"
closable
type=
"primary"
@
close=
"handleClose(tag)"
>
{{tag}}
{{tag}}
</el-tag>
</el-tag>
<el-input
class=
"input-new-keyword"
v-if=
"newKeywordVisible"
v-model=
"newKeyword"
ref=
"newKeywordInput"
size=
"small"
@
keyup.enter.native=
"handleInputConfirm"
@
blur=
"handleInputConfirm"
>
<el-input
class=
"input-new-keyword"
v-if=
"newKeywordVisible"
v-model=
"newKeyword"
ref=
"newKeywordInput"
size=
"small"
@
keyup.enter.native=
"handleInputConfirm"
@
blur=
"handleInputConfirm"
>
</el-input>
</el-input>
<el-button
v-else
class=
"button-new-keyword"
size=
"small"
type=
"primary"
@
click=
"showInput"
>
+ 增加
</el-button>
<el-button
v-else
class=
"button-new-keyword"
size=
"small"
type=
"primary"
@
click=
"showInput"
>
+ 增加
</el-button>
</el-form-item>
</el-form-item>
...
@@ -89,9 +92,9 @@
...
@@ -89,9 +92,9 @@
<el-card
class=
"box-card"
>
<el-card
class=
"box-card"
>
<h3>
商品规格
</h3>
<h3>
商品规格
</h3>
<el-row
type=
"flex"
align=
"middle"
:gutter=
"20"
style=
"padding:20px 0;"
>
<el-row
type=
"flex"
align=
"middle"
:gutter=
"20"
style=
"padding:20px 0;"
>
<el-col
:span=
"10"
>
<el-col
:span=
"10"
>
<el-radio-group
v-model=
"multipleSpec"
@
change=
"specChanged"
>
<el-radio-group
v-model=
"multipleSpec"
@
change=
"specChanged"
>
<el-radio-button
:label=
"false"
>
默认标准规格
</el-radio-button>
<el-radio-button
:label=
"false"
>
默认标准规格
</el-radio-button>
<el-radio-button
:label=
"true"
>
多规格支持
</el-radio-button>
<el-radio-button
:label=
"true"
>
多规格支持
</el-radio-button>
</el-radio-group>
</el-radio-group>
</el-col>
</el-col>
...
@@ -101,8 +104,8 @@
...
@@ -101,8 +104,8 @@
</el-row>
</el-row>
<el-table
:data=
"specifications"
>
<el-table
:data=
"specifications"
>
<el-table-column
property=
"specification"
label=
"规格名"
></el-table-column>
<el-table-column
property=
"specification"
label=
"规格名"
></el-table-column>
<el-table-column
property=
"value"
label=
"规格值"
>
<el-table-column
property=
"value"
label=
"规格值"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-tag
type=
"primary"
>
<el-tag
type=
"primary"
>
{{
scope
.
row
.
value
}}
{{
scope
.
row
.
value
}}
...
@@ -114,7 +117,8 @@
...
@@ -114,7 +117,8 @@
<img
:src=
"scope.row.picUrl"
width=
"40"
v-if=
"scope.row.picUrl"
/>
<img
:src=
"scope.row.picUrl"
width=
"40"
v-if=
"scope.row.picUrl"
/>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"操作"
width=
"250"
class-name=
"small-padding fixed-width"
v-if=
"multipleSpec"
>
<el-table-column
align=
"center"
label=
"操作"
width=
"250"
class-name=
"small-padding fixed-width"
v-if=
"multipleSpec"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"danger"
size=
"mini"
@
click=
"handleSpecificationDelete(scope.row)"
>
删除
</el-button>
<el-button
type=
"danger"
size=
"mini"
@
click=
"handleSpecificationDelete(scope.row)"
>
删除
</el-button>
</
template
>
</
template
>
...
@@ -122,7 +126,8 @@
...
@@ -122,7 +126,8 @@
</el-table>
</el-table>
<el-dialog
title=
"设置规格"
:visible.sync=
"specVisiable"
>
<el-dialog
title=
"设置规格"
:visible.sync=
"specVisiable"
>
<el-form
:rules=
"rules"
ref=
"specForm"
:model=
"specForm"
status-icon
label-position=
"left"
label-width=
"100px"
style=
'width: 400px; margin-left:50px;'
>
<el-form
:rules=
"rules"
ref=
"specForm"
:model=
"specForm"
status-icon
label-position=
"left"
label-width=
"100px"
style=
'width: 400px; margin-left:50px;'
>
<el-form-item
label=
"规格名"
prop=
"specification"
>
<el-form-item
label=
"规格名"
prop=
"specification"
>
<el-input
v-model=
"specForm.specification"
></el-input>
<el-input
v-model=
"specForm.specification"
></el-input>
</el-form-item>
</el-form-item>
...
@@ -130,7 +135,8 @@
...
@@ -130,7 +135,8 @@
<el-input
v-model=
"specForm.value"
></el-input>
<el-input
v-model=
"specForm.value"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"规格图片"
prop=
"picUrl"
>
<el-form-item
label=
"规格图片"
prop=
"picUrl"
>
<el-upload
class=
"avatar-uploader"
:action=
'uploadPath'
list-type=
"picture-card"
:show-file-list=
"false"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadSpecPicUrl"
>
<el-upload
class=
"avatar-uploader"
:action=
'uploadPath'
list-type=
"picture-card"
:show-file-list=
"false"
:headers=
"headers"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadSpecPicUrl"
>
<img
v-if=
"specForm.picUrl"
:src=
"specForm.picUrl"
class=
"avatar"
>
<img
v-if=
"specForm.picUrl"
:src=
"specForm.picUrl"
class=
"avatar"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-upload>
...
@@ -146,7 +152,7 @@
...
@@ -146,7 +152,7 @@
<el-card
class=
"box-card"
>
<el-card
class=
"box-card"
>
<h3>
商品库存
</h3>
<h3>
商品库存
</h3>
<el-table
:data=
"products"
>
<el-table
:data=
"products"
>
<el-table-column
property=
"value"
label=
"货品规格"
>
<el-table-column
property=
"value"
label=
"货品规格"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-tag
:key=
"tag"
v-for=
"tag in scope.row.specifications"
>
<el-tag
:key=
"tag"
v-for=
"tag in scope.row.specifications"
>
{{
tag
}}
{{
tag
}}
...
@@ -170,7 +176,8 @@
...
@@ -170,7 +176,8 @@
</el-table>
</el-table>
<el-dialog
title=
"设置货品"
:visible.sync=
"productVisiable"
>
<el-dialog
title=
"设置货品"
:visible.sync=
"productVisiable"
>
<el-form
ref=
"productForm"
:model=
"productForm"
status-icon
label-position=
"left"
label-width=
"100px"
style=
'width: 400px; margin-left:50px;'
>
<el-form
ref=
"productForm"
:model=
"productForm"
status-icon
label-position=
"left"
label-width=
"100px"
style=
'width: 400px; margin-left:50px;'
>
<el-form-item
label=
"货品规格列"
prop=
"specifications"
>
<el-form-item
label=
"货品规格列"
prop=
"specifications"
>
<el-tag
:key=
"tag"
v-for=
"tag in productForm.specifications"
>
<el-tag
:key=
"tag"
v-for=
"tag in productForm.specifications"
>
{{tag}}
{{tag}}
...
@@ -183,7 +190,8 @@
...
@@ -183,7 +190,8 @@
<el-input
v-model=
"productForm.number"
></el-input>
<el-input
v-model=
"productForm.number"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"货品图片"
prop=
"url"
>
<el-form-item
label=
"货品图片"
prop=
"url"
>
<el-upload
class=
"avatar-uploader"
:action=
'uploadPath'
list-type=
"picture-card"
:show-file-list=
"false"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadProductUrl"
>
<el-upload
class=
"avatar-uploader"
:action=
'uploadPath'
list-type=
"picture-card"
:show-file-list=
"false"
:headers=
"headers"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadProductUrl"
>
<img
v-if=
"productForm.url"
:src=
"productForm.url"
class=
"avatar"
>
<img
v-if=
"productForm.url"
:src=
"productForm.url"
class=
"avatar"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-upload>
...
@@ -212,7 +220,8 @@
...
@@ -212,7 +220,8 @@
</el-table>
</el-table>
<el-dialog
title=
"设置商品参数"
:visible.sync=
"attributeVisiable"
>
<el-dialog
title=
"设置商品参数"
:visible.sync=
"attributeVisiable"
>
<el-form
ref=
"attributeForm"
:model=
"attributeForm"
status-icon
label-position=
"left"
label-width=
"100px"
style=
'width: 400px; margin-left:50px;'
>
<el-form
ref=
"attributeForm"
:model=
"attributeForm"
status-icon
label-position=
"left"
label-width=
"100px"
style=
'width: 400px; margin-left:50px;'
>
<el-form-item
label=
"商品参数名称"
prop=
"attribute"
>
<el-form-item
label=
"商品参数名称"
prop=
"attribute"
>
<el-input
v-model=
"attributeForm.attribute"
></el-input>
<el-input
v-model=
"attributeForm.attribute"
></el-input>
</el-form-item>
</el-form-item>
...
@@ -239,14 +248,17 @@
...
@@ -239,14 +248,17 @@
.el-card
{
.el-card
{
margin-bottom
:
10px
;
margin-bottom
:
10px
;
}
}
.el-tag
+
.el-tag
{
.el-tag
+
.el-tag
{
margin-left
:
10px
;
margin-left
:
10px
;
}
}
.input-new-keyword
{
.input-new-keyword
{
width
:
90px
;
width
:
90px
;
margin-left
:
10px
;
margin-left
:
10px
;
vertical-align
:
bottom
;
vertical-align
:
bottom
;
}
}
.avatar-uploader
.el-upload
{
.avatar-uploader
.el-upload
{
border
:
1px
dashed
#d9d9d9
;
border
:
1px
dashed
#d9d9d9
;
border-radius
:
6px
;
border-radius
:
6px
;
...
@@ -254,9 +266,11 @@
...
@@ -254,9 +266,11 @@
position
:
relative
;
position
:
relative
;
overflow
:
hidden
;
overflow
:
hidden
;
}
}
.avatar-uploader
.el-upload
:hover
{
.avatar-uploader
.el-upload
:hover
{
border-color
:
#20a0ff
;
border-color
:
#20a0ff
;
}
}
.avatar-uploader-icon
{
.avatar-uploader-icon
{
font-size
:
28px
;
font-size
:
28px
;
color
:
#8c939d
;
color
:
#8c939d
;
...
@@ -265,6 +279,7 @@
...
@@ -265,6 +279,7 @@
line-height
:
120px
;
line-height
:
120px
;
text-align
:
center
;
text-align
:
center
;
}
}
.avatar
{
.avatar
{
width
:
120px
;
width
:
120px
;
height
:
120px
;
height
:
120px
;
...
@@ -273,14 +288,23 @@
...
@@ -273,14 +288,23 @@
</
style
>
</
style
>
<
script
>
<
script
>
import
{
publishGoods
,
listCatAndBrand
}
from
'
@/api/goods
'
import
{
publishGoods
,
listCatAndBrand
}
from
'
@/api/goods
'
import
{
createStorage
,
uploadPath
}
from
'
@/api/storage
'
import
{
createStorage
,
uploadPath
}
from
'
@/api/storage
'
import
Editor
from
'
@tinymce/tinymce-vue
'
import
Editor
from
'
@tinymce/tinymce-vue
'
import
{
MessageBox
}
from
'
element-ui
'
import
{
MessageBox
}
from
'
element-ui
'
import
{
getToken
}
from
'
@/utils/auth
'
export
default
{
export
default
{
name
:
'
GoodsCreate
'
,
name
:
'
GoodsCreate
'
,
components
:
{
Editor
},
components
:
{
Editor
},
computed
:
{
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
},
data
()
{
data
()
{
return
{
return
{
uploadPath
,
uploadPath
,
...
@@ -323,6 +347,7 @@ export default {
...
@@ -323,6 +347,7 @@ export default {
created
()
{
created
()
{
this
.
init
()
this
.
init
()
},
},
methods
:
{
methods
:
{
init
:
function
()
{
init
:
function
()
{
listCatAndBrand
().
then
(
response
=>
{
listCatAndBrand
().
then
(
response
=>
{
...
@@ -539,5 +564,5 @@ export default {
...
@@ -539,5 +564,5 @@ export default {
this
.
attributes
.
splice
(
index
,
1
)
this
.
attributes
.
splice
(
index
,
1
)
}
}
}
}
}
}
</
script
>
</
script
>
litemall-admin/src/views/goods/edit.vue
View file @
9eaf2db3
...
@@ -40,14 +40,14 @@
...
@@ -40,14 +40,14 @@
</el-form-item>
</el-form-item>
<el-form-item
label=
"商品图片"
>
<el-form-item
label=
"商品图片"
>
<el-upload
class=
"avatar-uploader"
:action=
'uploadPath'
list-type=
"picture-card"
:show-file-list=
"false"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadPicUrl"
>
<el-upload
class=
"avatar-uploader"
:headers=
"headers"
:action=
'uploadPath'
list-type=
"picture-card"
:show-file-list=
"false"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadPicUrl"
>
<img
v-if=
"goods.picUrl"
:src=
"goods.picUrl"
class=
"avatar"
>
<img
v-if=
"goods.picUrl"
:src=
"goods.picUrl"
class=
"avatar"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-upload>
</el-form-item>
</el-form-item>
<el-form-item
label=
"宣传画廊"
>
<el-form-item
label=
"宣传画廊"
>
<el-upload
:action=
'uploadPath'
:limit=
'5'
multiple
accept=
".jpg,.jpeg,.png,.gif"
:file-list=
"galleryFileList"
list-type=
"picture-card"
:on-exceed=
'uploadOverrun'
:on-success=
"handleGalleryUrl"
:on-remove=
"handleRemove"
>
<el-upload
:action=
'uploadPath'
:headers=
"headers"
:limit=
'5'
multiple
accept=
".jpg,.jpeg,.png,.gif"
:file-list=
"galleryFileList"
list-type=
"picture-card"
:on-exceed=
'uploadOverrun'
:on-success=
"handleGalleryUrl"
:on-remove=
"handleRemove"
>
<i
class=
"el-icon-plus"
></i>
<i
class=
"el-icon-plus"
></i>
</el-upload>
</el-upload>
</el-form-item>
</el-form-item>
...
@@ -120,7 +120,7 @@
...
@@ -120,7 +120,7 @@
<el-input
v-model=
"specForm.value"
></el-input>
<el-input
v-model=
"specForm.value"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"规格图片"
prop=
"picUrl"
>
<el-form-item
label=
"规格图片"
prop=
"picUrl"
>
<el-upload
class=
"avatar-uploader"
:action=
'uploadPath'
list-type=
"picture-card"
:show-file-list=
"false"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadSpecPicUrl"
>
<el-upload
class=
"avatar-uploader"
:headers=
"headers"
:action=
'uploadPath'
list-type=
"picture-card"
:show-file-list=
"false"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadSpecPicUrl"
>
<img
v-if=
"specForm.picUrl"
:src=
"specForm.picUrl"
class=
"avatar"
>
<img
v-if=
"specForm.picUrl"
:src=
"specForm.picUrl"
class=
"avatar"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-upload>
...
@@ -173,7 +173,7 @@
...
@@ -173,7 +173,7 @@
<el-input
v-model=
"productForm.number"
></el-input>
<el-input
v-model=
"productForm.number"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"货品图片"
prop=
"url"
>
<el-form-item
label=
"货品图片"
prop=
"url"
>
<el-upload
class=
"avatar-uploader"
:action=
'uploadPath'
list-type=
"picture-card"
:show-file-list=
"false"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadProductUrl"
>
<el-upload
class=
"avatar-uploader"
:headers=
"headers"
:action=
'uploadPath'
list-type=
"picture-card"
:show-file-list=
"false"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadProductUrl"
>
<img
v-if=
"productForm.url"
:src=
"productForm.url"
class=
"avatar"
>
<img
v-if=
"productForm.url"
:src=
"productForm.url"
class=
"avatar"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-upload>
...
@@ -267,10 +267,18 @@ import { detailGoods, editGoods, listCatAndBrand } from '@/api/goods'
...
@@ -267,10 +267,18 @@ import { detailGoods, editGoods, listCatAndBrand } from '@/api/goods'
import
{
createStorage
,
uploadPath
}
from
'
@/api/storage
'
import
{
createStorage
,
uploadPath
}
from
'
@/api/storage
'
import
Editor
from
'
@tinymce/tinymce-vue
'
import
Editor
from
'
@tinymce/tinymce-vue
'
import
{
MessageBox
}
from
'
element-ui
'
import
{
MessageBox
}
from
'
element-ui
'
import
{
getToken
}
from
'
@/utils/auth
'
export
default
{
export
default
{
name
:
'
GoodsEdit
'
,
name
:
'
GoodsEdit
'
,
components
:
{
Editor
},
components
:
{
Editor
},
computed
:
{
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
},
data
()
{
data
()
{
return
{
return
{
uploadPath
,
uploadPath
,
...
...
litemall-admin/src/views/mall/brand.vue
View file @
9eaf2db3
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
<el-input
v-model=
"dataForm.desc"
></el-input>
<el-input
v-model=
"dataForm.desc"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"品牌商图片"
prop=
"picUrl"
>
<el-form-item
label=
"品牌商图片"
prop=
"picUrl"
>
<el-upload
class=
"avatar-uploader"
:action=
'uploadPath'
list-type=
"picture-card"
:show-file-list=
"false"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadPicUrl"
>
<el-upload
class=
"avatar-uploader"
:headers=
"headers"
:action=
'uploadPath'
list-type=
"picture-card"
:show-file-list=
"false"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadPicUrl"
>
<img
v-if=
"dataForm.picUrl"
:src=
"dataForm.picUrl"
class=
"avatar"
>
<img
v-if=
"dataForm.picUrl"
:src=
"dataForm.picUrl"
class=
"avatar"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-upload>
...
@@ -106,9 +106,17 @@
...
@@ -106,9 +106,17 @@
<
script
>
<
script
>
import
{
listBrand
,
createBrand
,
updateBrand
,
deleteBrand
}
from
'
@/api/brand
'
import
{
listBrand
,
createBrand
,
updateBrand
,
deleteBrand
}
from
'
@/api/brand
'
import
{
uploadPath
}
from
'
@/api/storage
'
import
{
uploadPath
}
from
'
@/api/storage
'
import
{
getToken
}
from
'
@/utils/auth
'
export
default
{
export
default
{
name
:
'
Brand
'
,
name
:
'
Brand
'
,
computed
:
{
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
},
data
()
{
data
()
{
return
{
return
{
uploadPath
,
uploadPath
,
...
...
litemall-admin/src/views/mall/category.vue
View file @
9eaf2db3
...
@@ -88,13 +88,13 @@
...
@@ -88,13 +88,13 @@
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"类目图标"
prop=
"iconUrl"
>
<el-form-item
label=
"类目图标"
prop=
"iconUrl"
>
<el-upload
class=
"avatar-uploader"
:action=
'uploadPath'
list-type=
"picture-card"
:show-file-list=
"false"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadIconUrl"
>
<el-upload
class=
"avatar-uploader"
:headers=
"headers"
:action=
'uploadPath'
list-type=
"picture-card"
:show-file-list=
"false"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadIconUrl"
>
<img
v-if=
"dataForm.iconUrl"
:src=
"dataForm.iconUrl"
class=
"avatar"
>
<img
v-if=
"dataForm.iconUrl"
:src=
"dataForm.iconUrl"
class=
"avatar"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-upload>
</el-form-item>
</el-form-item>
<el-form-item
label=
"类目图片"
prop=
"picUrl"
>
<el-form-item
label=
"类目图片"
prop=
"picUrl"
>
<el-upload
class=
"avatar-uploader"
:action=
'uploadPath'
list-type=
"picture-card"
:show-file-list=
"false"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadPicUrl"
>
<el-upload
class=
"avatar-uploader"
:headers=
"headers"
:action=
'uploadPath'
list-type=
"picture-card"
:show-file-list=
"false"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadPicUrl"
>
<img
v-if=
"dataForm.picUrl"
:src=
"dataForm.picUrl"
class=
"avatar"
>
<img
v-if=
"dataForm.picUrl"
:src=
"dataForm.picUrl"
class=
"avatar"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-upload>
...
@@ -142,9 +142,17 @@
...
@@ -142,9 +142,17 @@
<
script
>
<
script
>
import
{
listCategory
,
listCatL1
,
createCategory
,
updateCategory
,
deleteCategory
}
from
'
@/api/category
'
import
{
listCategory
,
listCatL1
,
createCategory
,
updateCategory
,
deleteCategory
}
from
'
@/api/category
'
import
{
uploadPath
}
from
'
@/api/storage
'
import
{
uploadPath
}
from
'
@/api/storage
'
import
{
getToken
}
from
'
@/utils/auth
'
export
default
{
export
default
{
name
:
'
Category
'
,
name
:
'
Category
'
,
computed
:
{
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
},
data
()
{
data
()
{
return
{
return
{
uploadPath
,
uploadPath
,
...
...
litemall-admin/src/views/promotion/ad.vue
View file @
9eaf2db3
...
@@ -68,7 +68,7 @@
...
@@ -68,7 +68,7 @@
<el-input
v-model=
"dataForm.content"
></el-input>
<el-input
v-model=
"dataForm.content"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"广告图片"
prop=
"url"
>
<el-form-item
label=
"广告图片"
prop=
"url"
>
<el-upload
class=
"avatar-uploader"
:action=
"uploadPath"
list-type=
"picture-card"
:show-file-list=
"false"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadUrl"
>
<el-upload
class=
"avatar-uploader"
:headers=
"headers"
:action=
"uploadPath"
list-type=
"picture-card"
:show-file-list=
"false"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadUrl"
>
<img
v-if=
"dataForm.url"
:src=
"dataForm.url"
class=
"avatar"
>
<img
v-if=
"dataForm.url"
:src=
"dataForm.url"
class=
"avatar"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-upload>
...
@@ -130,9 +130,17 @@
...
@@ -130,9 +130,17 @@
<
script
>
<
script
>
import
{
listAd
,
createAd
,
updateAd
,
deleteAd
}
from
'
@/api/ad
'
import
{
listAd
,
createAd
,
updateAd
,
deleteAd
}
from
'
@/api/ad
'
import
{
uploadPath
}
from
'
@/api/storage
'
import
{
uploadPath
}
from
'
@/api/storage
'
import
{
getToken
}
from
'
@/utils/auth
'
export
default
{
export
default
{
name
:
'
Ad
'
,
name
:
'
Ad
'
,
computed
:
{
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
},
data
()
{
data
()
{
return
{
return
{
uploadPath
,
uploadPath
,
...
...
litemall-admin/src/views/promotion/topic.vue
View file @
9eaf2db3
...
@@ -70,7 +70,7 @@
...
@@ -70,7 +70,7 @@
<el-input
v-model=
"dataForm.subtitle"
></el-input>
<el-input
v-model=
"dataForm.subtitle"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"专题图片"
prop=
"picUrl"
>
<el-form-item
label=
"专题图片"
prop=
"picUrl"
>
<el-upload
class=
"avatar-uploader"
:action=
"uploadPath"
list-type=
"picture-card"
:show-file-list=
"false"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadPicUrl"
>
<el-upload
class=
"avatar-uploader"
:headers=
"headers"
:action=
"uploadPath"
list-type=
"picture-card"
:show-file-list=
"false"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadPicUrl"
>
<img
v-if=
"dataForm.picUrl"
:src=
"dataForm.picUrl"
class=
"avatar"
>
<img
v-if=
"dataForm.picUrl"
:src=
"dataForm.picUrl"
class=
"avatar"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-upload>
...
@@ -129,10 +129,18 @@ import { listTopic, createTopic, updateTopic, deleteTopic } from '@/api/topic'
...
@@ -129,10 +129,18 @@ import { listTopic, createTopic, updateTopic, deleteTopic } from '@/api/topic'
import
{
createStorage
,
uploadPath
}
from
'
@/api/storage
'
import
{
createStorage
,
uploadPath
}
from
'
@/api/storage
'
import
BackToTop
from
'
@/components/BackToTop
'
import
BackToTop
from
'
@/components/BackToTop
'
import
Editor
from
'
@tinymce/tinymce-vue
'
import
Editor
from
'
@tinymce/tinymce-vue
'
import
{
getToken
}
from
'
@/utils/auth
'
export
default
{
export
default
{
name
:
'
Topic
'
,
name
:
'
Topic
'
,
components
:
{
BackToTop
,
Editor
},
components
:
{
BackToTop
,
Editor
},
computed
:
{
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
},
data
()
{
data
()
{
return
{
return
{
uploadPath
,
uploadPath
,
...
...
litemall-admin/src/views/sys/admin.vue
View file @
9eaf2db3
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
<el-input
type=
"password"
v-model=
"dataForm.checkPassword"
auto-complete=
"off"
></el-input>
<el-input
type=
"password"
v-model=
"dataForm.checkPassword"
auto-complete=
"off"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"管理员头像"
prop=
"avatar"
>
<el-form-item
label=
"管理员头像"
prop=
"avatar"
>
<el-upload
class=
"avatar-uploader"
:action=
"uploadPath"
list-type=
"picture-card"
:show-file-list=
"false"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadAvatar"
>
<el-upload
class=
"avatar-uploader"
:headers=
"headers"
:action=
"uploadPath"
list-type=
"picture-card"
:show-file-list=
"false"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadAvatar"
>
<img
v-if=
"dataForm.avatar"
:src=
"dataForm.avatar"
class=
"avatar"
>
<img
v-if=
"dataForm.avatar"
:src=
"dataForm.avatar"
class=
"avatar"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-upload>
...
@@ -97,9 +97,17 @@
...
@@ -97,9 +97,17 @@
<
script
>
<
script
>
import
{
listAdmin
,
createAdmin
,
updateAdmin
,
deleteAdmin
}
from
'
@/api/admin
'
import
{
listAdmin
,
createAdmin
,
updateAdmin
,
deleteAdmin
}
from
'
@/api/admin
'
import
{
uploadPath
}
from
'
@/api/storage
'
import
{
uploadPath
}
from
'
@/api/storage
'
import
{
getToken
}
from
'
@/utils/auth
'
export
default
{
export
default
{
name
:
'
Admin
'
,
name
:
'
Admin
'
,
computed
:
{
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
},
data
()
{
data
()
{
var
validatePass
=
(
rule
,
value
,
callback
)
=>
{
var
validatePass
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
===
''
)
{
if
(
value
===
''
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment