基于Nodejs+vue开发实现酒店管理系统

简介: 基于Nodejs+vue开发实现酒店管理系统

项目编号:BS-QD-KS-002

一,项目简介


本项目使用纯前端技术开发实现一个酒店管理系统,前端采用VUE开发实现,后台通过NODEJS作为服务器开发实现,主要实现了酒店管理系统中的:房型管理、房间管理、顾客管理、订单管理等,用户可以注册并登陆后进行相应的管理操作。主要说明


前后端分离技术

前端使用vuejs,ElementUI,axios前后端通信,图标使用了ElementUI自带的图标还有font-awesome.css的图标库, 阿里的iconfont图标库也不错,这里没用。

后端使用了nodejs,nodejs采用了Express框架,orm采用的是Sequelize操作数据库(效率极高),restful风格的Api, 跨域是由后端解决的,采用的是nodejs的cors模块(比较方便)。

数据库采用了mysql5.2(建议大家换成最新的mysql版本)

使用jsonwebtoken验证用户调用api的权限,增加接口的安全性,防止恶意攻击接口,串改数据。

主要界面里面的图片主要使用的是网上的图片,免费而且美观。

二,环境介绍


语言环境:nodejs

数据库: mysql5.7

应用服务器:nodejs

开发工具:IDEA或vscode

开发技术:nodejs+vue+elementUI

三,系统展示


用户注册

image.png

用户登陆

image.png

房间管理

image.png

image.png

房型管理

image.png

image.png

订单管理

image.png

image.png

订单管理

image.png

image.png

四,核心代码展示


1.
const { Op } = require('sequelize')//nodejs的sequelize模块
const express = require('express')//express框架
const admin = require('../crud/table/admin.js')//引入管理员信息表
const token = require('../comment/token.js')//引入token模块
const adminRouter = express.Router()//express路由
adminRouter.post('/register',(req,res) =>{//管理员注册
    const { adminId, adminName, adminPassword } = req.body;
    admin.findOne({
        where:{
            adminId:adminId
        }
    })
    .then(data =>{
        if(data){
            res.status(200).json({
                msg:'该用户已经注册',
                success:false
            })
            return new Promise(() =>{})
        }else{
            return admin.create({
                adminId, adminName, adminPassword
            })
        }
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'管理员注册成功!',
            admin:data.get()
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'内部服务器错误!'
        })
    })
})
adminRouter.get('/login',(req,res) =>{//登录
    const { adminId, adminPassword } = req.query;
    let adminInfo;
    admin.findOne({
        where:{
            adminId
        }
    })
    .then(data =>{
        if(data){
            if(data.get().adminPassword==adminPassword){
                adminInfo = data.get();
                return token.setToken(data.get())
            }else{
                res.status(200).json({
                    success:false,
                    msg:'用户密码错误!'
                });  
                return new Promise(() =>{})
            }
        }else{
           res.status(200).json({
               success:false,
               msg:'该用户还未注册!'
           })
           return new Promise(() =>{})
        }
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            admin:adminInfo,
            token:data,
            msg:'登录成功!'
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'内部服务器出错!'
        })
    })
})
adminRouter.put('/update',(req,res) =>{//修改管理员信息
    const { adminId, adminName, adminPassword, adminSex, adminAge } = req.body;
    admin.findOne({
        where:{
            adminId,adminPassword
        }
    })
    .then(data =>{
        if(data){
           return admin.update({
                    adminName,adminSex,adminAge
                },{
                    where:{
                        adminId,adminPassword
                    }
                })
        }else{
            res.status(200).json({
                success:false,
                msg:'管理员账号或者密码错误!'
            })
            return new Promise(() =>{})
        }
    })
    .then(data =>{
        return admin.findOne({
            where:{
                adminId,adminPassword
            }
        })
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'管理员信息修改成功!',
            admin:data.get()
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})
adminRouter.delete('/del',(req,res) =>{
    const { adminId } = req.body || req.query;
    admin.destroy({
        where:{
            adminId
        }
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'删除成功!'
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'删除失败!'
        })
    })
})
module.exports = adminRouter;

