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

export default {
	login: {
		method: 'AdminLogin',
		name: "登录获取TOKEN",
		post: async function (datas = {}) {
            var data = {
                'AdminName': datas.user.trim(), 
                'Password': datas.password.trim(), 
            }
            return await http.post({
                "jsonrpc": "2.0",
                "id": common.guid(),
                "method": this.method,
                "params": [data]
            });
        }
	},
    getInfo: {
		method: 'GetLoginInfoByToken',
		name: "获取登录信息",
		post: async function () {
            return await http.post({
                "jsonrpc": "2.0",
                "id": common.guid(),
                "method": this.method,
                "params": [{}]
            });
        }
	},
    getAdminRoleFeaturs: {
		method: 'GetAdminRoleFeaturs',
		name: "获取登录后的权限信息",
		post: async function (roleCode) {
            var data = {
                'AdminRoleCode':roleCode
            }
            return await http.post({
                "jsonrpc": "2.0",
                "id": common.guid(),
                "method": this.method,
                "params": [data]
            });
        }
	}
}
