本文主要和大家介紹了詳解vue-admin和後端(flask)分離結合的例子,小編覺得挺不錯的,現在分享給大家,也給大家做個參考。一起跟著小編過來看看吧,希望能幫助大家。
API匯總:
登入
var params = { username: this.ruleForm2.account, password: this.ruleForm2.checkPass }; export const requestLogin = params => { return axios({ method: 'POST', url: `${base}/login`, auth: params }) .then(res => res.data); }; return jsonify({'code': 200, 'msg': "登录成功", 'token': token.decode('ascii'), 'name': g.admin.name})
修改密碼
#
let params = Object.assign({}, this.setpwdForm); export const setpwd = params => { return axios.post(`${base}/setpwd`, params); }; return jsonify({'code': 200, 'msg': "密码修改成功"})
let params = { page: this.page, name: this.filters.name }; export const getUserListPage = params => { return axios.get(`${base}/users/listpage`, { params: params }); }; return jsonify({ 'code': 200, 'total': total, 'page_size': page_size, 'infos': [u.to_dict() for u in Infos] })
let params = { id: row.id }; export const removeUser = params => { return axios.get(`${base}/user/remove`, { params: params }); }; return jsonify({'code': 200, 'msg': "删除成功"})
let para = { ids: ids }; export const batchRemoveUser = params => { return axios.get(`${base}/user/bathremove`, { params: params }); }; return jsonify({'code': 200, 'msg': "删除成功"})
export const getdrawPieChart = () => { return axios.get(`${base}/getdrawPieChart`); }; return jsonify({'code': 200, 'profess_value': profess_value, 'grade_value': grade_value, 'grade_data': grade_data})
export const getdrawLineChart = () => { return axios.get(`${base}/getdrawLineChart`); }; return jsonify({'code': 200, 'value': data_value, 'total': total})
rrreee
以上是vue-admin和後端flask分離結合的詳細內容。更多資訊請關注PHP中文網其他相關文章!