Browse Source

fix: 修改对应api和数据类型

liming 5 months ago
parent
commit
8243281798

+ 1 - 1
src/api/path/system.api.js

@@ -28,7 +28,7 @@ export function updateUserItem(param) {
 } 
 // 状态更新
 export function updateUserState(param){
-  return service.post('/admin/user/updateUserState', param) 
+  return service.post('/admin/system/user/updateUserState', param) 
 }
 // menu
 // 菜单添加

+ 2 - 2
src/views/system/role/config.js

@@ -11,8 +11,8 @@ export const columns = [
     slotName: 'state',
     width:200 
   },
-  { title: '更新时间', dataIndex: 'updatedAt', align: 'center', width:200 },
-  { title: '创建时间', dataIndex: 'createdAt', align: 'center', width:200 },
+  { title: '更新时间', dataIndex: 'updated_at', align: 'center', width:200 },
+  { title: '创建时间', dataIndex: 'created_at', align: 'center', width:200 },
   {
     title: '操作',
     dataIndex: 'id',

+ 4 - 4
src/views/system/role/index.vue

@@ -131,7 +131,7 @@
               @ok="evSwitchStatus(record)"
             >
               <div>
-                <a-switch v-model="record.state" style="pointer-events: none" :checked-value="1" :unchecked-value="0" />
+                <a-switch v-model="record.state" style="pointer-events: none" checked-value="1" unchecked-value="0" />
               </div>
             </a-popconfirm>
           </template>
@@ -141,8 +141,8 @@
               v-model="record.status"
               disabled
               style="pointer-events: none"
-              :checked-value="0"
-              :unchecked-value="1"
+              checked-value="0"
+              unchecked-value="1"
             />
           </template>
           <template #id="{ record }">
@@ -199,7 +199,7 @@ const fnTreeFilter = (data, ids) => {
 const evSwitchStatus = async (e) =>{
   await updateUserState({
     id:e.id,
-    state: e.state == 1 ? 0 : 1,
+    state: e.state == "1" ? "0" : "1",
   })
   Message.success({
     content: '操作成功',

+ 1 - 1
src/views/system/user/form.vue

@@ -65,7 +65,7 @@
       </a-form-item>
 
       <a-form-item field="state" label="账号状态" :rules="[{ required: true, message: '请选择账号状态' }]">
-        <a-switch v-model="form.state" :checked-value="1" :unchecked-value="0" />
+        <a-switch v-model="form.state" checked-value="1" unchecked-value="0" />
       </a-form-item>
       <a-form-item>
         <a-button @click="evSwitch">取消</a-button>