mirror of
https://gitee.com/apiadmin/ApiAdmin.git
synced 2025-05-24 13:59:31 +08:00
modified 优化细节
This commit is contained in:
parent
24675ed93c
commit
4ffb6e954b
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* 登录登出
|
||||
* @since 2017-11-02
|
||||
* @author zhaoxiang <zhaoxiang051405@gmail.com>
|
||||
*/
|
||||
@ -14,6 +15,12 @@ use app\util\Tools;
|
||||
|
||||
class Login extends Base {
|
||||
|
||||
/**
|
||||
* 用户登录
|
||||
* @author zhaoxiang <zhaoxiang051405@gmail.com>
|
||||
* @return array
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function index() {
|
||||
$username = $this->request->post('username');
|
||||
$password = $this->request->post('password');
|
||||
|
@ -96,7 +96,7 @@ class User extends Base {
|
||||
$postData['regTime'] = time();
|
||||
$postData['password'] = Tools::userMd5($postData['password']);
|
||||
if ($postData['groupId']) {
|
||||
$groups = implode(',', $postData['groupId']);
|
||||
$groups = trim(implode(',', $postData['groupId']), ',');
|
||||
}
|
||||
unset($postData['groupId']);
|
||||
$res = ApiUser::create($postData);
|
||||
@ -193,7 +193,7 @@ class User extends Base {
|
||||
$postData['password'] = Tools::userMd5($postData['password']);
|
||||
}
|
||||
if ($postData['groupId']) {
|
||||
$groups = implode(',', $postData['groupId']);
|
||||
$groups = trim(implode(',', $postData['groupId']), ',');
|
||||
}
|
||||
unset($postData['groupId']);
|
||||
$res = ApiUser::update($postData);
|
||||
|
Loading…
x
Reference in New Issue
Block a user