| | |
| | | ><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"> |
| | |
| | | <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> |
| | | <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"> |
| | |
| | | }); |
| | | 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', |
| | |
| | | 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; |
| | |
| | | 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') { |
| | |
| | | const res = await loginMessageUser({ |
| | | phone: state.loginPhoneForm.phoneUser, |
| | | code: state.loginPhoneForm.verifyCode, |
| | | client: LOGIN_CLIENT, |
| | | |
| | | }); |
| | | if (!res.json_ok) { |
| | | return ElMessage.warning(res.json_msg); |
| | | return ElMessage.error(res.json_msg); |
| | | } |
| | | LoginInfo.set(res.hswatersession, state.loginPhoneForm.phoneUser); |
| | | } |
| | | |
| | | state.isShowLogin = false; |
| | | isLoginStatus.value = true; |
| | | window.location.reload(); |