接口更改

This commit is contained in:
dzl
2025-10-10 17:30:49 +08:00
parent 83af2cefd6
commit 2aa0e9d884
10 changed files with 284 additions and 81 deletions

View File

@@ -1,7 +1,6 @@
//供应商接口
const express = require('express');
const {getDB} = require('../database');
const {auth, adminAuth} = require('../middleware/auth');
const router = express.Router();
const {SelectBuilder, InsertBuilder, UpdateBuilder} = require('../config/dbv2')
const bcrypt = require('bcryptjs');
@@ -20,7 +19,7 @@ const bcrypt = require('bcryptjs');
* phone 手机号
*
* */
router.post('/add', auth, adminAuth, async (req, res) => {
router.post('/add', async (req, res) => {
const db = getDB();
try {
const {
@@ -103,7 +102,7 @@ router.post('/add', auth, adminAuth, async (req, res) => {
* id 供应商id
* audit_status 审核状态 'pending','approved','rejected'
* */
router.put('/edit', auth, adminAuth, async (req, res) => {
router.put('/edit', async (req, res) => {
const db = getDB();
try {
const {
@@ -237,7 +236,7 @@ router.get('/list', async (req, res) => {
* 删除供应商
* id
* */
router.delete('/delete', auth, adminAuth, async (req, res) => {
router.delete('/delete', async (req, res) => {
const db = getDB();
try {
const {id} = req.query;