import http from '@/utils/http';
import { encryptPwd } from '@/utils/transform';

export async function changeFundPwd(newPassword: string, password?: string) {
  const { ok, msg } = await http.post('/user/chFundPwd', {
    password: password && encryptPwd(password),
    newPassword: encryptPwd(newPassword),
  });
  if (ok) return;
  throw Error(msg);
}
