diff --git a/app/controller/admin/auth/AuthController.php b/app/controller/admin/auth/AuthController.php index 5f04391..e8321b2 100644 --- a/app/controller/admin/auth/AuthController.php +++ b/app/controller/admin/auth/AuthController.php @@ -46,14 +46,14 @@ class AuthController extends BaseController public function unlock() { $client = $this->request->getClient(); - $lock_password = $this->request->post('lock_password'); + $password = $this->request->post('password'); $clientModel = SysUserClient::where([ 'client_id' => $client->id, 'client_name'=> $client->name, 'user_id' => $this->auth->userId, ])->find(); if($clientModel) { - if($clientModel['lock_password'] !== $lock_password) { + if($clientModel['lock_password'] !== $password) { return $this->writeSuccess('密码错误'); } $clientModel->save(['is_lock'=>0,'lock_password'=>'','lock_time'=>null]); diff --git a/z_ele/src/api/layout/index.ts b/z_ele/src/api/layout/index.ts index 5b0c956..02e4e2d 100644 --- a/z_ele/src/api/layout/index.ts +++ b/z_ele/src/api/layout/index.ts @@ -2,7 +2,13 @@ import request from '@/utils/request'; import type { ApiResult } from '@/api'; import type { User } from '@/api/system/user/model'; import type { UpdatePasswordParam } from './model'; - +export async function clientScreenUnlock(data) { + const res = await request.post>('/auth/unlock', data); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} /** * 退出登录 */ diff --git a/z_ele/src/components/LockScreenState/index.vue b/z_ele/src/components/LockScreenState/index.vue index 3948492..ca81b62 100644 --- a/z_ele/src/components/LockScreenState/index.vue +++ b/z_ele/src/components/LockScreenState/index.vue @@ -34,10 +34,13 @@