Skip to content

Commit 8811793

Browse files
committed
A 登录日志增加IP搜索
1 parent eaaf105 commit 8811793

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

spug_web/src/pages/system/login/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ export default observer(function () {
2222
<SearchForm.Item span={8} title="账户名称">
2323
<Input allowClear value={store.f_name} onChange={e => store.f_name = e.target.value} placeholder="请输入"/>
2424
</SearchForm.Item>
25+
<SearchForm.Item span={8} title="登录IP">
26+
<Input allowClear value={store.f_ip} onChange={e => store.f_ip = e.target.value} placeholder="请输入"/>
27+
</SearchForm.Item>
2528
</SearchForm>
2629
<ComTable/>
2730
</AuthDiv>

spug_web/src/pages/system/login/store.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ class Store {
1010
@observable records = [];
1111
@observable isFetching = false;
1212

13+
@observable f_ip;
1314
@observable f_name;
1415
@observable f_status = '';
1516

1617
@computed get dataSource() {
1718
let records = this.records;
19+
if (this.f_ip) records = records.filter(x => includes(x.ip, this.f_ip));
1820
if (this.f_name) records = records.filter(x => includes(x.username, this.f_name));
1921
if (this.f_status) records = records.filter(x => String(x.is_success) === this.f_status);
2022
return records

0 commit comments

Comments
 (0)