import request from "@/utils/httpRequest";
import { AUTH_PATH as prefix } from "../AppPath";
import { SYS_PATH as sysPrefix } from "../AppPath";

export default {
	getCode: function () {
		return request({
			url: prefix + "/user/getCode",
			method: "get",
		});
	},
	login: function (data) {
		return request({
			url: prefix + "/user/login",
			method: "post",
			data: data,
		});
	},
	logout: function () {
		return request({
			url: prefix + "/user/logout",
			method: "get",
		});
	},
	getLoginCodeNumber: function (userName) {
		return request({
			url: prefix + "/user/getLoginCodeNumber",
			method: "get",
			params: { userName: userName },
		})
	},
	getPhoneCode (loginForm) {
		return request({
			url: sysPrefix + '/sys/user/getPhoneCode',
			method: 'get',
			params: {mobile: loginForm},
		})
	},
	savePwd: function (loginForm) {
		return request({
			url:sysPrefix + "/sys/user/saveNewPassword",
			method:"get",
			params:{mobile:loginForm.phoneNumber,code:loginForm.phoneCode,newPassword: loginForm.newPassword},
		})
	},
};
