| 7 | res.return(s) |
| 8 | }, |
| 9 | async put(req, res) { |
| 10 | const cloud = new Cloud() |
| 11 | try { |
| 12 | let info = await cloud.login(req.body.refresh_token) |
| 13 | let userInfo = await cloud.getInfo() |
| 14 | Object.assign(info, userInfo.personal_space_info) |
| 15 | info.adminId = req.info.userInfo.id |
| 16 | info.createTime = new Date() |
| 17 | info.tip = req.body.tip |
| 18 | info.type = true |
| 19 | db('account').find({ id: info.id }).assign(info).write() |
| 20 | res.return('添加成功') |
| 21 | } catch (error) { |
| 22 | // console.log(error) |
| 23 | res.error(error) |
| 24 | } |
| 25 | }, |
| 26 | async post(req, res) { |
| 27 | let s = db('account').find({ adminId: req.info.userInfo.id, id: req.body.id }).value() |
| 28 | if (!s) { |