Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
sun
Commits
cf403500
Commit
cf403500
authored
Dec 03, 2018
by
Davve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改视频获取
parent
369f9aee
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
30 deletions
+36
-30
user.py
api/user.py
+2
-2
user.js
vu/src/store/modules/user.js
+0
-1
AccountDetail.vue
vu/src/views/account/components/AccountDetail.vue
+10
-13
PickDetail.vue
vu/src/views/pick/components/PickDetail.vue
+1
-1
UserDetail.vue
vu/src/views/user/components/UserDetail.vue
+23
-13
No files found.
api/user.py
View file @
cf403500
...
...
@@ -44,11 +44,11 @@ class UserUpdateOrCreate(APIView):
data
=
{
'user_id'
:
user_id
,
'password'
:
password
,
'is_recommend'
:
request
.
POST
.
get
(
'is_recommend'
),
'is_recommend'
:
int
(
request
.
POST
.
get
(
'is_recommend'
)
),
'profile_pic'
:
request
.
POST
.
get
(
'avatar'
)[:
-
2
],
'nick_name'
:
request
.
POST
.
get
(
'nick_name'
),
'tag_ids'
:
tag_ids
,
'is_puppet'
:
request
.
POST
.
get
(
'is_puppet'
),
'is_puppet'
:
int
(
request
.
POST
.
get
(
'is_puppet'
)
),
'city_id'
:
request
.
POST
.
get
(
'city'
,
''
)
.
split
(
":"
)[
0
],
'phone'
:
request
.
POST
.
get
(
'phone'
),
'email'
:
request
.
POST
.
get
(
'email'
),
...
...
vu/src/store/modules/user.js
View file @
cf403500
...
...
@@ -65,7 +65,6 @@ const user = {
setSession
(
data
.
session_key
)
resolve
()
}
else
{
console
.
log
(
data
,
'-----------'
)
Message
.
error
(
data
[
'message'
])
resolve
(
'/login'
)
}
...
...
vu/src/views/account/components/AccountDetail.vue
View file @
cf403500
...
...
@@ -10,7 +10,7 @@
<el-row>
<el-col
:span=
"24"
>
<el-form-item
style=
"margin-bottom: 40px;"
prop=
"username"
v-if=
"is
Edit
"
>
<el-form-item
style=
"margin-bottom: 40px;"
prop=
"username"
v-if=
"is
Show
"
>
<MDinput
v-model=
"postForm.username"
:maxlength=
"100"
name=
"username"
required
disabled=
"disabled"
>
账号
</MDinput>
...
...
@@ -27,13 +27,7 @@
<el-row>
<el-col
:span=
"24"
>
<el-form-item
style=
"margin-bottom: 40px;"
prop=
"password"
v-if=
"isEdit"
>
<MDinput
v-model=
"postForm.password"
:maxlength=
"100"
name=
"password"
required
disabled=
"disabled"
>
密码
</MDinput>
</el-form-item>
<el-form-item
style=
"margin-bottom: 40px;"
prop=
"password"
v-else
>
<el-form-item
style=
"margin-bottom: 40px;"
prop=
"password"
v-show=
"is_show"
>
<MDinput
v-model=
"postForm.password"
:maxlength=
"100"
name=
"password"
required
>
密码
</MDinput>
...
...
@@ -108,6 +102,7 @@
},
data
()
{
const
validateRequire
=
(
rule
,
value
,
callback
)
=>
{
value
=
value
.
trim
()
if
(
value
===
''
)
{
this
.
$message
({
message
:
rule
.
field
+
'为必传项'
,
...
...
@@ -120,6 +115,7 @@
}
const
validatePasswordLength
=
(
rule
,
value
,
callback
)
=>
{
value
=
value
.
trim
()
if
(
value
===
''
)
{
this
.
$message
({
message
:
rule
.
field
+
'为必传项'
,
...
...
@@ -141,12 +137,13 @@
loading
:
false
,
userListOptions
:
[],
rules
:
{
username
:
[{
validator
:
validateRequire
}],
nick_name
:
[{
validator
:
validateRequire
}],
email
:
[{
validator
:
validateRequire
}],
username
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}],
nick_name
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}],
email
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}],
password
:
[{
validator
:
validatePasswordLength
,
trigger
:
'blur'
}],
phone
:
[{
validator
:
validateRequire
}],
phone
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}],
},
is_show
:
true
}
},
created
()
{
...
...
@@ -163,7 +160,7 @@
fetchData
(
id
)
{
fetchAccountDetail
(
id
).
then
(
response
=>
{
this
.
postForm
=
response
.
data
.
data
.
data
this
.
is_show
=
false
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
...
...
vu/src/views/pick/components/PickDetail.vue
View file @
cf403500
...
...
@@ -126,7 +126,7 @@
placeholder=
"请输入内容"
/>
<span
v-show=
"contentShortLength"
class=
"word-counter"
>
{{
contentShortLength
}}
字
</span>
</el-form-item>
<el-form-item
style=
"margin-bottom: 40px;"
label-width=
"45px"
label=
"
下
线:"
>
<el-form-item
style=
"margin-bottom: 40px;"
label-width=
"45px"
label=
"
是否在
线:"
>
<el-radio-group
v-model=
"postForm.is_online"
>
<el-radio
:label=
"1"
>
是
</el-radio>
<el-radio
:label=
"0"
>
否
</el-radio>
...
...
vu/src/views/user/components/UserDetail.vue
View file @
cf403500
...
...
@@ -3,7 +3,7 @@
<el-form
ref=
"postForm"
:model=
"postForm"
:rules=
"rules"
class=
"form-container"
>
<sticky
:class-name=
"'sub-navbar '+postForm.status"
>
<el-button
v-loading=
"loading"
style=
"margin-left: 10px;"
type=
"success"
@
click=
"submitForm"
>
保存
<el-button
v-loading=
"loading"
style=
"margin-left: 10px;"
type=
"success"
@
click=
"submitForm"
:disabled=
"isdisabledFn"
>
保存
</el-button>
</sticky>
...
...
@@ -31,11 +31,11 @@
</el-col>
</el-row>
<el-row>
<
el-col
:span=
"12"
>
<
el-form-item
style=
"margin-bottom: 20px;"
label-width=
"75px"
label=
"密码:"
v-if=
"isEdit"
>
<
el-input
v-model=
"postForm.password"
type=
"text"
style=
"width: 230px;"
disabled
/
>
<
/el-form-item
>
<
/el-col
>
<
!--
<el-col
:span=
"12"
>
--
>
<
!--
<el-form-item
style=
"margin-bottom: 20px;"
label-width=
"75px"
label=
"密码:"
v-if=
"isEdit"
>
--
>
<
!--
<el-input
v-model=
"postForm.password"
type=
"text"
style=
"width: 230px;"
disabled
/>
--
>
<
!--
</el-form-item>
--
>
<
!--
</el-col>
--
>
<el-col
:span=
"12"
>
<el-form-item
style=
"margin-bottom: 20px;"
label-width=
"75px"
label=
"帖子:"
v-if=
"isEdit"
>
<el-input
v-model=
"postForm.topic_nums"
type=
"text"
style=
"width: 230px;"
...
...
@@ -45,7 +45,7 @@
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
style=
"margin-bottom: 20px;"
label-width=
"75px"
label=
"用户名:"
prop=
"
user
name"
>
<el-form-item
style=
"margin-bottom: 20px;"
label-width=
"75px"
label=
"用户名:"
prop=
"
nick_
name"
>
<el-input
v-model=
"postForm.nick_name"
type=
"text"
style=
"width: 230px"
/>
</el-form-item>
</el-col>
...
...
@@ -70,7 +70,7 @@
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label-width=
"75px"
label=
"性别:"
>
<el-form-item
label-width=
"75px"
label=
"性别:"
prop=
"gender"
>
<el-select
v-model=
"postForm.gender"
:placeholder=
"'性别:'"
clearable
class=
"postInfo-container-item"
style=
"width: 230px"
>
...
...
@@ -95,7 +95,7 @@
<el-form-item
label-width=
"75px"
label=
"标签:"
>
<el-select
v-model=
"tags"
:remote-method=
"getRemoteTagList"
filterable
remote
clearable
multiple
value-key=
"id"
placeholder=
"搜索
地区
"
style=
"width: 720px"
>
placeholder=
"搜索
标签
"
style=
"width: 720px"
>
<el-option
v-for=
"(item,index) in tagListOptions"
:key=
"item+index"
:label=
"item"
:value=
"item"
/>
</el-select>
...
...
@@ -196,9 +196,8 @@
tags
:
[],
rules
:
{
image_uri
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}],
title
:
[{
validator
:
validateRequire
}],
content
:
[{
validator
:
validateRequire
}],
nick_name
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}],
avatar
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}],
},
tempRoute
:
{},
GenderTypeOptions
:
[
...
...
@@ -208,6 +207,7 @@
regionListOptions
:
[],
tagListOptions
:
[],
uploadType
:
99
,
isdisabledFn
:
false
}
},
computed
:
{
...
...
@@ -243,7 +243,17 @@
this
.
$refs
.
postForm
.
validate
(
valid
=>
{
if
(
valid
)
{
this
.
loading
=
true
if
(
this
.
city
===
''
){
this
.
$message
.
error
(
'城市必填~'
)
this
.
loading
=
false
return
false
}
if
(
this
.
postForm
.
gender
===
''
){
this
.
$message
.
error
(
'性别必填~'
)
this
.
loading
=
false
return
false
}
this
.
isdisabledFn
=
true
this
.
postForm
.
city
=
this
.
city
;
this
.
postForm
.
tags
=
JSON
.
stringify
(
this
.
tags
)
userCreate
(
this
.
postForm
).
then
(
response
=>
{
...
...
Write
Preview
Markdown
is supported
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