account-security-gateway.js 708 B

12345678910111213141516171819202122
  1. import { post } from '@/core/http/http-client'
  2. import { buildRestPath } from '@/core/config/api-paths'
  3. import { normalizeRegion } from '@/features/passport/credential-bridge'
  4. const ROUTE_DELETE_ACCOUNT = buildRestPath('user/deleteuser')
  5. const ROUTE_RESET_SECRET = '/wanlshop/user/resetpwd'
  6. /** 注销当前登录账号 */
  7. export async function removeAccount() {
  8. return post(ROUTE_DELETE_ACCOUNT, {})
  9. }
  10. /** 短信验证码重置登录密码 */
  11. export async function resetSecretBySms({ handset, region, passcode, secret, ticketId }) {
  12. return post(ROUTE_RESET_SECRET, {
  13. mobile: handset,
  14. area_code: normalizeRegion(region),
  15. captcha: passcode,
  16. newpassword: secret,
  17. message_id: ticketId || ''
  18. })
  19. }