• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

miaoxing / admin / 10395793452

10 Aug 2024 07:32AM UTC coverage: 24.307%. Remained the same
10395793452

push

github

twinh
style: php-cs-fixer new_with_parentheses

20 of 82 branches covered (24.39%)

4 of 22 new or added lines in 22 files covered. (18.18%)

149 of 613 relevant lines covered (24.31%)

2.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/pages/api/admin/user/index.php
1
<?php
2

3
use Miaoxing\App\Middleware\CheckPagePermission;
4
use Miaoxing\Plugin\BasePage;
5
use Miaoxing\Plugin\Service\User;
6
use Wei\V;
7

NEW
8
return new class extends BasePage {
×
9
    protected $className = '个人资料';
10

11
    public function init()
12
    {
13
        parent::init();
×
14
        $this->removeMiddleware(CheckPagePermission::class);
×
15
    }
16

17
    public function get()
18
    {
19
        return User::cur()->toRet();
×
20
    }
21

22
    public function patch($req)
23
    {
24
        $user = User::cur();
×
25

26
        $v = V::defaultOptional();
×
27
        $v->setModel($user);
×
28
        $v->modelColumn('name', '姓名');
×
29
        $v->modelColumn('nickName', '昵称');
×
30
        $v->imageUrl('avatar', '头像')->allowEmpty();
×
31
        $data = $v->assert($req);
×
32

33
        User::cur()->save($data);
×
34

35
        return suc();
×
36
    }
37
};
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc