Skip to content

Commit

Permalink
更新:支持关闭个人中心位置信息显示
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuchunshu committed Jan 24, 2023
1 parent 50aace3 commit 06cd464
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/Plugins/User/resources/views/home/overview.blade.php
Expand Up @@ -32,6 +32,7 @@
<div class="border-0 card card-body">
<h3 class="card-title">{{__("user.data")}}</h3>
<div class="row row-cards">
@if(get_options("user_location_show_close",'false')!=="true")
<div class="col-12 col-md-6 col-lg-3">
<div class="card card-sm">
<div class="card-body">
Expand Down Expand Up @@ -65,7 +66,7 @@
</div>
</div>
</div>

@endif
<div class="col-12 col-md-6 col-lg-3">
<a href="/users/{{$user->id}}.html?m=users_home_menu_2" class="card card-sm">
<div class="card-body">
Expand Down
3 changes: 2 additions & 1 deletion app/Plugins/User/src/Controller/ApiController.php
Expand Up @@ -24,6 +24,7 @@
use Hyperf\HttpServer\Annotation\Middleware;
use Hyperf\HttpServer\Annotation\PostMapping;
use Hyperf\RateLimit\Annotation\RateLimit;
use Hyperf\Utils\Str;

#[Controller]
#[RateLimit(create: 1, capacity: 3)]
Expand Down Expand Up @@ -326,7 +327,7 @@ public function get_user_session_ip(): array
$sessions = UsersAuth::query()->orderByDesc('created_at')->where('user_id', $user_id)->get();
foreach ($sessions as $data) {
if ($data->user_ip) {
return Json_Api(200, true, ['msg' => core_default(get_client_ip_data($data->user_ip)['pro'], '未知')]);
return Json_Api(200, true, ['msg' => Str::limit(get_client_ip_data($data->user_ip)['pro'],4,'')]);
}
}
return Json_Api(403, false, ['msg' => '未找到用户IP归属地信息']);
Expand Down
7 changes: 7 additions & 0 deletions resources/views/setting/user/core.blade.php
Expand Up @@ -73,6 +73,13 @@
</label>
</div>

<div class="col-3">
<label class="form-check form-switch">
<input class="form-check-input" type="checkbox" v-model="data.user_location_show_close">
<span class="form-check-label">关闭显示个人中心位置信息</span>
</label>
</div>

</div>

</div>

0 comments on commit 06cd464

Please sign in to comment.