| | |
| | | <div class="top"> |
| | | <div class="header"> |
| | | <img alt="logo" class="logo" src="@/assets/img/logo.png" /> |
| | | <span class="title">{{systemName}}</span> |
| | | <span class="title">{{ systemName }}</span> |
| | | </div> |
| | | <div class="desc">智能化文件管理平台 让文件管理更简单</div> |
| | | </div> |
| | | <div class="login"> |
| | | <a-form @submit="onSubmit" :form="form"> |
| | | <a-tabs size="large" :tabBarStyle="{textAlign: 'center'}" style="padding: 0 2px;"> |
| | | <a-tabs |
| | | size="large" |
| | | :tabBarStyle="{ textAlign: 'center' }" |
| | | style="padding: 0 2px" |
| | | > |
| | | <a-tab-pane tab="账户密码登录" key="1"> |
| | | <a-alert type="error" :closable="true" v-show="error" :message="error" showIcon style="margin-bottom: 24px;" /> |
| | | <a-alert |
| | | type="error" |
| | | :closable="true" |
| | | v-show="error" |
| | | :message="error" |
| | | showIcon |
| | | style="margin-bottom: 24px" |
| | | /> |
| | | <a-form-item> |
| | | <a-input |
| | | autocomplete="autocomplete" |
| | | size="large" |
| | | placeholder="请输入账户名" |
| | | v-decorator="['name', {rules: [{ required: true, message: '请输入账户名', whitespace: true}]}]" |
| | | v-decorator="[ |
| | | 'name', |
| | | { |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入账户名', |
| | | whitespace: true, |
| | | }, |
| | | ], |
| | | }, |
| | | ]" |
| | | > |
| | | <a-icon slot="prefix" type="user" /> |
| | | </a-input> |
| | |
| | | placeholder="请输入密码" |
| | | autocomplete="autocomplete" |
| | | type="password" |
| | | v-decorator="['password', {rules: [{ required: true, message: '请输入密码', whitespace: true}]}]" |
| | | v-decorator="[ |
| | | 'password', |
| | | { |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入密码', |
| | | whitespace: true, |
| | | }, |
| | | ], |
| | | }, |
| | | ]" |
| | | > |
| | | <a-icon slot="prefix" type="lock" /> |
| | | </a-input> |
| | |
| | | </a-tab-pane> |
| | | <a-tab-pane tab="手机号登录" key="2" :disabled="true"> |
| | | <a-form-item> |
| | | <a-input size="large" placeholder="mobile number" > |
| | | <a-input size="large" placeholder="mobile number"> |
| | | <a-icon slot="prefix" type="mobile" /> |
| | | </a-input> |
| | | </a-form-item> |
| | |
| | | </a-input> |
| | | </a-col> |
| | | <a-col :span="8" style="padding-left: 4px"> |
| | | <a-button style="width: 100%" class="captcha-button" size="large">获取验证码</a-button> |
| | | <a-button |
| | | style="width: 100%" |
| | | class="captcha-button" |
| | | size="large" |
| | | >获取验证码</a-button |
| | | > |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-item> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | <div> |
| | | <a-checkbox :checked="true" >自动登录</a-checkbox> |
| | | <a-checkbox :checked="true">自动登录</a-checkbox> |
| | | <a @click="faceLogin()">人脸登录</a> |
| | | <a style="float: right">忘记密码</a> |
| | | </div> |
| | | <a-form-item> |
| | | <a-button :loading="logging" style="width: 100%;margin-top: 24px" size="large" htmlType="submit" type="primary">登录</a-button> |
| | | <a-button |
| | | :loading="logging" |
| | | style="width: 100%; margin-top: 24px" |
| | | size="large" |
| | | htmlType="submit" |
| | | type="primary" |
| | | >登录</a-button |
| | | > |
| | | </a-form-item> |
| | | </a-form> |
| | | </div> |
| | | |
| | | <a-modal v-model="faceVisible" title="人脸登录"> |
| | | <template #footer> |
| | | <a-button key="back" @click="{faceVisible = false}">关闭</a-button> |
| | | <a-button |
| | | key="back" |
| | | @click=" |
| | | { |
| | | faceVisible = false; |
| | | } |
| | | " |
| | | >关闭</a-button |
| | | > |
| | | </template> |
| | | <face-login |
| | | v-if="faceVisible" |
| | | :visible.sync="faceVisible" |
| | | @success="faceSuccess" |
| | | ></face-login> |
| | | <face-login |
| | | v-if="faceVisible" |
| | | :visible.sync="faceVisible" |
| | | @success="faceSuccess" |
| | | ></face-login> |
| | | </a-modal> |
| | | </common-layout> |
| | | </template> |
| | |
| | | }, |
| | | methods: { |
| | | ...mapMutations('account', ['setUser', 'setPermissions', 'setRoles', 'setRoleList', |
| | | 'setDepartmentList', 'setProjectManagerList', 'setGeneralManagerList']), |
| | | 'setDepartmentList', 'setProjectManagerList', 'setGeneralManagerList', 'setPermits']), |
| | | onSubmit (e) { |
| | | let vm = this; |
| | | e.preventDefault() |
| | |
| | | this.logging = false |
| | | const loginRes = res.data |
| | | if (loginRes.code >= 0) { |
| | | const {user, permissions, roles, roleList, departmentList } = this.getData(loginRes.data2, loginRes.data3); |
| | | const {user, permissions, roles, roleList, departmentList, permits } = this.getData(loginRes.data2, loginRes.data3); |
| | | this.setUser(user); |
| | | this.setPermissions(permissions); |
| | | this.setRoles(roles); |
| | | this.setRoleList(roleList); |
| | | this.setDepartmentList(departmentList); |
| | | this.setPermits(permits); |
| | | this.getUserByRoleId(1002); |
| | | this.getUserByRoleId(1003); |
| | | |
| | |
| | | item.value = item.id; |
| | | return item; |
| | | }), |
| | | permits: data3.permits.map((v) => v.permitId), |
| | | } |
| | | return obj; |
| | | }, |
| | |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .common-layout{ |
| | | .top { |
| | | text-align: center; |
| | | .header { |
| | | height: 44px; |
| | | line-height: 44px; |
| | | a { |
| | | text-decoration: none; |
| | | } |
| | | .logo { |
| | | height: 44px; |
| | | vertical-align: top; |
| | | margin-right: 16px; |
| | | } |
| | | .title { |
| | | font-size: 33px; |
| | | color: @title-color; |
| | | font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif; |
| | | font-weight: 600; |
| | | position: relative; |
| | | top: 2px; |
| | | } |
| | | .common-layout { |
| | | .top { |
| | | text-align: center; |
| | | .header { |
| | | height: 44px; |
| | | line-height: 44px; |
| | | a { |
| | | text-decoration: none; |
| | | } |
| | | .desc { |
| | | font-size: 14px; |
| | | color: @text-color-second; |
| | | margin-top: 12px; |
| | | margin-bottom: 40px; |
| | | .logo { |
| | | height: 44px; |
| | | vertical-align: top; |
| | | margin-right: 16px; |
| | | } |
| | | .title { |
| | | font-size: 33px; |
| | | color: @title-color; |
| | | font-family: "Myriad Pro", "Helvetica Neue", Arial, Helvetica, |
| | | sans-serif; |
| | | font-weight: 600; |
| | | position: relative; |
| | | top: 2px; |
| | | } |
| | | } |
| | | .login{ |
| | | width: 368px; |
| | | margin: 0 auto; |
| | | @media screen and (max-width: 576px) { |
| | | width: 95%; |
| | | .desc { |
| | | font-size: 14px; |
| | | color: @text-color-second; |
| | | margin-top: 12px; |
| | | margin-bottom: 40px; |
| | | } |
| | | } |
| | | .login { |
| | | width: 368px; |
| | | margin: 0 auto; |
| | | @media screen and (max-width: 576px) { |
| | | width: 95%; |
| | | } |
| | | @media screen and (max-width: 320px) { |
| | | .captcha-button { |
| | | font-size: 14px; |
| | | } |
| | | @media screen and (max-width: 320px) { |
| | | .captcha-button{ |
| | | font-size: 14px; |
| | | } |
| | | } |
| | | .icon { |
| | | font-size: 24px; |
| | | color: @text-color-second; |
| | | margin-left: 16px; |
| | | vertical-align: middle; |
| | | cursor: pointer; |
| | | transition: color 0.3s; |
| | | } |
| | | .icon { |
| | | font-size: 24px; |
| | | color: @text-color-second; |
| | | margin-left: 16px; |
| | | vertical-align: middle; |
| | | cursor: pointer; |
| | | transition: color 0.3s; |
| | | |
| | | &:hover { |
| | | color: @primary-color; |
| | | } |
| | | &:hover { |
| | | color: @primary-color; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |