import http from "@/utils/request"
import common from "@/utils/common"

export default {
    fetchUserList: {
		method: 'GetUserPagesAsync',
		name: "用户列表",
		post: async function (params) {            
            var queryType = params.queryType == null ? '' : params.queryType
            var queryState = params.queryState == null ? '' : params.queryState
            var data = {
                'PageIndex': params.page,
                'PageSize': params.pageSize,
                'QueryType': queryType,
                'Keyword': params.keyword,
                'QueryState': queryState
            }
            return await http.post({
                "jsonrpc": "2.0",
                "id": common.guid(),
                "method": this.method,
                "params": [data]
            });
        }
	},
    modifyUserPassword: {
		method: 'ResetUserPassword',
		name: "重置用户密码",
		post: async function (req) {            
            var data = {
                'UserCode': req.code, 
                'PassWord': req.password
            }
            return await http.post({
                "jsonrpc": "2.0",
                "id": common.guid(),
                "method": this.method,
                "params": [data]
            });
        }
	},
    userDetailInfo: {
		method: 'FindUserByCode',
		name: "用户详情",
		post: async function (code) {            
            var data = {
                'UserCode': code, 
            }
            return await http.post({
                "jsonrpc": "2.0",
                "id": common.guid(),
                "method": this.method,
                "params": [data]
            });
        }
	},
}
