From 97129adf88fc56e58530f0ab1506c92f933749f0 Mon Sep 17 00:00:00 2001 From: vguanyiwgd Date: Tue, 16 Apr 2024 10:13:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=90=8E=EF=BC=8C=E5=90=8C=E6=AD=A5=E6=9B=B4?= =?UTF-8?q?=E6=96=B0openid=20=E5=88=B0=20tb=5Fuser.applet=5Fopenid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Id41635e4ab2fbdc2cf845f96825b5144adcf2287 --- .../api/controllers/api/Applet.php | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/backstage/application/api/controllers/api/Applet.php b/backstage/application/api/controllers/api/Applet.php index 1052830..99f8aaa 100644 --- a/backstage/application/api/controllers/api/Applet.php +++ b/backstage/application/api/controllers/api/Applet.php @@ -180,4 +180,30 @@ class Applet extends REST_Controller { ) ), REST_Controller::HTTP_OK); } + + public function updateAppletOpenid_post(){ + $user_id = $this->user->id; + $uid = $this->input->post("uid", true); + if($user_id != $uid){ + $this->response(array( + 'status' => 0, + 'message' => 'token和uid不匹配', + + ), REST_Controller::HTTP_OK); + } + $applet_openid = $this->input->post("applet_openid", true); + + $res = $this->User_model->update_user(array('applet_openid' => $applet_openid), $user_id); + if($res){ + $this->response(array( + 'status' => 1, + 'message' => '更新成功', + ), REST_Controller::HTTP_OK); + }else{ + $this->response(array( + 'status' => 0, + 'message' => '更新失败', + ), REST_Controller::HTTP_OK); + } + } }