From 9a76b87c9c4e3b1035324eefcaf1bb07d653d8d5 Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期一, 28 十月 2024 10:11:53 +0800 Subject: [PATCH] Web 用户端 --- src/layout/component/sidebar/components/MenuList.vue | 61 ++++++++++++++++++------------ 1 files changed, 37 insertions(+), 24 deletions(-) diff --git a/src/layout/component/sidebar/components/MenuList.vue b/src/layout/component/sidebar/components/MenuList.vue index e841cf2..8cd4165 100644 --- a/src/layout/component/sidebar/components/MenuList.vue +++ b/src/layout/component/sidebar/components/MenuList.vue @@ -21,14 +21,14 @@ ><span class="user_name"> {{ userName }} </span></span ><span ref="toggleExitLoginBtnRef" ><span - class="ywicon text-white" - :class="{ 'icon-fold': !state.isShowExitLogin, 'icon-unfold': state.isShowExitLogin }" + class="ywifont text-white" + :class="{ 'ywicon-fold': !state.isShowExitLogin, 'ywicon-unfold': state.isShowExitLogin }" @click="toggleShowExitLogin" ></span ></span> </div> <div class="pop_up actived" v-show="state.isShowExitLogin"> - <div class="exit" @click="logoutClick"><i class="ywicon icon-tuichu"></i> 閫�鍑虹櫥褰�</div> + <div class="exit" @click="logoutClick"><i class="ywifont ywicon-tuichu"></i> 閫�鍑虹櫥褰�</div> </div> </div> <div v-else class="user_login"> @@ -40,8 +40,8 @@ <div class="pc-login items-center justify-center" style="display: flex" v-show="state.isShowLogin"> <div class="login_box"> <div class="sign_in"> - <i class="ywicon icon-guanbi closes" @click="handleClose"></i> - <h1><span>鐧诲綍 WI 姘村姟</span></h1> + <i class="ywifont ywicon-guanbi closes" @click="handleClose"></i> + <h1><span>鐧诲綍 WI 姘村姟鏅鸿兘</span></h1> <el-tabs v-model="state.activeLoginName" class="mt-[24px]" @tab-change="handleUserClick"> <el-tab-pane label="璐︽埛瀵嗙爜鐧诲綍" name="accountUser"> <el-form @@ -94,7 +94,7 @@ </template> <script setup lang="ts"> -import type { FormInstance } from 'element-plus'; +import { ElMessage, type FormInstance } from 'element-plus'; import { computed, onMounted, reactive, ref, watchEffect } from 'vue'; import { PostLogin, loginMessageUser, loginVerifyMessage } from '/@/api/ai/user'; import router from '/@/router'; @@ -114,23 +114,23 @@ }); let state = reactive({ asideTitleList: [ - { - id: 1, - icon: '/static/images/wave/AsideIcon.png', - title: '搴旂敤鍦烘櫙', - routerName: 'AllScenario', - }, - { - id: 2, - icon: '/static/images/wave/AsideIcon.png', - title: '甯姪涓績', - // routerName:'Scenario', - }, - { - id: 3, - icon: '/static/images/wave/AsideIcon.png', - title: '涓汉璁剧疆', - }, + // { + // id: 1, + // icon: '/static/images/wave/AsideIcon.png', + // title: '搴旂敤鍦烘櫙', + // routerName: 'AllScenario', + // }, + // { + // id: 2, + // icon: '/static/images/wave/AsideIcon.png', + // title: '甯姪涓績', + // // routerName:'Scenario', + // }, + // { + // id: 3, + // icon: '/static/images/wave/AsideIcon.png', + // title: '涓汉璁剧疆', + // }, { id: 4, icon: '/static/images/wave/AsideIcon.png', @@ -162,8 +162,11 @@ verifyCode: [{ required: true, message: '璇疯緭鍏ラ獙璇佺爜', trigger: 'blur' }], }; const handleClick = (item) => { + if(!item.routerName) return; gotoRoute({ name: item.routerName }); }; +const LOGIN_CLIENT = 'Web 鐢ㄦ埛绔�'; + //鐧诲綍 const openLoginDlg = async () => { state.isShowLogin = true; @@ -180,7 +183,12 @@ const res = await PostLogin({ user: state.loginForm.account, pass: state.loginForm.pwd, + client: LOGIN_CLIENT, + }); + if (!res.json_ok) { + return ElMessage.error(res.json_msg); + } LoginInfo.set(res.hswatersession, state.loginForm.account); } else if (state.activeLoginName === 'phoneUser') { @@ -190,10 +198,15 @@ const res = await loginMessageUser({ phone: state.loginPhoneForm.phoneUser, code: state.loginPhoneForm.verifyCode, - }); + client: LOGIN_CLIENT, + }); + if (!res.json_ok) { + return ElMessage.error(res.json_msg); + } LoginInfo.set(res.hswatersession, state.loginPhoneForm.phoneUser); } + state.isShowLogin = false; isLoginStatus.value = true; window.location.reload(); -- Gitblit v1.9.3