Commit da77cd5a authored by 刘松's avatar 刘松

update

parent c23a91d3
......@@ -52,5 +52,5 @@ app.use(routes);
app.listen(config.port);
console.log('server started on port ' + config.port);
cron.start();
//cron.start();
//cron_gather.start();
This diff is collapsed.
......@@ -17,7 +17,8 @@ class Main extends React.Component{
this.state = {
current: '0',
openKeys: [],
theme: 'dark'
theme: 'dark',
username:null
}
}
......@@ -34,6 +35,9 @@ class Main extends React.Component{
if(this.props.login && this.props.login.status == 'logout')
location.href = '/'
const { dispatch } = this.props;
if(document.cookie.match('username=[a-zA-Z0-9]+')[0] && document.cookie.match('username=[a-zA-Z0-9]+')[0].split('=')[1]){
this.setState({username:document.cookie.match('username=[a-zA-Z0-9]+')[0].split('=')[1]});
}
}
render(){
......@@ -58,6 +62,7 @@ class Main extends React.Component{
<Menu.Item key="2">推广页管理</Menu.Item>
<Menu.Item key="3">淘口令</Menu.Item>
<Menu.Item key="4">推广计划</Menu.Item>
<Menu.Item key="5" style ={{ float:'right'}}><Icon type="user" />{ this.state.username }</Menu.Item>
</Menu>
</Header>
<Content style={{ padding: '0 50px' }}>
......
......@@ -115,7 +115,7 @@ class DashBoard extends React.Component{
date:logs[i].date,
info:logs[i].key,
times:logs[i].times,
status:logs[i].status == 'disable' ? '已归档' :'--',
status:logs[i].status == 'disable' ? '已归档' :'正常',
schedule:(logs[i].schedule && logs[i].schedule['_id']) || '--',
qd:(logs[i].schedule && logs[i].schedule['qd'] && logs[i].schedule['qd']['user']) || '--',
update:logs[i].updatedAt
......
......@@ -2,7 +2,7 @@ module.exports = {
host: '0.0.0.0',
port: process.env.PORT ? process.env.PORT : 9401,
//mongo:'mongodb://user:password@10.11.3.100:1302/taoarticle',
mongo:'mongodb://127.0.0.1:27017/taoarticle',
mongo:'mongodb://user:password@10.11.3.100:1302/taoarticle',
taobao: {
host:"http://gw.api.taobao.com/router/rest",
appKey:"24594025",//"23580470",//"23390725",
......
......@@ -8,7 +8,7 @@ const schema = mongoose.Schema({
},
creater:{
type:ObjectId,
required: false,
required: true,
ref:'tao-agent'
},
schedule:{
......
......@@ -155,16 +155,16 @@ exports.createSchedule = async (req, res, next) => {
arr = arr.map(x => x.toJSON()); //获取所有推广页id
ids = arr.map(x => x._id);
if(agent && ids.length){
let qd = agent.toJSON()['_id'];
let links = ids;
let tkl_Tasks = [];
var qd = agent.toJSON()['_id'];
var links = ids;
var tkl_Tasks = [];
tao.saveSchedule({qd,links,status,times},function(e,result){
if(e || !result._id) throw (e || result);
var schedule = result._id;
arr.forEach(async item => {
item['link'] = item._id;
item['schedule'] = schedule;
item['qd'] = item.qd;
item['qd'] = qd;
for(let i = 0;i<5;i++){
tkl_Tasks.push(createTbkl(item));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment