| | |
| | | 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 |
| | |
| | | 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) => { |
| | |
| | | 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 获取主菜单数据 |
| | | */ |