Browse Source

黑白名单改造v0.1

wugl 4 years ago
parent
commit
d21754246a

+ 35 - 1
src/pages/fengkong/namelist/blackuserlist/components/Edit.js

@@ -24,7 +24,41 @@ export default class Index extends Component {
       ],
       isRequired: true,
       placeholder: '请选择'
-    }];
+    },
+    {
+      label: '作用域',
+      type: 'select',
+      key: 'scope',
+      options: [
+        { value: "100", label: '全局' },
+      ],
+      isRequired: true,
+      placeholder: '请选择'
+    },
+    {
+      label: '作用域key',
+      type: 'input',
+      key: 'scopekey',
+      placeholder: '作用域key,全局作用域可为空',
+      maxLength: 15,
+    },
+    {
+      label: "生效日期",
+      type: "datepicker",
+      key: "starttime",
+      format: "YYYY-MM-DD",
+      placeholder: ["请选择生效日期"],
+      isRequired: true,
+    },
+    {
+      label: "失效日期",
+      type: "datepicker",
+      key: "endtime",
+      format: "YYYY-MM-DD",
+      placeholder: ["请选择失效日期"],
+      isRequired: true,
+    },
+  ];
     return (
       <Modal
         title={`新增黑名单用户Id`}

+ 98 - 0
src/pages/fengkong/namelist/blackuserlist/components/Update.js

@@ -0,0 +1,98 @@
+import React, { Component } from 'react';
+import { Modal } from 'antd';
+import { FormItem } from 'wptpc-design';
+
+export default class Index extends Component {
+
+  render() {
+    const { showModal, params, onChange, onOk, onCancel } = this.props;
+    const formSetting = [{
+      label: 'userId',
+      isRequired: true,
+      type: 'input',
+      key: 'userId',
+      placeholder: '用户Id',
+      maxLength: 15,
+      disabled: true,
+    },
+    {
+      label: '类型',
+      type: 'select',
+      key: 'type',
+      options: [
+        { value: 0, label: '系统默认' },
+        { value: 1, label: '风控规则自动拉黑' },
+        { value: 2, label: '后台手动录入' },
+      ],
+      disabled: true,
+    },
+    {
+      label: '是否启用',
+      type: 'select',
+      key: 'valid',
+      options: [
+        { value: 0, label: '禁用' },
+        { value: 1, label: '启用' },
+      ],
+      isRequired: true,
+      placeholder: '请选择',
+    },
+    {
+      label: '作用域',
+      type: 'select',
+      key: 'scope',
+      options: [
+        { value: 100, label: '全局' },
+      ],
+      defaultValue: params.scope,
+      isRequired: true,
+      placeholder: '请选择',
+    },
+    {
+      label: '作用域key',
+      type: 'input',
+      key: 'scopekey',
+      placeholder: '作用域key,全局作用域可为空',
+      maxLength: 15,
+    },
+    {
+      label: "生效日期",
+      type: "datepicker",
+      key: "starttime",
+      format: "YYYY-MM-DD",
+      placeholder: ["请选择生效日期"],
+      isRequired: true,
+    },
+    {
+      label: "失效日期",
+      type: "datepicker",
+      key: "endtime",
+      format: "YYYY-MM-DD",
+      placeholder: ["请选择失效日期"],
+      isRequired: true,
+    },
+    {
+      label: "创建时间",
+      type: "input",
+      key: "createTime",
+      disabled: true,
+    },
+    {
+      label: "修改时间",
+      type: "input",
+      key: "updateTime",
+      disabled: true,
+    },
+  ];
+    return (
+      <Modal
+        title={`修改黑名单用户`}
+        visible={showModal}
+        onOk={onOk}
+        onCancel={onCancel}
+      >
+        <FormItem formSetting={formSetting} params={params} onChange={onChange} />
+      </Modal>
+    );
+  }
+}

+ 88 - 18
src/pages/fengkong/namelist/blackuserlist/index.js

@@ -3,9 +3,11 @@ import { FilterTable } from 'wptpc-design'
 import { connect } from 'dva'
 import { thanos } from '@/conf/config'
 import { message, Popconfirm, Button } from 'antd'
-import { delItem, addUserId, batchAddNameList } from './service.js'
+import { delItem, updateUserId, addUserId, batchAddNameList } from './service.js'
 import Edit from './components/Edit';
-import BatchEdit from '../commoncomponents/Edit'
+import BatchEdit from '../commoncomponents/BatchUserEdit'
+import Update from './components/Update'
+import moment from 'moment';
 
 const apiUrl = `${thanos}/thanos-admin/api/v1/nameList/blackUserList`
 
@@ -21,7 +23,7 @@ class BlackIpList extends React.PureComponent {
       selectedItem: {},
       showEditModal: false,
       params: {},
-
+      showUpdate: false,
       showBatchModal: false,
       selectedBatchItem: {},
       showBatchEditModal: false,
@@ -35,11 +37,21 @@ class BlackIpList extends React.PureComponent {
     isClearSearch: true,
     formFields: [
       {
-        label: '',
+        label: '用户id:',
         type: 'input',
-        key: 'queryName',
-        placeholder: '用户Id查询'
-      }
+        key: 'users',
+        placeholder: '多个用半角逗号分割'
+      },
+      {
+        label: '是否启用:',
+        type: 'select',
+        option: [
+          { value: '', label: '不限' },
+          { value: '0', label: '禁用' },
+          { value: '1', label: '启用' }
+        ],
+        key: 'valid'
+      },
     ]
     // 在接口请求前,可以修改给接口的入参
     // beforeSearchFunc: params => {
@@ -67,10 +79,33 @@ class BlackIpList extends React.PureComponent {
         }
       },
       {
-        title: '是否有效',
+        title: '是否启用',
         dataIndex: 'valid',
         render: (text) => text === 1 ? '是' : '否'
       },
+      {
+        title: '作用域',
+        dataIndex: 'scope',
+        render: (text) => {
+          if (text === 100) return '全局'
+          else if (text === 10) return '业务大类'
+          else if (text === 1) return '具体决策'
+        }
+      },
+      {
+        title: '作用域key',
+        dataIndex: 'scopekey',
+      },
+      {
+        title: '生效时间',
+        dataIndex: 'starttime',
+        render: (text) => text.substring(0,10),
+      },
+      {
+        title: '失效时间',
+        dataIndex: 'endtime',
+        render: (text) => text.substring(0,10),
+      },
       {
         title: '更新时间',
         dataIndex: 'updateTime'
@@ -81,13 +116,7 @@ class BlackIpList extends React.PureComponent {
         // 所有需要弹窗操作的都可以用编辑的逻辑;所有不需要弹窗的操作,比如上架、发布等,都可以用”删除“的逻辑
         render: (text, record) => (
           <span>
-            <Popconfirm
-              title="启用/禁用"
-              onConfirm={() => this.delItem(record)}>
-              <a>{
-                record.valid === 1 ? '禁用' : '启用'
-              }</a>
-            </Popconfirm>
+            <a onClick={() => this.update(record)}>编辑</a>
           </span>)
       }
     ],
@@ -130,7 +159,8 @@ class BlackIpList extends React.PureComponent {
     const { params } = this.state;
 
     const payload = { ...params };
-    addUserId({ userId: payload.userId, valid: payload.valid, type:2, createUser: this.props.currentUser.name, updateUser: this.props.currentUser.name }).then(res => {
+    addUserId({ userId: payload.userId, valid: payload.valid, scope: payload.scope, scopekey: payload.scopekey,starttime: payload.starttime.format('YYYY-MM-DD')
+      ,endtime: payload.endtime.format('YYYY-MM-DD'), operator:this.props.currentUser.name,type:2, createUser: this.props.currentUser.name, updateUser: this.props.currentUser.name }).then(res => {
       if (res.code === 0) {
         message.success('添加成功')
         this.refresh()//刷新列表
@@ -139,11 +169,18 @@ class BlackIpList extends React.PureComponent {
     })
   }
   onBatchEditOk = () => {
-    const { csvFile, valid } = this.state.batchParams;
+    const { csvFile, valid, scope, scopekey, starttime, endtime} = this.state.batchParams;
     const params = new FormData()
     params.append("csvFile", csvFile)
     params.append("model", "BlackUser")
     params.append("valid", valid)
+    params.append("scope", scope)
+    if(scopekey){
+      params.append("scopekey", scopekey)
+    }
+    params.append("starttime", starttime.format('YYYY-MM-DD'))
+    params.append("endtime", endtime.format('YYYY-MM-DD'))
+    params.append("operator", this.props.currentUser.name)
     batchAddNameList(params).then(res => {
       if (res.data.code === 0) {
         message.success('批量导入成功')
@@ -161,12 +198,45 @@ class BlackIpList extends React.PureComponent {
   onBatchEditCancel = () => {
     this.setState({ showBatchEditModal: false })
   }
+
+  onUpdateCancel = () => {
+    this.setState({ showUpdate: false })
+  }
+
+  onUpdateOk = () => {
+    const params = Object.assign({}, this.state.params)
+    if(!params.starttime || !params.endtime){
+      message.error('请选择相应的日期未选择')
+    }
+    params.starttime = params?.starttime?.format('YYYY-MM-DD')
+    params.endtime = params?.endtime?.format('YYYY-MM-DD')
+    updateUserId(params).then(res => {
+      console.log(JSON.stringify(res))
+      if (res.code === 0) {
+        message.success('修改成功')
+        console.info(this.state)
+        this.refresh()
+        this.onUpdateCancel()
+      }else {
+        message.error('修改失败')
+      }
+    })
+  }
+
+  update = (record) => {  
+    const params = Object.assign({}, record)
+    params.starttime = moment(params.starttime, 'YYYY-MM-DD')
+    params.endtime = moment(params.endtime, 'YYYY-MM-DD')
+    this.setState({ showUpdate: true, params: params })
+  }
+
   render() {
-    const { showModal, selectedItem, showEditModal, params, showBatchEditModal, batchParams, batchRemark} = this.state;
+    const { showModal, selectedItem, showUpdate, showEditModal, params, showBatchEditModal, batchParams, batchRemark} = this.state;
     return (
       <div>
         <FilterTable filterSetting={this.filterSetting} tableSetting={this.tableSetting} apiUrl={apiUrl}
         />
+        <Update showModal={showUpdate} params={params} onChange={this.onParamsChange} onOk={this.onUpdateOk} onCancel={this.onUpdateCancel} />
         <Edit showModal={showEditModal} params={params} onChange={this.onParamsChange} onOk={this.onEditOk} onCancel={this.onEditCancel} />
         <BatchEdit showModal={showBatchEditModal} params={batchParams} onChange={this.onBatchParamsChange} onOk={this.onBatchEditOk} onCancel={this.onBatchEditCancel} batchRemark={batchRemark} />
       </div>

+ 5 - 0
src/pages/fengkong/namelist/blackuserlist/service.js

@@ -16,3 +16,8 @@ export async function batchAddNameList (body) {
   const url = `${thanos}/thanos-admin/api/v1/nameList/batchNameList`
   return fetchApi(url, { method: 'POST', contentType: 'jsonString', body })
 }
+
+export async function updateUserId (params) {
+  const url = `${thanos}/thanos-admin/api/v1/nameList/blackUserList/enableDisable`
+  return fetchApi(url, params)
+}

+ 101 - 0
src/pages/fengkong/namelist/commoncomponents/BatchUserEdit.js

@@ -0,0 +1,101 @@
+import React, { Component } from 'react'
+import { Modal, Upload, Button, message } from 'antd'
+import { FormItem } from 'wptpc-design'
+
+export default class Index extends Component {
+
+  uploadProps = {
+    name: 'csvFile',
+    headers: {
+      credentials: 'include'
+    },
+    beforeUpload: file => {
+      if (!file.name.endsWith('.csv')) {
+        message.warning('请上传 cxv 格式的文件')
+        return false
+      }
+      if (file == null) {
+        message.warn('请选择名单文件')
+        return false
+      }
+      this.props.onChange('csvFile', file)
+      return false
+    }
+  };
+
+  render() {
+    const { showModal, params, onChange, onOk, onCancel, batchRemark, fetching} = this.props;
+    const formSetting = [ {
+      label: '名单文件',
+      key: 'file',
+      render: () => {
+        return (
+          <div style={{ marginLeft: '120px' }}>
+            <Upload {...this.uploadProps}>
+              <Button type="primary">上传名单文件</Button>
+            </Upload>
+            <p>文件类型:.csv</p>
+            <p>{batchRemark}</p>
+          </div>
+        )
+      }
+    },
+    {
+      label: '是否启用',
+      type: 'select',
+      key: 'valid',
+      options: [
+        { value: "0", label: '禁用' },
+        { value: "1", label: '启用' },
+      ],
+      isRequired: true,
+      placeholder: '请选择'
+    },
+    {
+      label: '作用域',
+      type: 'select',
+      key: 'scope',
+      options: [
+        { value: 100, label: '全局' },
+      ],
+      defaultValue: params.scope,
+      isRequired: true,
+      placeholder: '请选择',
+    },
+    {
+      label: '作用域key',
+      type: 'input',
+      key: 'scopekey',
+      placeholder: '作用域key,全局作用域可为空',
+      maxLength: 15,
+    },
+    {
+      label: "生效日期",
+      type: "datepicker",
+      key: "starttime",
+      format: "YYYY-MM-DD",
+      placeholder: ["请选择生效日期"],
+      isRequired: true,
+    },
+    {
+      label: "失效日期",
+      type: "datepicker",
+      key: "endtime",
+      format: "YYYY-MM-DD",
+      placeholder: ["请选择失效日期"],
+      isRequired: true,
+    }];
+    return (
+      <Modal
+        title={`批量导入`}
+        visible={showModal}
+        onOk={onOk}
+        onCancel={onCancel}
+        okButtonProps={{ disabled: fetching }}
+        destroyOnClose
+      >
+        <FormItem formSetting={formSetting} params={params} onChange={onChange} />
+      </Modal>
+    );
+  }
+}

+ 35 - 1
src/pages/fengkong/namelist/whiteuserlist/components/Edit.js

@@ -24,7 +24,41 @@ export default class Index extends Component {
       ],
       isRequired: true,
       placeholder: '请选择'
-    }];
+    },
+    {
+      label: '作用域',
+      type: 'select',
+      key: 'scope',
+      options: [
+        { value: "100", label: '全局' },
+      ],
+      isRequired: true,
+      placeholder: '请选择'
+    },
+    {
+      label: '作用域key',
+      type: 'input',
+      key: 'scopekey',
+      placeholder: '作用域key,全局作用域可为空',
+      maxLength: 15,
+    },
+    {
+      label: "生效日期",
+      type: "datepicker",
+      key: "starttime",
+      format: "YYYY-MM-DD",
+      placeholder: ["请选择生效日期"],
+      isRequired: true,
+    },
+    {
+      label: "失效日期",
+      type: "datepicker",
+      key: "endtime",
+      format: "YYYY-MM-DD",
+      placeholder: ["请选择失效日期"],
+      isRequired: true,
+    },
+  ];
     return (
       <Modal
         title={`新增白名单用户`}

+ 98 - 0
src/pages/fengkong/namelist/whiteuserlist/components/Update.js

@@ -0,0 +1,98 @@
+import React, { Component } from 'react';
+import { Modal } from 'antd';
+import { FormItem } from 'wptpc-design';
+
+export default class Index extends Component {
+
+  render() {
+    const { showModal, params, onChange, onOk, onCancel } = this.props;
+    const formSetting = [{
+      label: 'userId',
+      isRequired: true,
+      type: 'input',
+      key: 'userId',
+      placeholder: '用户Id',
+      maxLength: 15,
+      disabled: true,
+    },
+    {
+      label: '类型',
+      type: 'select',
+      key: 'type',
+      options: [
+        { value: 0, label: '系统默认' },
+        { value: 1, label: '风控规则自动拉黑' },
+        { value: 2, label: '后台手动录入' },
+      ],
+      disabled: true,
+    },
+    {
+      label: '是否启用',
+      type: 'select',
+      key: 'valid',
+      options: [
+        { value: 0, label: '禁用' },
+        { value: 1, label: '启用' },
+      ],
+      isRequired: true,
+      placeholder: '请选择',
+    },
+    {
+      label: '作用域',
+      type: 'select',
+      key: 'scope',
+      options: [
+        { value: 100, label: '全局' },
+      ],
+      defaultValue: params.scope,
+      isRequired: true,
+      placeholder: '请选择',
+    },
+    {
+      label: '作用域key',
+      type: 'input',
+      key: 'scopekey',
+      placeholder: '作用域key,全局作用域可为空',
+      maxLength: 15,
+    },
+    {
+      label: "生效日期",
+      type: "datepicker",
+      key: "starttime",
+      format: "YYYY-MM-DD",
+      placeholder: ["请选择生效日期"],
+      isRequired: true,
+    },
+    {
+      label: "失效日期",
+      type: "datepicker",
+      key: "endtime",
+      format: "YYYY-MM-DD",
+      placeholder: ["请选择失效日期"],
+      isRequired: true,
+    },
+    {
+      label: "创建时间",
+      type: "input",
+      key: "createTime",
+      disabled: true,
+    },
+    {
+      label: "修改时间",
+      type: "input",
+      key: "updateTime",
+      disabled: true,
+    },
+  ];
+    return (
+      <Modal
+        title={`修改白名单用户`}
+        visible={showModal}
+        onOk={onOk}
+        onCancel={onCancel}
+      >
+        <FormItem formSetting={formSetting} params={params} onChange={onChange} />
+      </Modal>
+    );
+  }
+}

+ 98 - 18
src/pages/fengkong/namelist/whiteuserlist/index.js

@@ -3,9 +3,11 @@ import { FilterTable } from 'wptpc-design'
 import { connect } from 'dva'
 import { thanos } from '@/conf/config'
 import { message, Popconfirm, Button } from 'antd'
-import { delItem, addUserId, batchAddNameList } from './service.js'
+import { delItem, updateUserId, addUserId, batchAddNameList } from './service.js'
 import Edit from './components/Edit'
-import BatchEdit from '../commoncomponents/Edit'
+import BatchEdit from '../commoncomponents/BatchUserEdit'
+import Update from './components/Update'
+import moment from 'moment';
 
 const apiUrl = `${thanos}/thanos-admin/api/v1/nameList/whiteUserList`
 
@@ -21,7 +23,7 @@ class BlackIpList extends React.PureComponent {
       selectedItem: {},
       showEditModal: false,
       params: {},
-
+      showUpdate: false,
       showBatchModal: false,
       selectedBatchItem: {},
       showBatchEditModal: false,
@@ -35,11 +37,30 @@ class BlackIpList extends React.PureComponent {
     isClearSearch: true,
     formFields: [
       {
-        label: '',
+        label: '用户id:',
         type: 'input',
-        key: 'queryName',
-        placeholder: '用户Id查询'
-      }
+        key: 'users',
+        placeholder: '多个用半角逗号分割'
+      },
+      // {
+      //   label: '是否启用:',
+      //   type: 'select',
+      //   options: [
+      //     { value: '0', label: '禁用' },
+      //     { value: '1', label: '启用' }
+      //   ],
+      //   key: 'valid'
+      // },
+      {
+        label: '是否启用:',
+        type: 'select',
+        option: [
+          { value: '', label: '不限' },
+          { value: '0', label: '禁用' },
+          { value: '1', label: '启用' }
+        ],
+        key: 'valid'
+      },
     ]
     // 在接口请求前,可以修改给接口的入参
     // beforeSearchFunc: params => {
@@ -67,10 +88,33 @@ class BlackIpList extends React.PureComponent {
         }
       },
       {
-        title: '是否有效',
+        title: '是否启用',
         dataIndex: 'valid',
         render: (text) => text === 1 ? '是' : '否'
       },
+      {
+        title: '作用域',
+        dataIndex: 'scope',
+        render: (text) => {
+          if (text === 100) return '全局'
+          else if (text === 10) return '业务大类'
+          else if (text === 1) return '具体决策'
+        }
+      },
+      {
+        title: '作用域key',
+        dataIndex: 'scopekey',
+      },
+      {
+        title: '生效时间',
+        dataIndex: 'starttime',
+        render: (text) => text.substring(0,10),
+      },
+      {
+        title: '失效时间',
+        dataIndex: 'endtime',
+        render: (text) => text.substring(0,10),
+      },
       {
         title: '更新时间',
         dataIndex: 'updateTime'
@@ -81,13 +125,7 @@ class BlackIpList extends React.PureComponent {
         // 所有需要弹窗操作的都可以用编辑的逻辑;所有不需要弹窗的操作,比如上架、发布等,都可以用”删除“的逻辑
         render: (text, record) => (
           <span>
-            <Popconfirm
-              title="启用/禁用"
-              onConfirm={() => this.delItem(record)}>
-              <a>{
-                record.valid === 1 ? '禁用' : '启用'
-              }</a>
-            </Popconfirm>
+            <a onClick={() => this.update(record)}>编辑</a>
           </span>)
       }
     ],
@@ -126,7 +164,9 @@ class BlackIpList extends React.PureComponent {
     const { params } = this.state;
 
     const payload = { ...params };
-    addUserId({ userId: payload.userId, valid: payload.valid, type:2, createUser: this.props.currentUser.name, updateUser: this.props.currentUser.name }).then(res => {
+    addUserId({ userId: payload.userId, valid: payload.valid, type:2,
+      scope: payload.scope, scopekey: payload.scopekey,starttime: payload.starttime.format('YYYY-MM-DD')
+      ,endtime: payload.endtime.format('YYYY-MM-DD'), operator:this.props.currentUser.name, createUser: this.props.currentUser.name, updateUser: this.props.currentUser.name }).then(res => {
       if (res.code === 0) {
         message.success('添加成功')
         this.refresh()//刷新列表
@@ -136,11 +176,18 @@ class BlackIpList extends React.PureComponent {
   }
 
   onBatchEditOk = () => {
-    const { csvFile, valid } = this.state.batchParams;
+    const { csvFile, valid, scope, scopekey, starttime, endtime} = this.state.batchParams;
     const params = new FormData()
     params.append("csvFile", csvFile)
     params.append("model", "WhiteUser")
     params.append("valid", valid)
+    params.append("scope", scope)
+    if(scopekey){
+      params.append("scopekey", scopekey)
+    }
+    params.append("starttime", starttime.format('YYYY-MM-DD'))
+    params.append("endtime", endtime.format('YYYY-MM-DD'))
+    params.append("operator", this.props.currentUser.name)
     batchAddNameList(params).then(res => {
       if (res.data.code === 0) {
         message.success('批量导入成功')
@@ -158,12 +205,45 @@ class BlackIpList extends React.PureComponent {
   onBatchEditCancel = () => {
     this.setState({ showBatchEditModal: false })
   }
+
+  onUpdateCancel = () => {
+    this.setState({ showUpdate: false })
+  }
+
+  onUpdateOk = () => {
+    const params = Object.assign({}, this.state.params)
+    if(!params.starttime || !params.endtime){
+      message.error('请选择相应的日期未选择')
+    }
+    params.starttime = params?.starttime?.format('YYYY-MM-DD')
+    params.endtime = params?.endtime?.format('YYYY-MM-DD')
+    updateUserId(params).then(res => {
+      console.log(JSON.stringify(res))
+      if (res.code === 0) {
+        message.success('修改成功')
+        console.info(this.state)
+        this.refresh()
+        this.onUpdateCancel()
+      }else {
+        message.error('修改失败')
+      }
+    })
+  }
+
+  update = (record) => {  
+    const params = Object.assign({}, record)
+    params.starttime = moment(params.starttime, 'YYYY-MM-DD')
+    params.endtime = moment(params.endtime, 'YYYY-MM-DD')
+    this.setState({ showUpdate: true, params: params })
+  }
+
   render() {
-    const { showModal, selectedItem, showEditModal, params,showBatchEditModal, batchParams, batchRemark} = this.state;
+    const { showModal, selectedItem, showUpdate, showEditModal, params,showBatchEditModal, batchParams, batchRemark} = this.state;
     return (
       <div>
         <FilterTable filterSetting={this.filterSetting} tableSetting={this.tableSetting} apiUrl={apiUrl}
         />
+        <Update showModal={showUpdate} params={params} onChange={this.onParamsChange} onOk={this.onUpdateOk} onCancel={this.onUpdateCancel} />
         <Edit showModal={showEditModal} params={params} onChange={this.onParamsChange} onOk={this.onEditOk} onCancel={this.onEditCancel} />
         <BatchEdit showModal={showBatchEditModal} params={batchParams} onChange={this.onBatchParamsChange} onOk={this.onBatchEditOk} onCancel={this.onBatchEditCancel} batchRemark={batchRemark} />
       </div>

+ 7 - 1
src/pages/fengkong/namelist/whiteuserlist/service.js

@@ -1,12 +1,12 @@
 import { fetchApi } from '@/apis'
 import { thanos } from '@/conf/config'
 
-//删除
 export async function delItem (params) {
   const url = `${thanos}/thanos-admin/api/v1/nameList/whiteUserList/enableDisable`
   return fetchApi(url, params)
 }
 
+
 export async function addUserId (params) {
   const url = `${thanos}/thanos-admin/api/v1/nameList/whiteUserList/create`
   return fetchApi(url, params)
@@ -16,3 +16,9 @@ export async function batchAddNameList (body) {
   const url = `${thanos}/thanos-admin/api/v1/nameList/batchNameList`
   return fetchApi(url, { method: 'POST', contentType: 'jsonString', body })
 }
+
+export async function updateUserId (params) {
+  const url = `${thanos}/thanos-admin/api/v1/nameList/whiteUserList/enableDisable`
+  return fetchApi(url, params)
+}
+