From d479d9fbcb37f8b861031c94a83d0e37761210c5 Mon Sep 17 00:00:00 2001
From: colly_wyx <wangyixiong_007@163.com>
Date: Tue, 29 May 2018 09:07:03 +0800
Subject: [PATCH] 修改bug

---
 application/modules/User/controllers/User.php |   34 +++++++++++++++++++++++++++++++++-
 1 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/application/modules/User/controllers/User.php b/application/modules/User/controllers/User.php
index b0fe690..c3aaa47 100644
--- a/application/modules/User/controllers/User.php
+++ b/application/modules/User/controllers/User.php
@@ -49,7 +49,7 @@
 				exit($this->showError($this->user_service->error, 400, true));
 			}
 		}
-		$role_service = new service_Role();
+		$role_service = new Service_Role();
 		$roles = $role_service->getRoleList();
 		$this->getView()->assign('roles', $roles);
 	}
@@ -88,6 +88,38 @@
 	}
 
 	/**
+	 * ������������������
+	 */
+	public function MyAction(){
+		$user_id = $this->session['user']['user_id'];
+		$user = $this->user_service->getUserInfo(array('_id' => $user_id));
+		if($user){
+			if($this->getRequest()->isXmlHttpRequest()){
+				$data['nickname'] = $this->post('nickname');
+				$password = $this->post('password');
+				if(!empty($password))
+				$data['password'] = md5(md5($password).$user['encrypt']);
+				$data['refresh_frequency'] = $this->post('refresh_frequency');
+				$data['is_open_upload'] = $this->post('is_open_upload');
+				$data['video'] = $this->post('video');
+				$data['edit_time'] = time();
+				if($this->user_service->update($data, array('_id' => $user_id))){
+					exit($this->showSuccess('������������������', true));
+				}
+				else{
+					exit($this->showError($this->user_service->error, 400, true));
+				}
+			}
+			$role_service = new Service_Role();
+			$roles = $role_service->getRoleList();
+			$this->getView()->assign(array('user' => $user, 'roles' => $roles));
+		}
+		else{
+			$this->redirect('/error/show/type/no_data');
+		}
+	}
+
+	/**
 	 * ������������������������������
 	 */
 	public function CheckPhoneAction(){

--
Gitblit v1.8.0