import { axios } from '@archser/layout-ui'
const SERVICE_URL = '/aserver'

/**
 * LiuKexin 20210311 根据用户名获取设置首页
 * @param {*} params 
 * @returns 
 */
 export const getSystemUrl = params => {
  return axios.request({
    url: SERVICE_URL + '/getSystemUrl',
    data: params,
    method: 'post'
  })
}

/**
 * LiuKexin 20210311 根据用户名获取设置首页
 * @param {*} params 
 * @returns 
 */
export const getUserHome = params => {
  return axios.request({
    url: SERVICE_URL + '/getUserHome',
    data: params,
    method: 'post'
  })
}

//修改密码
export const update = (username, newPwd) => {
  return axios.request({
    url: SERVICE_URL + '/updatePassword',
    data: {
      username,
      newPwd
    },
    method: 'post'
  })
}

/**
* @description: 验证密码强度
* @Author: ChengYaqing
* @Date: 2020-10-30 10:30:45
*/
export const verifyPassword = params => {
  return axios.request({
    url: SERVICE_URL + '/verifyPassword',
    data: params,
    method: 'post'
  })
}

/**
 * 检查SN
 */
export const snVerify = () => {
  return axios.request({
    url: SERVICE_URL + '/sn/snVerify',
    method: 'post'
  })
}

/**
 * 注册SN
 * @param {*} params 
 */
export const registered = params => {
  return axios.request({
    url: SERVICE_URL + '/sn/registered',
    data: params,
    method: 'post'
  })
}



export const ruleValidate = {
  organName: [
    { required: true, message: '机构名不能为空', trigger: 'blur' }
  ],
  uniqueCode: [
    { required: true, message: '注册码不能为空', trigger: 'blur' },
  ]
}