import {
	myRequest
} from '../request.js'
import store from '@/store/index.js'    
export default {
	//登录
	login(data) {
		return myRequest({
			url: '/login',
			// url: '/testLogin',
			method: 'post',
			data: data,
			noToken: true
		})
	},
	//登录用户信息
	getInfo() {
		return myRequest({
			url: '/getInfo',
			method: 'get',
		})
	},
	//刷新令牌
	refreshToken(data) {
		return myRequest({
			url: '/refreshToken/' + data,
			method: 'get',
			noToken: true
		})
	},
	//查询等级列表
	gradelist(data) {
		return myRequest({
			url: '/grade/list',
			method: 'get',
			data: data
		})
	},
	refreshUserInfo() {
		this.getInfo().then(resdata => {
			if(resdata.data.code == 200){
			store.commit('updateUserInfo',{userInfo:resdata.data.data})
			}	
		});
	}
}
