Files
ClassContent/项目合集/电商App/shop_backend/config/index.js
2025-02-18 08:31:38 +08:00

49 lines
2.4 KiB
JavaScript

module.exports = {
mysql: {
connectionLimit : 100,
host: 'localhost',
user: 'root',
password: 'lb714500.',
database: 'shop',
insecureAuth: true
},
jwt: 'Pc!0YQPA$57iksjA',
rsa: {
private_key: '../config/private_key.pem',
public_key: '../config/public_key.pem'
},
filter: {
login: '/user/login',
add: '/user/add',
home: '/home/index',
// type: '/type/list',
// banner: '/home/banner',
// recommend: '/home/recommend'
},
sql: {
getUserAddress: 'SELECT user_address from `user` where user_id = ?',
updateUserMoney: 'UPDATE `user` SET user_money = ? WHERE user_id = ?',
userOrderTotalMoney: 'SELECT goods_totalprice from goods where goods_id = ?',
getUserMoney: 'SELECT user_money from `user` where user_id = ?',
buyOrder: 'UPDATE goods SET goods_status = ? WHERE goods_id = ?',
getStatusOrder: 'SELECT goods.*, wares.* FROM goods, wares WHERE goods.wares_id = wares.wares_id AND goods.user_id = ? AND goods.goods_status = ?',
getAllOrder: 'SELECT goods.*, wares.* FROM goods, wares WHERE goods.wares_id = wares.wares_id AND goods.user_id = ?',
addCarToOrder: 'INSERT INTO goods (user_id,wares_id,goods_num,goods_price,goods_totalprice) VALUES (?,?,?,?,?)',
updateCarNum: 'UPDATE car SET car_num = ? WHERE car_id = ?',
deleteCarShop: 'DELETE FROM car WHERE car_id = ?',
getCarList: 'SELECT car.user_id,car.car_id,car.car_num, wares.* FROM car ,wares WHERE car.wares_id = wares.wares_id AND car.user_id = ?',
selectCarShop: 'SELECT * from car where user_id = ? and wares_id = ?',
addCar: 'INSERT INTO car (user_id,wares_id,car_num) VALUES (?,?,?)',
getLikeList: 'SELECT collection.like_id, wares.* FROM collection ,wares WHERE collection.wares_id = wares.wares_id AND collection.user_id = ?',
selectLike: 'SELECT * from collection where wares_id = ? and user_id = ?',
likeShop: 'INSERT INTO collection (wares_id,user_id) VALUES (?, ?)',
getSearchShop: `SELECT * from wares where wares_title LIKE "%?%"`,
getTypeList: 'SELECT wares_title,wares_id,wares_masterimg from wares where wares_type = ?',
getActivity: 'SELECT * from wares where wares_activity = ?',
getInfo: 'SELECT * from wares where wares_id = ?',
getIndex: 'SELECT * from wares ORDER BY wares_id DESC LIMIT 20',
addUser: 'INSERT INTO `user` (user_name,user_pwd,user_phone,user_time) VALUES (?, ?, ?, ?)',
userLogin: 'SELECT * from user where user_name = ? and user_pwd = ?'
}
};