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
30f66f17
Commit
30f66f17
authored
Dec 05, 2018
by
Davve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改错误
parent
192ec841
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
7 deletions
+31
-7
pick.py
api/pick.py
+3
-2
urls.py
api/urls.py
+1
-0
user.py
api/user.py
+19
-0
user.js
vu/src/api/user.js
+1
-1
PushDetail.vue
vu/src/views/push/components/PushDetail.vue
+0
-1
UserDetail.vue
vu/src/views/user/components/UserDetail.vue
+1
-0
list.vue
vu/src/views/user/list.vue
+6
-3
No files found.
api/pick.py
View file @
30f66f17
...
@@ -55,7 +55,7 @@ class UpdateOrCreateView(APIView):
...
@@ -55,7 +55,7 @@ class UpdateOrCreateView(APIView):
id
=
request
.
POST
.
get
(
'id'
,
''
)
id
=
request
.
POST
.
get
(
'id'
,
''
)
pick_group_ids
=
list
(
set
(
map
(
lambda
x
:
x
.
split
(
":"
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'pick_group'
,
'[]'
)))))
pick_group_ids
=
list
(
set
(
map
(
lambda
x
:
x
.
split
(
":"
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'pick_group'
,
'[]'
)))))
city_ids
=
list
(
set
(
map
(
lambda
x
:
x
.
split
(
":"
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'city'
,
'[]'
)))))
city_ids
=
list
(
set
(
map
(
lambda
x
:
x
.
split
(
":"
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'city'
,
'[]'
)))))
position
=
request
.
POST
.
get
(
'position'
)
gender
=
request
.
POST
.
get
(
'gender'
)
gender
=
request
.
POST
.
get
(
'gender'
)
pick_type
=
request
.
POST
.
get
(
'pick_type'
)
pick_type
=
request
.
POST
.
get
(
'pick_type'
)
...
@@ -83,9 +83,10 @@ class UpdateOrCreateView(APIView):
...
@@ -83,9 +83,10 @@ class UpdateOrCreateView(APIView):
'region'
:
city_ids
,
'region'
:
city_ids
,
'pick_type'
:
data_dict
[
'pick_type'
]
if
id
else
pick_type
,
'pick_type'
:
data_dict
[
'pick_type'
]
if
id
else
pick_type
,
'pick_group'
:
pick_group_ids
,
'pick_group'
:
pick_group_ids
,
'position'
:
request
.
POST
.
get
(
'position'
),
'is_online'
:
int
(
request
.
POST
.
get
(
'is_online'
)),
'is_online'
:
int
(
request
.
POST
.
get
(
'is_online'
)),
}
}
if
position
:
data
.
update
({
"position"
:
position
})
try
:
try
:
self
.
rpc
[
'venus/sun/pick/edit'
](
id
=
id
,
data
=
data
)
.
unwrap
()
self
.
rpc
[
'venus/sun/pick/edit'
](
id
=
id
,
data
=
data
)
.
unwrap
()
except
Exception
as
e
:
except
Exception
as
e
:
...
...
api/urls.py
View file @
30f66f17
...
@@ -31,6 +31,7 @@ urlpatterns = [
...
@@ -31,6 +31,7 @@ urlpatterns = [
url
(
r'^account/create$'
,
AccountUpdateOrCreateView
.
as_view
()),
url
(
r'^account/create$'
,
AccountUpdateOrCreateView
.
as_view
()),
# user相关
# user相关
url
(
r'^user/list$'
,
UserListView
.
as_view
()),
url
(
r'^user/list$'
,
UserListView
.
as_view
()),
url
(
r'^user/list/update$'
,
UserListView
.
as_view
()),
url
(
r'^user/get$'
,
UserUpdateOrCreate
.
as_view
()),
url
(
r'^user/get$'
,
UserUpdateOrCreate
.
as_view
()),
url
(
r'^user/create$'
,
UserUpdateOrCreate
.
as_view
()),
url
(
r'^user/create$'
,
UserUpdateOrCreate
.
as_view
()),
url
(
r'^user/group/list$'
,
UserGroupView
.
as_view
()),
url
(
r'^user/group/list$'
,
UserGroupView
.
as_view
()),
...
...
api/user.py
View file @
30f66f17
...
@@ -25,6 +25,25 @@ class UserListView(APIView):
...
@@ -25,6 +25,25 @@ class UserListView(APIView):
raise
raise
return
data
return
data
def
post
(
self
,
request
):
ids
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
))
type
=
request
.
POST
.
get
(
'type'
,
''
)
updates
=
{}
if
type
==
'recommend'
:
updates
[
'is_recommend'
]
=
1
else
:
pass
try
:
self
.
rpc
[
'venus/sun/user/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'批量更新user列表失败
%
s'
,
e
)
raise
return
{
"message"
:
"更新成功"
}
class
UserUpdateOrCreate
(
APIView
):
class
UserUpdateOrCreate
(
APIView
):
def
get
(
self
,
request
):
def
get
(
self
,
request
):
...
...
vu/src/api/user.js
View file @
30f66f17
...
@@ -11,7 +11,7 @@ export function fetchList(query) {
...
@@ -11,7 +11,7 @@ export function fetchList(query) {
export
function
OffLineOrOnLine
(
data
)
{
export
function
OffLineOrOnLine
(
data
)
{
return
request
({
return
request
({
url
:
'/api/user/
update_or_cre
ate'
,
url
:
'/api/user/
list/upd
ate'
,
method
:
'post'
,
method
:
'post'
,
data
data
})
})
...
...
vu/src/views/push/components/PushDetail.vue
View file @
30f66f17
...
@@ -185,7 +185,6 @@ export default {
...
@@ -185,7 +185,6 @@ export default {
fetchData
(
id
)
{
fetchData
(
id
)
{
fetchPushDetail
(
id
).
then
(
response
=>
{
fetchPushDetail
(
id
).
then
(
response
=>
{
this
.
postForm
=
response
.
data
.
data
.
data
this
.
postForm
=
response
.
data
.
data
.
data
console
.
log
(
response
.
data
.
data
.
data
.
url_prefix
,
'-----'
,
urlTypeKeyValue
[
response
.
data
.
data
.
data
.
url_prefix
])
this
.
postForm
.
url
=
urlTypeKeyValue
[
response
.
data
.
data
.
data
.
url_prefix
]
this
.
postForm
.
url
=
urlTypeKeyValue
[
response
.
data
.
data
.
data
.
url_prefix
]
this
.
is_effect
=
Boolean
(
response
.
data
.
data
.
data
.
is_effect
)
this
.
is_effect
=
Boolean
(
response
.
data
.
data
.
data
.
is_effect
)
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
...
...
vu/src/views/user/components/UserDetail.vue
View file @
30f66f17
...
@@ -200,6 +200,7 @@
...
@@ -200,6 +200,7 @@
rules
:
{
rules
:
{
nick_name
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}],
nick_name
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}],
avatar
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}],
avatar
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}],
avatar
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}],
},
},
tempRoute
:
{},
tempRoute
:
{},
GenderTypeOptions
:
[
GenderTypeOptions
:
[
...
...
vu/src/views/user/list.vue
View file @
30f66f17
...
@@ -204,7 +204,7 @@
...
@@ -204,7 +204,7 @@
},
},
handleOfflineOrOnline
(
val
)
{
handleOfflineOrOnline
(
val
)
{
const
length
=
this
.
multipleSelection
.
length
;
const
length
=
this
.
multipleSelection
.
length
;
let
str
=
''
;
var
ids
=
[]
;
this
.
del_list
=
this
.
del_list
.
concat
(
this
.
multipleSelection
);
this
.
del_list
=
this
.
del_list
.
concat
(
this
.
multipleSelection
);
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
if
(
val
===
'offline'
)
{
if
(
val
===
'offline'
)
{
...
@@ -214,11 +214,14 @@
...
@@ -214,11 +214,14 @@
}
else
{
}
else
{
this
.
multipleSelection
[
i
].
is_online
=
1
this
.
multipleSelection
[
i
].
is_online
=
1
}
}
str
+=
this
.
multipleSelection
[
i
].
id
+
' '
;
ids
.
push
(
this
.
multipleSelection
[
i
].
user_id
)
}
}
OffLineOrOnLine
({
type
:
val
,
ids
:
str
}).
then
(
response
=>
{
OffLineOrOnLine
({
type
:
val
,
ids
:
JSON
.
stringify
(
ids
)
}).
then
(
response
=>
{
this
.
multipleSelection
=
[];
this
.
multipleSelection
=
[];
this
.
$message
.
success
(
response
.
data
.
data
.
message
);
this
.
$message
.
success
(
response
.
data
.
data
.
message
);
setTimeout
(()
=>
{
this
.
$router
.
go
(
0
)
},
1500
)
})
})
},
},
handleFilter
()
{
handleFilter
()
{
...
...
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