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

export default {
	saveCertList (inputForm) {
		return request({
			url: prefix + `/sys/user/saveCertList`,
			method: 'post',
			headers: {arrayFormat: 'repeat'},
			data: inputForm
		})
	},
	save: function (inputForm) {
		return request({
			url: prefix + "/sys/user/save",
			method: "post",
			headers: { arrayFormat: "repeat" },
			data: inputForm,
		});
	},

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

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

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

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

	getCount: function (id) {
		return request({
			url: prefix + "/sys/user/getCount",
			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,
		});
	},
	userList: function (params) {
		return request({
			url: prefix + "/sys/user/userList",
			method: "get",
			params: params,
		});
	},
	exportTemplate: function () {
		return request({
			url: prefix + "/sys/user/import/template",
			method: "get",
			responseType: "blob",
		});
	},

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

	importExcel: function (data) {
		return request({
			url: prefix + "/sys/user/import",
			method: "post",
			data: data,
		});
	},

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

	queryDetailList(ids) {
		return request({
			url: prefix + `/sys/user/queryDetailList`,
			method: "get",
			params: { ids: ids },
		});
	},
	queryDetailById(id) {
		return request({
			url: prefix + `/sys/user/queryDetailById`,
			method: "get",
			params: { id: id },
		});
	},
	isUpdatePassword:function() {
		return request({
			url: prefix + `/sys/user/isUpdatePassword`,
			method: "get",
			params: {},
		});
	},

	getOffice() {
		return request({
			url: prefix + `/sys/office/treeData?type=2`,
			method: "get",
		});
	},

	updateAllUser() {
		return request({
			url: prefix + `/cwProjectReport/signatureCallBack/updateAllUser`,
			method: "post",
		});
	},

};
