var express = require('express');
var router = express.Router();
var path = require('path');
const {pica_db} = require('../src/connectionMysql');

/* GET home page. */
router.get('/', function(req, res, next) {
  pica_db.query('select *from pica.w_reward_pay_record  order by id desc', (err, result) => {
    console.log('err', err);
    console.log('result', result);
    if (result == null || result.length === 0) {
      return;
    }
    res.json({
      code: 200,
      message: "操作成功",
      data: result
    });
  });

  // res.sendFile(path.resolve(__dirname+'/../dist/index.html'))
});

module.exports = router;
