Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
K
kouling-admin
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
刘松
kouling-admin
Commits
a3fd00bb
Commit
a3fd00bb
authored
Dec 01, 2017
by
刘松
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update for kouling auto update
parent
1ae7fe7b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
5 deletions
+22
-5
app.bundle.js
app/built/app.bundle.js
+0
-0
taopage.jsx
app/jsx/setting/taopage.jsx
+1
-1
controller.js
lib/controller.js
+21
-4
No files found.
app/built/app.bundle.js
View file @
a3fd00bb
This source diff could not be displayed because it is too large. You can
view the blob
instead.
app/jsx/setting/taopage.jsx
View file @
a3fd00bb
...
@@ -169,7 +169,7 @@ class Agent extends React.Component{
...
@@ -169,7 +169,7 @@ class Agent extends React.Component{
{
getFieldDecorator
(
'name'
,
{
{
getFieldDecorator
(
'name'
,
{
rules
:
[{
required
:
true
,
message
:
'推广页名称不能为空'
}],
rules
:
[{
required
:
true
,
message
:
'推广页名称不能为空'
}],
})(
})(
<
Input
prefix=
{
<
span
style=
{
{
fontSize
:
13
}
}
>
推广名称
</
span
>
}
placeholder=
"例如:
推广
1"
/>
<
Input
prefix=
{
<
span
style=
{
{
fontSize
:
13
}
}
>
推广名称
</
span
>
}
placeholder=
"例如:
商品页
1"
/>
)
}
)
}
</
FormItem
>
</
FormItem
>
<
FormItem
>
<
FormItem
>
...
...
lib/controller.js
View file @
a3fd00bb
...
@@ -139,13 +139,27 @@ exports.createSchedule = async (req, res, next) => {
...
@@ -139,13 +139,27 @@ exports.createSchedule = async (req, res, next) => {
links
.
push
(
Link
.
findOne
({
name
:
item
}));
links
.
push
(
Link
.
findOne
({
name
:
item
}));
});
});
Promise
.
all
(
links
).
then
(
function
(
arr
){
Promise
.
all
(
links
).
then
(
function
(
arr
){
let
ids
=
arr
.
map
(
x
=>
x
.
toJSON
().
_id
);
arr
=
arr
.
map
(
x
=>
x
.
toJSON
());
//获取所有推广页id
ids
=
arr
.
map
(
x
=>
x
.
_id
);
if
(
agent
&&
ids
.
length
){
if
(
agent
&&
ids
.
length
){
let
qd
=
agent
.
toJSON
()[
'_id'
];
let
qd
=
agent
.
toJSON
()[
'_id'
];
let
links
=
ids
;
let
links
=
ids
;
let
tkl_Tasks
=
[];
tao
.
saveSchedule
({
qd
,
links
,
status
,
times
},
function
(
e
,
result
){
tao
.
saveSchedule
({
qd
,
links
,
status
,
times
},
function
(
e
,
result
){
if
(
e
)
throw
e
;
if
(
e
||
!
result
.
_id
)
throw
(
e
||
result
);
res
.
send
({
status
:
'ok'
,
result
:
result
});
var
schedule
=
result
.
_id
;
arr
.
forEach
(
async
item
=>
{
item
[
'link'
]
=
item
.
_id
;
item
[
'schedule'
]
=
schedule
;
for
(
let
i
=
0
;
i
<
5
;
i
++
){
tkl_Tasks
.
push
(
createTbkl
(
item
));
}
});
Promise
.
all
(
tkl_Tasks
).
then
(
function
(
arrs
){
console
.
dir
(
'----'
);
arrs
.
map
(
x
=>
x
.
toJSON
());
res
.
send
({
status
:
'ok'
,
result
:
result
,
kls
:
arrs
});
});
});
});
}
}
else
{
else
{
...
@@ -159,7 +173,8 @@ exports.createSchedule = async (req, res, next) => {
...
@@ -159,7 +173,8 @@ exports.createSchedule = async (req, res, next) => {
}
}
}
}
exports
.
createTbkl
=
async
(
data
)
=>
{
var
createTbkl
=
async
(
data
)
=>
{
console
.
dir
(
data
);
let
{
title
,
target
,
pic
}
=
data
;
let
{
title
,
target
,
pic
}
=
data
;
return
new
Promise
(
async
(
r
,
d
)
=>
{
return
new
Promise
(
async
(
r
,
d
)
=>
{
try
{
try
{
...
@@ -176,3 +191,4 @@ exports.createTbkl = async (data) => {
...
@@ -176,3 +191,4 @@ exports.createTbkl = async (data) => {
});
});
}
}
exports
.
createTbkl
=
createTbkl
;
\ No newline at end of file
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