king
2019-09-13 207e7ed3d871717df4a02f9b27792850beebe779
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 获取主菜单数据
   */