import {
  request
} from '@/utils/http'
// import upload from '@/utils/upload'
// 用户密码重置
export const updateUserPwd = async (data) => {
  // const data = {
  //   oldPassword,
  //   newPassword
  // }
  return await request.http({
    url: '/system/user/profile/updatePwd',
    isPost: '2',
    data: data
  })
}

// 查询用户个人信息
export const getUserProfile = async () => {

  return await request.http({
    url: '/system/user/profile',
    isPost: '1',
  })
}

// 修改用户个人信息

export const updateUserProfile = async (data) => {
  return await request.http({
    url: '/system/user/profile',
    isPost: '2',
    data: data
  })
}

// 用户头像上传
export function uploadAvatar(data) {
  return upload({
    url: '/system/user/profile/avatar',
    name: data.name,
    filePath: data.filePath
  })
}


/**
 * 根据参数键名查询参数值 获取app 文件
 *
 * @param {string} configKey 参数键名
 * @returns
 */
export const getConfigKey = async (configKey) => {
  return await request.http({
    url: "/system/config/configKey/" + configKey,
    isPost: '1',
  });
};
/**
 * 根据参数键名查询参数值 获取app 文件
 *
 * @param {string} configKey 参数键名
 * @returns
 */
export const getappConfigKey = async (appType) => {
  return await request.http({
    url: "/framework/app/last/" + appType,
    isPost: '1',
    // data: data
  });
};