const { Op } = require('sequelize')//nodejs的sequelize模块
const express = require('express')//express框架
const customer = require('../crud/table/customer.js')//引入用户表
const customerRouter = express.Router()//express路由
customerRouter.post('/add',(req,res) =>{//用户注册
    const { customerIdCard, customerName, customerSex, customerPhoneNumber } = req.body;
    customer.findOne({
        where:{
            customerIdCard
        }
    })
    .then(data =>{
        if(data){
            res.status(200).json({
                success:false,
                msg:'该用户已经注册!'
            })
            return new Promise(() =>{})
        }else{
            return customer.create({
                customerIdCard, customerName, customerSex, customerPhoneNumber
            })
        }
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'用户信息录入成功!',
            customer:data.get()
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'内部服务器错误!'
        })
    })
})
// customerRouter.get('/login',(req,res) =>{//用户登录
//     const { customerIdCard, cust}
// })
customerRouter.put('/update',(req,res) =>{//用户基本信息修改
    const { customerIdCard, customerName, customerSex, customerPhoneNumber } = req.body;
    customer.findOne({
        where:{
            customerIdCard:{
                [Op.eq]:customerIdCard
            }
        }
    })
    .then(data =>{
        if(data){
            return customer.update({
                customerName, customerSex, customerPhoneNumber
            },{
               where:{
                    customerIdCard:{
                        [Op.eq]:customerIdCard
                    }
               }
            })
        }else{
            res.status(200).json({
                success:false,
                msg:'该用户还未注册!'
            })
            return new Promise(() =>{})
        }
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'用户信息修改成功!',
            customer:data.get()
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器出错!'
        })
    }) 
}) 
customerRouter.delete('/del',(req,res) =>{//删除用户
    const { customerIdCard } = req.body;
    customer.destroy({
        where:{
            customerIdCard
        }
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'用户删除成功!'
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})
customerRouter.put('/updatevip',(req,res) =>{//购买会员
    const { customerIdCard, level } = req.body;
    customer.findOne({
        where:{
            customerIdCard
        }
    })
    .then(data =>{
        if(data){
            return customer.update({
                level
            },{
                where:{
                    customerIdCard
                }
            })
        }else{
            res.status(200).json({
                success:false,
                msg:'该用户未注册!'
            })
            return new Promise(() =>{})
        }
    })
    .then(data =>{
        return customer.findOne({
            where:{
                customerIdCard
            }
        })
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'vip更改成功!',
            customer:data.get()
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})
customerRouter.put('/updatemoney',(req,res) =>{//修改用户总消费金额
    const { customerIdCard, money} = req.body;
    customer.findOne({
        where:{
            customerIdCard
        }
    })
    .then(data =>{
        if(data){
            let oldMoney = data.get().totalAmount;
            let newMoney = oldMoney + money;
            return customer.update({
                totalAmount: newMoney
            },{
                where:{
                    customerIdCard
                }
            })
        }else{
            res.status(200).json({
                success:false,
                msg:'该用户为注册!'
            })
        }
    })
    .then(data =>{
        return customer.findOne({
            where:{
                customerIdCard
            }
        })
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'用户消费金额修改成功!'
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})
customerRouter.get('/getAllCustomer',(req,res) =>{//查询所有顾客
    customer.findAndCountAll()
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'顾客信息查询成功!',
            customerList:data.rows.map(item =>{
                return item.get()
            }),
            count:data.count
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器出错!'
        })
    })
})
customerRouter.get('/queryCustomer',(req,res) =>{//模糊查询顾客信息
    const { queryName } = req.query;
    customer.findAndCountAll({
        where:{
            customerName:{
                [Op.like]:'%'+queryName+'%'
            }
        }
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'顾客信息查询成功!',
            customerList:data.rows.map(item =>{
                return item.get()
            }),
            count:data.count
        })
    })
    .then(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器出错!'
        })
    })
})
module.exports = customerRouter;
const express = require('express')//express框架
const { Op } = require('sequelize')//nodejs的sequelize模块
const order = require('../crud/table/myorder.js')//引入订单信息表
const customer = require('../crud/table/customer.js')//引入顾客信息表
const room = require('../crud/table/room.js')//引入房间信息表
order.hasOne(customer,{ sourceKey:'customerIdCard', foreignKey:'customerIdCard' })
order.hasOne(room,{ sourceKey:'roomNumber', foreignKey:'roomNumber' })
const orderRouter = express.Router()
orderRouter.post('/add',(req,res) =>{//创建订单
    console.log(req.body)
    const { orderNumber, orderStatus,customerIdCard,roomNumber,
            checkInTime,checkOutTime,totalMoney,remarks
        } = req.body;
    order.findOne({
        where:{
            orderNumber
        }
    })
    .then(data =>{
        if(data){
            res.status(200).json({
                success:false,
                msg:'该订单已经存在!'
            })
            return new Promise(() =>{})
        }else{
            return customer.findOne({
                where:{
                    customerIdCard
                }
            })
        }
    })
    .then(data =>{
        if(data){
            return room.update({
                    roomStatus:'已入住'
            },{
                where:{
                        roomNumber
                }
            })
        }else{
            res.status(200).json({
                success:false,
                msg:'该用户还未注册!'
            });
            return new Promise(() =>{});
        }
    })
    .then(data =>{
        return order.create({
            orderNumber, orderStatus,customerIdCard,roomNumber,
            checkInTime,checkOutTime,totalMoney,remarks
        })
    })
    .then(data =>{
        res.status(200).json({
            success:'true',
            msg:'订单创建成功!'
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'内部服务器出错!'
        })
    })
})
orderRouter.delete('/del',(req,res) =>{//删除订单
    const { orderNumber } = req.body;
    order.findOne({
        where:{
            orderNumber
        }
    })
    .then(data =>{
        if(data){
            return order.destroy({
                where:{
                    orderNumber
                }
            })
        }else{
            res.status(200).json({
                success:false,
                msg:'该订单不存在!'
            })
            return new Promise(() =>{})
        }
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'删除成功!'
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})
orderRouter.put('/update',(req,res) =>{//修改订单状态
    const { orderStatus, orderNumber,totalMoney,roomNumber } = req.body;
    order.findOne({
        where:{
            orderNumber
        }
    })
    .then(data =>{
        if(data){
            return room.update({
                roomStatus:'未入住'
            },{
                where:{
                    roomNumber
                }
            })
        }else{
            res.status(200).json({
                success:false,
                msg:'该订单不存在!'                
            })
            return new Promise(() =>{})
        }
    })
    .then(data =>{
        return order.update({
            orderStatus,totalMoney
        },{
            where:{
                orderNumber
            }
        })
    })
    .then(data =>{
        return order.findOne({
            where:{
                orderNumber
            }
        })
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'订单修改成功!',
            order:data.get()
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})
orderRouter.get('/getAllOrder',(req,res) =>{//查询所有订单
    const { pageSize, offset } = req.query;
    order.findAndCountAll({
        limit:pageSize,
        offset:offset,
        include:[
            {
                model:customer,
                foreignKey:'customerIdCard',
                attributes:['customerName','customerSex','customerVipLevel','customerPhoneNumber','totalAmount']
            },
            {
                model:room,
                foreignKey:'roomNumber',
                attributes:['type','remarks']
            }
        ]
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'所有订单查询成功!',
            orderList:data.rows.map(item =>{
                return item.get()
            }),
            count:data.count
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})
orderRouter.get('/getAllNotPayOrder',(req,res) =>{//查询所有未支付的订单
    const { pageSize, offset } = req.query;
    order.findAndCountAll({
        limit:pageSize,
        offset:offset,
        where:{
            orderStatus:{
                [Op.eq]:'未支付'
            }
        },
        include:[
            {
                model:customer,
                foreignKey:'customerIdCard',
                attributes:['customerName','customerSex','customerVipLevel','customerPhoneNumber','totalAmount']
            },
            {
                model:room,
                foreignKey:'roomNumber',
                attributes:['type']
            }
        ]
    })
    .then(data  =>{
        res.status(200).json({
            success:true,
            msg:'未支付订单查询成功!',
            orderList:data.rows.map(item =>{
                return item.get()
            }),
            count:data.count,
            pageSize:pageSize,
            offset:offset
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})
orderRouter.get('/getAllPayOrder',(req,res) =>{//查询所有已支付的订单
    const { pageSize, offset } = req.query;
    order.findAndCountAll({
        limit:pageSize,
        offset:offset,
        where:{
            orderStatus:{
                [Op.eq]:'已支付'
            }
        },
        include:[
            {
                model:customer,
                foreignKey:'customerIdCard',
                attributes:['customerName','customerSex','customerVipLevel','customerPhoneNumber','totalAmount']
            },
            {
                model:room,
                foreignKey:'roomNumber',
                attributes:['type']
            }
        ]
    })
    .then(data  =>{
        res.status(200).json({
            success:true,
            msg:'未支付订单查询成功!',
            orderList:data.rows.map(item =>{
                return item.get()
            }),
            count:data.count,
            pageSize:pageSize,
            offset:offset
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})
orderRouter.get('/getStatusOrder',(req,res) =>{//查询所有该状态的订单
    const { pageSize, offset, orderStatus } = req.query;
    order.findAndCountAll({
        limit:pageSize,
        offset:offset,
        where:{
            orderStatus:{
                [Op.eq]:orderStatus
            }
        },
        include:[
            {
                model:customer,
                foreignKey:'customerIdCard',
                attributes:['customerName','customerSex','customerVipLevel','customerPhoneNumber','totalAmount']
            },
            {
                model:room,
                foreignKey:'roomNumber',
                attributes:['type']
            }
        ]
    })
    .then(data  =>{
        res.status(200).json({
            success:true,
            msg:'状态订单查询成功!',
            orderList:data.rows.map(item =>{
                return item.get()
            }),
            count:data.count,
            pageSize:pageSize,
            offset:offset
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})
module.exports = orderRouter;
const express = require('express')//express框架
const { Op } = require('sequelize')//nodejs的sequelize模块
const room = require('../crud/table/room.js')//引入放假信息表
const roomType = require('../crud/table/roomType.js')//引入所有房间类型表
room.hasOne(roomType,{ sourceKey:'type',foreignKey:'type'})//每个房间都有一个房间类型
const roomRouter = express.Router()
roomRouter.post('/add',(req,res) =>{//添加房间
    const { roomNumber, type, roomStatus, remarks } = req.body;
    room.findOne({
        where:{
            roomNumber
        }
    })
    .then(data =>{
        if(data){
            res.status(200).json({
                success:false,
                msg:'该房间已经存在!'
            })
            return new Promise(() =>{})
        }else{
            return room.create({
                roomNumber, type, roomStatus, remarks
            })
        }
    })
    .then(data =>{
        return room.findOne({
            where:{
                roomNumber
            },
            include:[{
                model:roomType,
                foreignKey:'type',
                attributes:['price','url']
            }]
        })
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'房间添加成功!',
            room:data.get()
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})
roomRouter.delete('/del',(req,res) =>{
    const { roomNumber } = req.body;
    room.findOne({
        where:{
            roomNumber
        }
    })
    .then(data =>{
        if(data){
            return room.destroy({
                where:{
                    roomNumber
                }
            })
        }else{
            res.status(200).json({
                success:false,
                msg:'房间删除失败!'
            })
            return new Promise(() =>{})
        }
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'该房间删除成功!'
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})
roomRouter.put('/update',(req,res) =>{//修改房间信息
    const { roomNumber, type, roomStatus,remarks } = req.body;
    room.findOne({
        where:{
            roomNumber
        }
    })
    .then(data =>{
        if(data){
            return room.update({
                type, roomStatus,remarks
            },{
                where:{
                    roomNumber
                }
            })
        }else{
            res.status(200).json({
                success:false,
                msg:'该房间不存在!'
            })
            return new Promise(() =>{})
        }
    })
    .then(data =>{
        return room.findOne({
            where:{
                roomNumber
            }
        })
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'房间信息修改成功!',
            room:data.get()
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误'
        })
    })
})
roomRouter.get('/getAllRoom',(req,res) =>{//获取所有房间信息
    const { pageSize, offset } = req.query;
    room.findAndCountAll({
        limit:pageSize,
        offset:offset
    })
    .then(data =>{
        let roomList = data.rows.map(item =>{
            return item.get()
        })
        res.status(200).json({
            success:true,
            msg:'房间信息查询成功!',
            roomList:roomList,
            count:data.count
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})
roomRouter.get('/getOneRoom',(req,res) =>{//获取某个房间号的房间信息
    const { roomNumber } = req.query;
    room.findOne({
        where:{
            roomNumber
        }
    })
    .then(data =>{
        if(data){
            res.status(200).json({
                success:true,
                msg:'房间查询成功!',
                room:data.get()
            })
        }else{
            res.status(200).json({
                success:false,
                msg:'未查询到该房间信息'
            })
        }
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})
roomRouter.get('/getNotInRoom',(req,res) =>{//获取未入住房间信息
    const { pageSize, offset } = req.query;
    room.findAndCountAll({
        limit:pageSize,
        offset:offset,
        where:{
            roomStatus:{
                [Op.eq]:'未入住'
            }
        }
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'未入住房间查询成功!',
            roomList:data.rows.map(item =>{
                return item.get()
            }),
            count:data.count
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})
roomRouter.get('/getInRoom',(req,res) =>{//查询已入住房间信息
    const { pageSize, offset } = req.query;
    room.findAndCountAll({
        limit:pageSize,
        offset:offset,
        where:{
            roomStatus:{
                [Op.eq]:'已入住'
            }
        }
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'已入住房间查询成功!',
            roomList:data.rows.map(item =>{
                return item.get()
            }),
            count:data.count
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})
roomRouter.get('/getAllRoomPrice',(req,res) =>{//查询所有的房间以及价格
    const { pageSize, offset } = req.query;
    room.findAndCountAll({
        limit:pageSize,
        offset:offset,
        include:[{
            model:roomType,
            foreignKey:'type',
            attributes:['price','url']
        }]
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'房间信息查询成功!',
            roomList:data.rows.map(item =>{
                return item.get()
            }),
            count:data.count
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})
roomRouter.get('/getAllNotINRoomPrice',(req,res) =>{//获取所有未入住的房间信息
    const { pageSize, offset } = req.query;
    room.findAndCountAll({
        limit:pageSize,
        offset:offset,
        where:{
            roomStatus:{
                [Op.eq]:'未入住'
            }
        },
        include:[{
            model:roomType,
            foreignKey:'type',
            attributes:['price','url']
        }]
    })
    .then(data =>{
       res.status(200).json({
           success:true,
           msg:'房间信息查询成功!',
           roomList:data.rows.map(item =>{
               return item.get()
           }),
           count:data.count
       })
    })
})
roomRouter.get('/getAllINRoomPrice',(req,res) =>{//获取所有已入住的房间信息
    const { pageSize, offset } = req.query;
    room.findAndCountAll({
        limit:pageSize,
        offset:offset,
        where:{
            roomStatus:{
                [Op.eq]:'已入住'
            }
        },
        include:[{
            model:roomType,
            foreignKey:'type',
            attributes:['price','url']
        }]
    })
    .then(data =>{
       res.status(200).json({
           success:true,
           msg:'房间信息查询成功!',
           roomList:data.rows.map(item =>{
               return item.get()
           }),
           count:data.count
       })
    })
})
roomRouter.get('/getAllRoomTypePrice',(req,res) =>{
    const { pageSize, offset, type } = req.query;
    room.findAndCountAll({
        where:{
           type:{
               [Op.eq]:type
           }
        },
        include:[{
            model:roomType,
            foreignKey:'type',
            attributes:['price','url']
        }]
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'房型查询成功!',
            roomList:data.rows.map(item =>{
                return item.get()
            }),
            count:data.count
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器出错!'
        })
    })
})
roomRouter.get('/getAllStatusRoom',(req,res) =>{//获取所有该状态的房间信息
    const { pageSize, offset, roomStatus } = req.query;
    room.findAndCountAll({
        limit:pageSize,
        offset:offset,
        where:{
            roomStatus:{
                [Op.eq]:roomStatus
            }
        },
        include:[{
            model:roomType,
            foreignKey:'type',
            attributes:['price','url']
        }]
    })
    .then(data =>{
       res.status(200).json({
           success:true,
           msg:'房间信息查询成功!',
           roomList:data.rows.map(item =>{
               return item.get()
           }),
           count:data.count
       })
    })
})
module.exports = roomRouter

五,项目总结


相关文章
|
3月前
|
JavaScript Linux 内存技术
Debian 11系统下Node.js版本更新方法详解
本指南详细介绍在Linux系统中安装和管理Node.js的步骤。首先检查现有环境,包括查看当前版本和清除旧版本;接着通过NodeSource仓库安装最新版Node.js并验证安装结果。推荐使用nvm(Node Version Manager)进行多版本管理,便于切换和设置默认版本。同时,提供常见问题解决方法,如权限错误处理和全局模块迁移方案,以及版本回滚操作,确保用户能够灵活应对不同需求。
265 0
|
3月前
|
JavaScript Linux 内存技术
Debian 11系统下Node.js版本更新方法
Debian 11更新Node.js主要就是这三种方式,无论你是初涉其中的新手还是找寻挑战的专家,总有一种方式能满足你的需求。现在,你已经是这个
296 80
|
6月前
|
JSON 自然语言处理 前端开发
【01】对APP进行语言包功能开发-APP自动识别地区ip后分配对应的语言功能复杂吗?-成熟app项目语言包功能定制开发-前端以uniapp-基于vue.js后端以laravel基于php为例项目实战-优雅草卓伊凡
【01】对APP进行语言包功能开发-APP自动识别地区ip后分配对应的语言功能复杂吗?-成熟app项目语言包功能定制开发-前端以uniapp-基于vue.js后端以laravel基于php为例项目实战-优雅草卓伊凡
276 72
【01】对APP进行语言包功能开发-APP自动识别地区ip后分配对应的语言功能复杂吗?-成熟app项目语言包功能定制开发-前端以uniapp-基于vue.js后端以laravel基于php为例项目实战-优雅草卓伊凡
|
4月前
|
人工智能 监控 JavaScript
HarmonyOS5云服务技术分享--ArkTS开发Node环境
本文详细讲解了在HarmonyOS(ArkTS API 9及以上)中使用云函数的开发技巧,结合Node.js和HTTP触发器,从零开始手把手教学。内容涵盖核心能力、开发流程(配置到部署)、高阶优化及常见问题解决,并提供实际应用场景示例。助你快速掌握Serverless开发,提升效率,探索跨端协作与AI集成等未来方向。
|
7月前
|
JavaScript 前端开发 数据可视化
【01】Cocos游戏开发引擎从0开发一款游戏-cocos环境搭建以及配置-Cocos Creator软件系统下载安装-node环境-优雅草卓伊凡
【01】Cocos游戏开发引擎从0开发一款游戏-cocos环境搭建以及配置-Cocos Creator软件系统下载安装-node环境-优雅草卓伊凡
409 2
【01】Cocos游戏开发引擎从0开发一款游戏-cocos环境搭建以及配置-Cocos Creator软件系统下载安装-node环境-优雅草卓伊凡
|
7月前
|
数据采集 JavaScript Android开发
【02】仿站技术之python技术,看完学会再也不用去购买收费工具了-本次找了小影-感觉页面很好看-本次是爬取vue需要用到Puppeteer库用node.js扒一个app下载落地页-包括安卓android下载(简单)-ios苹果plist下载(稍微麻烦一丢丢)-优雅草卓伊凡
【02】仿站技术之python技术,看完学会再也不用去购买收费工具了-本次找了小影-感觉页面很好看-本次是爬取vue需要用到Puppeteer库用node.js扒一个app下载落地页-包括安卓android下载(简单)-ios苹果plist下载(稍微麻烦一丢丢)-优雅草卓伊凡
221 7
【02】仿站技术之python技术,看完学会再也不用去购买收费工具了-本次找了小影-感觉页面很好看-本次是爬取vue需要用到Puppeteer库用node.js扒一个app下载落地页-包括安卓android下载(简单)-ios苹果plist下载(稍微麻烦一丢丢)-优雅草卓伊凡
|
8月前
|
JavaScript 前端开发 jenkins
抛弃node和vscode,如何用记事本开发出一个完整的vue前端项目
本文探讨了在不依赖Node和VSCode的情况下,仅使用记事本和浏览器开发一个完整的Vue3前端项目的方法。通过CDN引入Vue、Vue Router、Element-UI等库,直接编写HTML文件实现页面功能,展示了前端开发的本质是生成HTML。虽然日常开发离不开现代工具,但掌握这种基础方法有助于快速实现想法或应对特殊环境限制。文章还介绍了如何用Node简单部署HTML文件到服务器,提供了一种高效、轻量的开发思路。
165 10
|
3月前
|
人工智能 JavaScript 算法
Vue 中 key 属性的深入解析:改变 key 导致组件销毁与重建
Vue 中 key 属性的深入解析:改变 key 导致组件销毁与重建
500 0
|
3月前
|
JavaScript UED
用组件懒加载优化Vue应用性能
用组件懒加载优化Vue应用性能
|
4月前
|
JavaScript 数据可视化 前端开发
基于 Vue 与 D3 的可拖拽拓扑图技术方案及应用案例解析
本文介绍了基于Vue和D3实现可拖拽拓扑图的技术方案与应用实例。通过Vue构建用户界面和交互逻辑,结合D3强大的数据可视化能力,实现了力导向布局、节点拖拽、交互事件等功能。文章详细讲解了数据模型设计、拖拽功能实现、组件封装及高级扩展(如节点类型定制、连接样式优化等),并提供了性能优化方案以应对大数据量场景。最终,展示了基础网络拓扑、实时更新拓扑等应用实例,为开发者提供了一套完整的实现思路和实践经验。
506 77