Authored by Rock Zhang

修改代码的一些字段名称

@@ -108,7 +108,7 @@ class BackController extends AbstractAction @@ -108,7 +108,7 @@ class BackController extends AbstractAction
108 } 108 }
109 // 处理地区信息 109 // 处理地区信息
110 foreach ($areas as &$val) { 110 foreach ($areas as &$val) {
111 - $val['areaCode'] = $val['area']; 111 + $val['areaCode'] = '+'.$val['area'];
112 if($val['area'] === '86') 112 if($val['area'] === '86')
113 { 113 {
114 $val['selected'] = true; 114 $val['selected'] = true;
@@ -145,28 +145,36 @@ class BackController extends AbstractAction @@ -145,28 +145,36 @@ class BackController extends AbstractAction
145 { 145 {
146 if($this->isAjax()) 146 if($this->isAjax())
147 { 147 {
148 - $mobile = $this->post('mobile', '');  
149 - $area = $this->post('area', 86); 148 + $phoneNum = $this->post('phoneNum', '');
  149 + $areaCode = $this->post('areaCode', 86);
150 150
151 // 发送手机验证码 151 // 发送手机验证码
152 - $result = BackData::sendCodeToMobile($mobile, $area); 152 + $result = BackData::sendCodeToMobile($phoneNum, $areaCode);
  153 + if($result['code'] === 200)
  154 + {
  155 + $result['data'] = '/passport/back/mobilecode?phoneNum='.$phoneNum.'&areaCode='.$areaCode;
  156 + }
153 157
154 $this->echoJson($result); 158 $this->echoJson($result);
155 } 159 }
156 } 160 }
157 161
  162 + /**
  163 + * 校验验证码页面
  164 + */
158 public function mobilecodeAction() 165 public function mobilecodeAction()
159 { 166 {
160 - $mobile = $this->get('mobile', '');  
161 - $area = $this->get('area', 86);  
162 - $areacode = '+'.$area; 167 + $phoneNum = $this->get('phoneNum', '');
  168 + $areaCode = $this->get('areaCode', 86);
  169 + $areaCode = '+'.$areaCode;
163 170
164 $data = array( 171 $data = array(
165 'backUrl' => '/passport/back/mobile', 172 'backUrl' => '/passport/back/mobile',
166 'headerText' => '找回密码', 173 'headerText' => '找回密码',
167 'isPassportPage' => true, 174 'isPassportPage' => true,
168 - 'areaCode' => $areacode,  
169 - 'phoneNum' => $mobile 175 + 'backCode' => true,
  176 + 'areaCode' => $areaCode,
  177 + 'phoneNum' => $phoneNum
170 ); 178 );
171 179
172 $this->_view->assign('title', 'YOHO!有货'); 180 $this->_view->assign('title', 'YOHO!有货');
@@ -182,12 +190,16 @@ class BackController extends AbstractAction @@ -182,12 +190,16 @@ class BackController extends AbstractAction
182 { 190 {
183 if($this->isAjax()) 191 if($this->isAjax())
184 { 192 {
185 - $mobile = $this->post('mobile', ''); 193 + $phoneNum = $this->post('phoneNum', '');
186 $code = $this->post('code', ''); 194 $code = $this->post('code', '');
187 - $area = $this->post('area', 86); 195 + $areaCode = $this->post('areaCode', 86);
188 196
189 // 校验手机验证码 197 // 校验手机验证码
190 - $result = BackData::validateMobileCode($mobile, $code, $area); 198 + $result = BackData::validateMobileCode($phoneNum, $code, $areaCode);
  199 + if($result['code'] === 200)
  200 + {
  201 + $result['data'] = '/passport/back/password?phoneNum='.$phoneNum.'&token='.$result['token'].'&areaCode='.$areaCode;
  202 + }
191 203
192 $this->echoJson($result); 204 $this->echoJson($result);
193 } 205 }
@@ -195,10 +207,10 @@ class BackController extends AbstractAction @@ -195,10 +207,10 @@ class BackController extends AbstractAction
195 207
196 public function passwordAction() 208 public function passwordAction()
197 { 209 {
198 - $mobile = $this->get('mobile', ''); 210 + $phoneNum = $this->get('phoneNum', '');
199 // 手机验证令牌 211 // 手机验证令牌
200 $token = $this->get('token', ''); 212 $token = $this->get('token', '');
201 - $area = $this->get('area', 86); 213 + $areaCode = $this->get('areaCode', 86);
202 214
203 // 邮箱验证码 215 // 邮箱验证码
204 $code = $this->get('code', ''); 216 $code = $this->get('code', '');
@@ -208,9 +220,9 @@ class BackController extends AbstractAction @@ -208,9 +220,9 @@ class BackController extends AbstractAction
208 'headerText' => '找回密码', 220 'headerText' => '找回密码',
209 'isPassportPage' => true, 221 'isPassportPage' => true,
210 'backNewPwd' => true, 222 'backNewPwd' => true,
211 - 'mobile' => $mobile, 223 + 'phoneNum' => $phoneNum,
212 'token' => $token, 224 'token' => $token,
213 - 'areaCode' => $area, 225 + 'areaCode' => $areaCode,
214 'code' => $code 226 'code' => $code
215 ); 227 );
216 228
@@ -227,13 +239,17 @@ class BackController extends AbstractAction @@ -227,13 +239,17 @@ class BackController extends AbstractAction
227 { 239 {
228 if($this->isAjax()) 240 if($this->isAjax())
229 { 241 {
230 - $mobile = $this->post('mobile', ''); 242 + $phoneNum = $this->post('phoneNum', '');
231 $token = $this->post('token', ''); 243 $token = $this->post('token', '');
232 $newpwd = $this->post('password', ''); 244 $newpwd = $this->post('password', '');
233 - $area = $this->post('area', 86); 245 + $areaCode = $this->post('areaCode', 86);
234 246
235 // 根据手机验证码修改密码 247 // 根据手机验证码修改密码
236 - $result = BackData::modifyPasswordByMobile($mobile, $token, $newpwd, $area); 248 + $result = BackData::modifyPasswordByMobile($phoneNum, $token, $newpwd, $areaCode);
  249 + if($result['code'] === 200)
  250 + {
  251 + $result['data'] = '/';
  252 + }
237 253
238 $this->echoJson($result); 254 $this->echoJson($result);
239 } 255 }