From 207e7ed3d871717df4a02f9b27792850beebe779 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 13 九月 2019 19:15:06 +0800 Subject: [PATCH] 2019-09-13 --- src/api/index.js | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 43 insertions(+), 2 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 113df60..10ba34c 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,6 +1,5 @@ import axios from 'axios' -// axios.defaults.baseURL = 'http://localhost:8888/dostar' axios.defaults.crossDomain = true axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8' axios.defaults.withCredentials = true @@ -9,7 +8,9 @@ config.url = config.url || '/dostar' config.method = 'post' config.data = config.data || {} - config.data.userid = 'U000001' + if (config.url !== '/login') { + config.data.userid = sessionStorage.getItem('UserID') || '' + } config.data = JSON.stringify(config.data) return config }, (error) => { @@ -30,6 +31,46 @@ axios.defaults.baseURL = 'http://127.0.0.1:8888' } } + + /** + * @description 鐧诲綍绯荤粺 + */ + loginsystem (username, password) { + return axios({ + url: '/login', + data: { + Username: username, + Password: password + } + }) + } + + /** + * @description 鐧诲嚭绯荤粺 + */ + logoutsystem () { + return axios({ + url: '/dostar', + data: { + func: 'logout' + } + }) + } + + /** + * @description 閲嶇疆瀵嗙爜 + */ + resetpassword (originpwd, newpwd) { + return axios({ + url: '/dostar', + data: { + func: 'ResetPassword', + OriginPwd: originpwd, + NewPwd: newpwd + } + }) + } + /** * @description 鑾峰彇涓昏彍鍗曟暟鎹� */ -- Gitblit v1.8.0