aliyunSMSCode.js 352 B

12345678910111213141516
  1. const express = require('express')
  2. const router = express.Router()
  3. router.post('/', async (req, res) => {
  4. if (req.body.code == req.session.code) {
  5. res.status(201).send({
  6. code: 'ok'
  7. })
  8. } else {
  9. res.status(202).send({
  10. err: '验证码错误'
  11. })
  12. }
  13. })
  14. module.exports = router