/**
 * 登录接口
 */
import { request } from '../../utils/request'

/**
 * 账号密码登录
 * @returns 返回整个响应对象 { status, msg, success, data }
 */
export const loginByAccount = (username: string, password: string): Promise<any> => {
    return request({
        url: '/login',
        method: 'POST',
		header: {
		  isToken: false,
		  repeatSubmit: false
		},
        data: {
            username: username,
            password: password,
			code: 'app20251203'
        },
    })
}

export const getUserInfo = ():Promise<any> =>{
	return request({
		url: '/getInfo',
		method: 'GET'
	})
}

export const resetPassword = (username: string, password: string, newPassword: string): Promise<any> => {
    return request({
        url: '/initPassword',
        method: 'PUT',
		header: {
		  isToken: false,
		  repeatSubmit: false
		},
        data: {
			username: username,
            newPassword: newPassword,
            password: password
        },
    })
}
