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
Expand all
Hide 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;
public
class
LoginAdminHandlerMethodArgumentResolver
implements
HandlerMethodArgumentResolver
{
public
static
final
String
LOGIN_TOKEN_KEY
=
"
X
-Token"
;
public
static
final
String
LOGIN_TOKEN_KEY
=
"
Admin
-Token"
;
@Override
public
boolean
supportsParameter
(
MethodParameter
parameter
)
{
return
parameter
.
getParameterType
().
isAssignableFrom
(
Integer
.
class
)&&
parameter
.
hasParameterAnnotation
(
LoginAdmin
.
class
);
...
...
litemall-admin/config/dep.env.js
View file @
9eaf2db3
module
.
exports
=
{
NODE_ENV
:
'
"production"
'
,
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
>
<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"
>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em></div>
...
...
@@ -28,6 +28,11 @@ export default {
computed
:
{
imageUrl
()
{
return
this
.
value
},
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
},
data
()
{
...
...
litemall-admin/src/components/Upload/singleImage2.vue
View file @
9eaf2db3
<
template
>
<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"
>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
Drag或
<em>
点击上传
</em></div>
...
...
@@ -27,6 +27,11 @@ export default {
computed
:
{
imageUrl
()
{
return
this
.
value
},
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
},
data
()
{
...
...
litemall-admin/src/components/Upload/singleImage3.vue
View file @
9eaf2db3
<
template
>
<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"
>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em></div>
...
...
@@ -35,6 +35,11 @@ export default {
computed
:
{
imageUrl
()
{
return
this
.
value
},
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
},
data
()
{
...
...
litemall-admin/src/utils/request.js
View file @
9eaf2db3
...
...
@@ -13,7 +13,7 @@ const service = axios.create({
service
.
interceptors
.
request
.
use
(
config
=>
{
// Do something before request is sent
if
(
store
.
getters
.
token
)
{
config
.
headers
[
'
X
-Token
'
]
=
getToken
()
// 让每个请求携带token-- ['
X
-Token']为自定义key 请根据实际情况自行修改
config
.
headers
[
'
Admin
-Token
'
]
=
getToken
()
// 让每个请求携带token-- ['
Admin
-Token']为自定义key 请根据实际情况自行修改
}
return
config
},
error
=>
{
...
...
litemall-admin/src/views/goods/comment.vue
View file @
9eaf2db3
...
...
@@ -66,7 +66,7 @@
</el-form-item>
<el-form-item
label=
"评论图片"
prop=
"picUrls"
>
<!-- <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-upload>
</el-form-item>
...
...
@@ -98,9 +98,17 @@
<
script
>
import
{
listComment
,
createComment
,
updateComment
,
deleteComment
}
from
'
@/api/comment
'
import
{
createStorage
}
from
'
@/api/storage
'
import
{
getToken
}
from
'
@/utils/auth
'
export
default
{
name
:
'
Comment
'
,
computed
:
{
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
},
data
()
{
return
{
list
:
undefined
,
...
...
@@ -260,4 +268,4 @@ export default {
}
}
}
</
script
>
\ No newline at end of file
</
script
>
litemall-admin/src/views/goods/create.vue
View file @
9eaf2db3
This diff is collapsed.
Click to expand it.
litemall-admin/src/views/goods/edit.vue
View file @
9eaf2db3
...
...
@@ -9,7 +9,7 @@
</el-form-item>
<el-form-item
label=
"商品名称"
prop=
"name"
>
<el-input
v-model=
"goods.name"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"专柜价格"
prop=
"counterPrice"
>
<el-input
v-model=
"goods.counterPrice"
placeholder=
"0.00"
>
<template
slot=
"append"
>
元
</
template
>
...
...
@@ -19,7 +19,7 @@
<el-input
v-model=
"goods.retailPrice"
placeholder=
"0.00"
>
<
template
slot=
"append"
>
元
</
template
>
</el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"是否新品"
prop=
"isNew"
>
<el-radio-group
v-model=
"goods.isNew"
>
<el-radio
:label=
"true"
>
新品
</el-radio>
...
...
@@ -31,31 +31,31 @@
<el-radio
:label=
"false"
>
普通
</el-radio>
<el-radio
:label=
"true"
>
热卖
</el-radio>
</el-radio-group>
</el-form-item>
</el-form-item>
<el-form-item
label=
"是否在售"
prop=
"isOnSale"
>
<el-radio-group
v-model=
"goods.isOnSale"
>
<el-radio
:label=
"true"
>
在售
</el-radio>
<el-radio
:label=
"false"
>
未售
</el-radio>
</el-radio-group>
</el-form-item>
<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"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-form-item>
<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>
</el-upload>
</el-form-item>
</el-form-item>
<el-form-item
label=
"商品单位"
>
<el-input
v-model=
"goods.unit"
placeholder=
"件 / 个 / 盒"
></el-input>
</el-form-item>
<el-form-item
label=
"关键字"
>
<el-tag
:key=
"tag"
v-for=
"tag in keywords"
closable
type=
"primary"
@
close=
"handleClose(tag)"
>
{{tag}}
...
...
@@ -64,11 +64,11 @@
</el-input>
<el-button
v-else
class=
"button-new-keyword"
size=
"small"
type=
"primary"
@
click=
"showInput"
>
+ 增加
</el-button>
</el-form-item>
<el-form-item
label=
"所属分类"
>
<el-cascader
expand-trigger=
"hover"
:options=
"categoryList"
v-model=
"categoryIds"
@
change=
"handleCategoryChange"
></el-cascader>
</el-form-item>
<el-form-item
label=
"所属品牌商"
>
<el-select
v-model=
"goods.brandId"
>
<el-option
v-for=
"item in brandList"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
...
...
@@ -78,11 +78,11 @@
<el-form-item
label=
"商品简介"
>
<el-input
v-model=
"goods.brief"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"商品详细介绍"
>
<editor
:init=
"editorInit"
v-model=
"goods.detail"
></editor>
</el-form-item>
</el-form-item>
</el-form>
</el-card>
...
...
@@ -120,11 +120,11 @@
<el-input
v-model=
"specForm.value"
></el-input>
</el-form-item>
<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"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-form-item>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"specVisiable = false"
>
取消
</el-button>
...
...
@@ -132,7 +132,7 @@
</div>
</el-dialog>
</el-card>
<el-card
class=
"box-card"
>
<h3>
商品库存
</h3>
<el-table
:data=
"products"
>
...
...
@@ -173,11 +173,11 @@
<el-input
v-model=
"productForm.number"
></el-input>
</el-form-item>
<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"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-form-item>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"productVisiable = false"
>
取消
</el-button>
...
...
@@ -208,7 +208,7 @@
</el-form-item>
<el-form-item
label=
"商品参数值"
prop=
"value"
>
<el-input
v-model=
"attributeForm.value"
></el-input>
</el-form-item>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"attributeVisiable = false"
>
取消
</el-button>
...
...
@@ -267,10 +267,18 @@ import { detailGoods, editGoods, listCatAndBrand } from '@/api/goods'
import
{
createStorage
,
uploadPath
}
from
'
@/api/storage
'
import
Editor
from
'
@tinymce/tinymce-vue
'
import
{
MessageBox
}
from
'
element-ui
'
import
{
getToken
}
from
'
@/utils/auth
'
export
default
{
name
:
'
GoodsEdit
'
,
components
:
{
Editor
},
computed
:
{
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
},
data
()
{
return
{
uploadPath
,
...
...
@@ -551,4 +559,4 @@ export default {
}
}
}
</
script
>
\ No newline at end of file
</
script
>
litemall-admin/src/views/mall/brand.vue
View file @
9eaf2db3
...
...
@@ -31,7 +31,7 @@
</el-table-column>
<el-table-column
align=
"center"
label=
"底价"
prop=
"floorPrice"
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"操作"
width=
"200"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
...
...
@@ -58,11 +58,11 @@
<el-input
v-model=
"dataForm.desc"
></el-input>
</el-form-item>
<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"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-form-item>
</el-form-item>
<el-form-item
label=
"底价"
prop=
"floorPrice"
>
<el-input
v-model=
"dataForm.floorPrice"
></el-input>
</el-form-item>
...
...
@@ -106,9 +106,17 @@
<
script
>
import
{
listBrand
,
createBrand
,
updateBrand
,
deleteBrand
}
from
'
@/api/brand
'
import
{
uploadPath
}
from
'
@/api/storage
'
import
{
getToken
}
from
'
@/utils/auth
'
export
default
{
name
:
'
Brand
'
,
computed
:
{
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
},
data
()
{
return
{
uploadPath
,
...
...
litemall-admin/src/views/mall/category.vue
View file @
9eaf2db3
...
...
@@ -35,7 +35,7 @@
<el-table-column
align=
"center"
label=
"关键字"
prop=
"keyword"
>
</el-table-column>
<el-table-column
align=
"center"
min-width=
"100"
label=
"简介"
prop=
"desc"
>
</el-table-column>
...
...
@@ -44,10 +44,10 @@
<
template
slot-scope=
"scope"
>
<el-tag
:type=
"scope.row.level === 'L1' ? 'primary' : 'info' "
>
{{
scope
.
row
.
level
===
'
L1
'
?
'
一级类目
'
:
'
二级类目
'
}}
</el-tag>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"父类目ID"
prop=
"pid"
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"操作"
width=
"200"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
...
...
@@ -88,20 +88,20 @@
</el-select>
</el-form-item>
<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"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-form-item>
<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"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-form-item>
</el-form-item>
<el-form-item
label=
"类目简介"
prop=
"desc"
>
<el-input
v-model=
"dataForm.desc"
></el-input>
</el-form-item>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogFormVisible = false"
>
取消
</el-button>
...
...
@@ -142,9 +142,17 @@
<
script
>
import
{
listCategory
,
listCatL1
,
createCategory
,
updateCategory
,
deleteCategory
}
from
'
@/api/category
'
import
{
uploadPath
}
from
'
@/api/storage
'
import
{
getToken
}
from
'
@/utils/auth
'
export
default
{
name
:
'
Category
'
,
computed
:
{
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
},
data
()
{
return
{
uploadPath
,
...
...
litemall-admin/src/views/promotion/ad.vue
View file @
9eaf2db3
...
...
@@ -68,7 +68,7 @@
<el-input
v-model=
"dataForm.content"
></el-input>
</el-form-item>
<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"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
...
...
@@ -78,7 +78,7 @@
<el-option
label=
"首页"
:value=
"1"
>
</el-option>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"活动链接"
prop=
"link"
>
<el-input
v-model=
"dataForm.link"
></el-input>
</el-form-item>
...
...
@@ -130,9 +130,17 @@
<
script
>
import
{
listAd
,
createAd
,
updateAd
,
deleteAd
}
from
'
@/api/ad
'
import
{
uploadPath
}
from
'
@/api/storage
'
import
{
getToken
}
from
'
@/utils/auth
'
export
default
{
name
:
'
Ad
'
,
computed
:
{
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
},
data
()
{
return
{
uploadPath
,
...
...
@@ -289,4 +297,4 @@ export default {
}
}
}
</
script
>
\ No newline at end of file
</
script
>
litemall-admin/src/views/promotion/topic.vue
View file @
9eaf2db3
...
...
@@ -59,7 +59,7 @@
<el-tooltip
placement=
"top"
content=
"返回顶部"
>
<back-to-top
:visibilityHeight=
"100"
></back-to-top>
</el-tooltip>
<!-- 添加或修改对话框 -->
<el-dialog
:title=
"textMap[dialogStatus]"
:visible.sync=
"dialogFormVisible"
>
<el-form
:rules=
"rules"
ref=
"dataForm"
:model=
"dataForm"
status-icon
label-position=
"left"
label-width=
"100px"
style=
'width: 400px; margin-left:50px;'
>
...
...
@@ -70,14 +70,14 @@
<el-input
v-model=
"dataForm.subtitle"
></el-input>
</el-form-item>
<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"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-form-item>
<el-form-item
style=
"width: 700px;"
label=
"专题内容"
>
<editor
:init=
"editorInit"
v-model=
"dataForm.content"
></editor>
</el-form-item>
</el-form-item>
<el-form-item
label=
"商品低价"
prop=
"price"
>
<el-input
v-model=
"dataForm.price"
></el-input>
</el-form-item>
...
...
@@ -129,10 +129,18 @@ import { listTopic, createTopic, updateTopic, deleteTopic } from '@/api/topic'
import
{
createStorage
,
uploadPath
}
from
'
@/api/storage
'
import
BackToTop
from
'
@/components/BackToTop
'
import
Editor
from
'
@tinymce/tinymce-vue
'
import
{
getToken
}
from
'
@/utils/auth
'
export
default
{
name
:
'
Topic
'
,
components
:
{
BackToTop
,
Editor
},
computed
:
{
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
},
data
()
{
return
{
uploadPath
,
...
...
@@ -311,4 +319,4 @@ export default {
}
}
}
</
script
>
\ No newline at end of file
</
script
>
litemall-admin/src/views/sys/admin.vue
View file @
9eaf2db3
...
...
@@ -22,7 +22,7 @@
<template
slot-scope=
"scope"
>
<img
:src=
"scope.row.avatar"
width=
"40"
v-if=
"scope.row.avatar"
/>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"操作"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
...
...
@@ -50,9 +50,9 @@
</el-form-item>
<el-form-item
label=
"确认密码"
prop=
"checkPassword"
>
<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-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"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
...
...
@@ -97,9 +97,17 @@
<
script
>
import
{
listAdmin
,
createAdmin
,
updateAdmin
,
deleteAdmin
}
from
'
@/api/admin
'
import
{
uploadPath
}
from
'
@/api/storage
'
import
{
getToken
}
from
'
@/utils/auth
'
export
default
{
name
:
'
Admin
'
,
computed
:
{
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
},
data
()
{
var
validatePass
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
===
''
)
{
...
...
@@ -276,4 +284,4 @@ export default {
}
}
}
</
script
>
\ No newline at end of file
</
script
>
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