接口更改
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user