Files
cunkebao_v3/Store_vue/api/modules/auth.js
2025-11-06 10:34:13 +08:00

33 lines
968 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { request, requestWithRetry } from '../config'
// 认证相关API
export const authApi = {
// 用户登录
// @param {string} account - 账号
// @param {string} password - 密码
// @param {string} deviceId - 设备ID仅APP端传递H5端为空字符串
login: (account, password, deviceId) => {
return request({
url: '/v1/auth/login',
method: 'POST',
data: {
account: account,
password: password,
typeId: 2, // 固定为2
deviceId: deviceId || '' // 设备ID仅APP端有值H5端为空字符串
}
})
},
// 免密登录
// @param {string} deviceId - 设备ID
noPasswordLogin: (deviceId) => {
return request({
url: '/v1/store/login',
method: 'GET',
data: {
deviceId: deviceId || ''
}
})
}
}