| | |
| | | <div class="title">掌控智飞</div> |
| | | <div class="user-name"> |
| | | <image :src="usernameSvg"/> |
| | | <input |
| | | v-model="loginForm.username" |
| | | placeholder="请输入用户名" |
| | | /> |
| | | <input v-model="loginForm.username" placeholder="请输入用户名" /> |
| | | |
| | | </div> |
| | | <div class="pass-word"> |
| | | <image :src="passwordSvg"/> |
| | | <input |
| | | v-model="loginForm.password" |
| | | type="password" |
| | | placeholder="请输入密码" |
| | | /> |
| | | <input v-model="loginForm.password" type="password" placeholder="请输入密码" /> |
| | | </div> |
| | | |
| | | <button class="login-btn" :style="[inputStyle]" @tap="submit"> |
| | |
| | | |
| | | <script setup> |
| | | import md5 from "js-md5"; |
| | | import {loginByUsername} from "@/api/user/index.js"; |
| | | import {useUserStore} from "@/store/index.js"; |
| | | import { |
| | | loginByUsername |
| | | } from "@/api/user/index.js"; |
| | | import { |
| | | useUserStore |
| | | } from "@/store/index.js"; |
| | | import droneSvg from '@/static/images/login/droneSvg.svg' |
| | | import usernameSvg from '@/static/images/login/username.svg' |
| | | import passwordSvg from '@/static/images/login/password.svg' |
| | | import logoSvg from '@/static/images/login/logo.svg' |
| | | import {HOME_PATH, LOGIN_PATH, removeQueryString} from "@/router"; |
| | | import { |
| | | HOME_PATH, |
| | | LOGIN_PATH, |
| | | removeQueryString |
| | | } from "@/router"; |
| | | |
| | | const userStore = useUserStore(); |
| | | const loginForm = ref({ |
| | | username: "", |
| | | password: "", |
| | | username: "zhx", |
| | | password: "123456", |
| | | }); |
| | | const inputStyle = computed(() => { |
| | | const style = {}; |
| | |
| | | code: "", |
| | | key: "", |
| | | }; |
| | | loginByUsername( |
| | | try { |
| | | const res = await loginByUsername( |
| | | userInfo.tenantId, |
| | | userInfo.deptId, |
| | | userInfo.roleId, |
| | |
| | | userInfo.type, |
| | | userInfo.key, |
| | | userInfo.code |
| | | ).then((res) => { |
| | | ); |
| | | userStore.setUserInfo(res.data); |
| | | uni.reLaunch({ |
| | | url: "/pages/user/index", |
| | | }); |
| | | } catch (error) { |
| | | uni.showToast({ |
| | | title: error.data.error_description, |
| | | icon: "none", |
| | | duration: 2000 |
| | | }); |
| | | |
| | | } |
| | | } |
| | | |
| | | onLoad((options) => { |
| | |
| | | text-align: center; |
| | | margin-bottom: 168rpx; |
| | | } |
| | | .user-name,.pass-word { |
| | | |
| | | .user-name, |
| | | .pass-word { |
| | | display: flex; |
| | | //justify-content: center; |
| | | align-items: center; |
| | |
| | | margin-right: 58rpx; |
| | | height: 118rpx; |
| | | border-bottom: 2rpx solid #E3E3E3; |
| | | |
| | | image { |
| | | width: 40rpx; |
| | | height: 40rpx; |
| | | margin-right: 12rpx; |
| | | } |
| | | |
| | | :deep(uni-input) { |
| | | height: 40rpx; |
| | | line-height: 40rpx; |
| | | width: 80%; |
| | | margin-top: 20rpx; |
| | | } |
| | | |
| | | :deep(.uni-input-placeholder) { |
| | | font-size: 32rpx; |
| | | color: #E3E3E3; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | //:deep(.uni-input-input) { |
| | | // top: 10px !important; |
| | | //} |
| | | } |
| | | .pass-word { |
| | | } |
| | | |
| | | .pass-word {} |
| | | |
| | | input { |
| | | @apply pb-6rpx mb-10rpx text-left; |