(function(exports) {

	var mineAPI = {
		// 修改密码
		passwordReset: function(data) {
			return httpRequest.put("/basic/api/v1.0/users/admin/"+data.userId+"/password_reset",{data: data})
		},
		// 修改个人资料
		userInforUpdate: function(data) {
			return httpRequest.httpPutContent("/basic/api/v1.0/users",{data: JSON.stringify(data)})
		},
		checkPhone:function(data){
			return httpRequest.get("/basic/api/v1.0/user/telephone/existence",{data:{telephone:data} })
		},
		//校验原密码
		checkOldPass:function(data){
			var userInfo = JSON.parse(plus.storage.getItem("userAgent"));
			data['user_name'] = userInfo.loginCode
			return httpRequest.get("/basic/api/v1.0/users/verification",{data:data})
		},
		// 新增意见
		adviceAdd: function(data) {
			setId(data);
			return httpRequest.postContent("/basic/api/v1.0/portalFeedback",{data: JSON.stringify(data)})
		},
		//获取行业列表
		workListGet:function(data){
			return httpRequest.get("/basic/api/v1.0/dictionaries/entries",{data: data})
		},
		// 获取意见列表
		adviceGet: function(data) {
			return httpRequest.get("/basic/api/v1.0/portalFeedback/",{data:data})
		},
		// 根据ID获取反馈意见
		adviceDetailGet: function(data) {
			return httpRequest.get("/basic/api/v1.0/portalFeedback/admin/",{data:data})
		},
		//获取地址列表
		addressGet: function (pid) {
			return httpRequest.get("/basic/api/v1.0/geography_entries/pid/"+pid)
		},
	}
	//给对象设置asstoken
	function setAccessToken(data){   
		var loginInfo = JSON.parse(plus.storage.getItem("oauthInfo"));
		data.accessToken = loginInfo.accessToken;
	}
	//给对象设置userId
	function setId(data){
		var userInfo = JSON.parse(plus.storage.getItem("userAgent"));
		data.userId = userInfo.id;
	}
	exports.mineAPI = mineAPI;
})(window)