import request from "../../common/request"
import { SYS_PATH as prefix } from "../AppPath";

export default {

	saveInfo: function (inputForm) {
		return request({
			url: prefix + "/sys/user/saveInfo",
			method: "post",
			header: { arrayFormat: "repeat" },
			data: inputForm,
		});
	},

	savePwd: function (inputForm) {
		return request({
			url: prefix + "/sys/user/savePwd",
			method: "put",
			params: inputForm,
		});
	},

	savePwdByPhone: function (inputForm) {
		return request({
			url: prefix + "/sys/user/savePwdByPhone",
			method: "post",
			params: inputForm,
		});
	},

	is:function() {
		return request({
			url: prefix + "/sys/user/isAdmin",
			method: "get",
		});
	},

	queryById: function (id) {
		return request({
			url: prefix + "/sys/user/queryById",
			method: "get",
			params: { id: id },
		});
	},

	getMenus: function () {
		return request({
			url: prefix + "/sys/user/getMenus",
			method: "get",
		});
	},

	info: function () {
		return request({
			url: prefix + "/sys/user/info",
			method: "get",
		});
	},

	list: function (params) {
		return request({
			url: prefix + "/sys/user/list",
			method: "get",
			params: params,
		});
	},

	treeData: function (params) {
		return request({
			url: prefix + "/sys/user/treeData",
			method: "get",
			params: params,
		});
	},
	treeDataRadio: function (params) {
		return request({
			url: prefix + "/sys/user/treeDataRadio",
			method: "get",
			params: params,
		});
	},
	updateEmail: function (params){
		return request({
			url: prefix + `/sys/user/updateEmailApp`,
			method: "post",
			params: params,
		});
	},
}
