NodeJs+VueJs全栈开发《全栈之巅》视频网站 - 源码
topfullstack / node-vue-moba Goto Github PK
View Code? Open in Web Editor NEWNode.js (Express.js) + Vue.js (Element UI) 全栈开发王者荣耀手机端官网和管理后台
License: MIT License
Node.js (Express.js) + Vue.js (Element UI) 全栈开发王者荣耀手机端官网和管理后台
License: MIT License
UP主,上传的图片,没有后缀,怎么解决?~~?
app.post('/admin/api/login', async (req, res) => {
const { username, password } = req.body
// 1.根据用户名找用户
const user = await AdminUser.findOne({ username }).select('+password')
assert(user, 422, '用户不存在')
// 2.校验密码
const isValid = require('bcrypt').compareSync(password, user.password)
assert(isValid, 422, '密码错误')
// 3.返回token
const token = jwt.sign({ id: user._id }, app.get('secret'))
res.send({ token })
})
此段代码 加上async抛异常就报错,去掉可以正常,但是用户查询还需要异步,不知道视频主是通过什么操作实现的功能。
后续还会更新吗?求更新
看了一下代码,好像没有写全局的异常捕获..
会这样吗
POST http://localhost:3000/admin/api/upload 500 (Internal Server Error)
upload @ element-ui.common.js?2ca7:29063
post @ element-ui.common.js?2ca7:29369
upload @ element-ui.common.js?2ca7:29297
eval @ element-ui.common.js?2ca7:29288
uploadFiles @ element-ui.common.js?2ca7:29286
handleChange @ element-ui.common.js?2ca7:29267
invokeWithErrorHandling @ vue.runtime.esm.js?0261:1854
invoker @ vue.runtime.esm.js?0261:2179
original._wrapper @ vue.runtime.esm.js?0261:6917
package.json不存在
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.