Explorar el Código

默认昵称更改

linwu hace 1 año
padre
commit
bb30a1c108
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      app/mainapp/controller/Login.php

+ 4 - 0
app/mainapp/controller/Login.php

@@ -76,6 +76,10 @@ class Login
         $result        = json_decode($result, true);
         $mobile        = $result['purePhoneNumber'];
         $user          = UserModel::where(['mobile' => $mobile])->findOrEmpty();
+
+        if ($nickname == '微信用户') {
+            $nickname = '用户' . substr($mobile, -4);
+        }
         if ($user->isEmpty()) {
             $userdata = [
                 'nickname' => $nickname,