import request from '@/utils/request'
import qs from 'qs'
interface User {
mobile:string,
code:string
}
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export const login = (data: User) => {
// request.post('/v1_0/authorizations', data)
return request({
method: 'post',
url: '/v1_0/authorizations',
// headers: { 'content-type': 'application/x-www-form-urlencoded' }, // qs 自动转换为这个格式
// 1.data 是普通对象 那么就是 content-type 就是application/json
// 2.data 如果是qs qs.stringify(data) 转换那么自动设置 content-type为application/x-www-form-urlencoded
// 3. data 如果是formdata对象 则content-type 是multipart/form-data 也是自动的
data: qs.stringify(data)
})
}