From 27d35a9f1355e4a56aa1e8c1aad9c7f58002ed50 Mon Sep 17 00:00:00 2001 From: 明梦爽 <2972214568@qq.com> Date: 星期三, 10 八月 2022 17:52:13 +0800 Subject: [PATCH] 修改login --- src/api/api.js | 102 +++++++++++++++++++++++++++++++++++++------------- 1 files changed, 75 insertions(+), 27 deletions(-) diff --git a/src/api/api.js b/src/api/api.js index ca3cec2..f9f48e3 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -1,6 +1,6 @@ -//鐢ㄤ簬鍐欐帴鍙� +// 鐢ㄤ簬鍐欐帴鍙� -import request from "../utils/request"; +import request from '../utils/request' // // 瀵艰埅鏍忓垪琛� // export const getNavList = data => { // return request({ @@ -9,57 +9,105 @@ // params:data, // }) // } -//鑾峰彇灏忔爣棰� +// 鑾峰彇灏忔爣棰� export const getMinTitle = data => { return request({ method: 'GET', - url: `/news_category/list/${data}`, + url: `/news_category/list/${data}` }) } -//鑾峰彇鏂伴椈鍒楄〃 +// 鑾峰彇鏂伴椈鍒楄〃 export const getNewsList = data => { return request({ method: 'POST', - url:'/news/list', - params:data, + url: '/news/list', + params: data }) } -//鑾峰彇鍙湁涓�绡囨柊闂� +// 鑾峰彇鍙湁涓�绡囨柊闂� export const getnew = data => { return request({ method: 'GET', - url:`/news/main/${data}` + url: `/news/main/${data}` }) } -//淇敼鏂伴椈 +// 淇敼鏂伴椈 export const update = data => { return request({ - method:'POST', - url:'/news/update', - params:data, + method: 'POST', + url: '/news/update', + params: data }) } -//鍒犻櫎鏂伴椈 +// 鍒犻櫎鏂伴椈 export const deleteNew = data => { return request({ - method:'POST', - url:'/news/delete', - params:data, + method: 'POST', + url: '/news/delete', + params: data }) } -//妯$硦鏌ヨ +// 妯$硦鏌ヨ export const fuzzy = data => { return request({ - method:'POST', - url:'/news/fuzzy', - params:data, + method: 'POST', + url: '/news/fuzzy', + params: data }) } -//娣诲姞鏂伴椈 -export const add = data => { +// 娣诲姞鏂伴椈 +export const add = (data, fd) => { return request({ - method:'POST', - url:'/news/add', - params:data + method: 'POST', + url: '/news/add', + params: data, + data: fd }) -} \ No newline at end of file +} +// 鐧诲綍 +export const login = data => { + return request({ + method: 'POST', + url: '/login', + params: data + }) +} +// 鑾峰彇鏅�氱鐞嗗憳鍒楄〃 +export const getmain = () => { + return request({ + method: 'GET', + url: '/admin/list' + }) +} +// 瓒呯淇敼鏅璐﹀彿瀵嗙爜 +export const editAccount = data => { + return request({ + method: 'POST', + url: '/admin/updatePassword', + params: data + }) +} +// 鍒犻櫎鏅�氱鐞嗗憳 +export const deleteAd = data => { + return request({ + method: 'POST', + url: '/admin/delete', + params: data + }) +} +// 娉ㄥ唽鏅�氱鐞嗗憳 +export const addAd = data => { + return request({ + method: 'POST', + url: '/admin/add', + params: data + }) +} +// 鏂囦欢涓婁紶 +export const fileUpload = fd => { + return request({ + method: 'POST', + url: '/uploading', + data: fd + }) +} -- Gitblit v1.8.0