|
@@ -161,9 +161,12 @@ router.post('/words', ctx => {
|
|
|
ctx.body = body
|
|
|
})
|
|
|
router.get('/reviews', ctx => {
|
|
|
- console.log(ctx.url)
|
|
|
const buf = fs.readFileSync(reviewDataPath)
|
|
|
- const list = buf.toString().split(',')
|
|
|
+ const text = buf.toString()
|
|
|
+ let list = []
|
|
|
+ if (text) {
|
|
|
+ list = text.split(',')
|
|
|
+ }
|
|
|
ctx.body = { success: true, list }
|
|
|
})
|
|
|
router.post('/reviews', ctx => {
|