Skip to content

Commit

Permalink
A 登录日志增加IP搜索
Browse files Browse the repository at this point in the history
  • Loading branch information
vapao committed Jul 14, 2022
1 parent eaaf105 commit 8811793
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spug_web/src/pages/system/login/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export default observer(function () {
<SearchForm.Item span={8} title="账户名称">
<Input allowClear value={store.f_name} onChange={e => store.f_name = e.target.value} placeholder="请输入"/>
</SearchForm.Item>
<SearchForm.Item span={8} title="登录IP">
<Input allowClear value={store.f_ip} onChange={e => store.f_ip = e.target.value} placeholder="请输入"/>
</SearchForm.Item>
</SearchForm>
<ComTable/>
</AuthDiv>
Expand Down
2 changes: 2 additions & 0 deletions spug_web/src/pages/system/login/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ class Store {
@observable records = [];
@observable isFetching = false;

@observable f_ip;
@observable f_name;
@observable f_status = '';
@computed get dataSource() {
let records = this.records;
if (this.f_ip) records = records.filter(x => includes(x.ip, this.f_ip));
if (this.f_name) records = records.filter(x => includes(x.username, this.f_name));
if (this.f_status) records = records.filter(x => String(x.is_success) === this.f_status);
return records
Expand Down

0 comments on commit 8811793

Please sign in to comment.