| | |
| | | </view> |
| | | <view class="bg_w rd8 ptb30 pl40 bbox mt40 flex input-height"> |
| | | <image src="@/static/login_ic_phone@2x.png" mode="" class="img40 mr25"></image> |
| | | <u--input placeholder="手机号" border="none" v-model="loginForm.account"></u--input> |
| | | <u--input placeholder="手机号" border="none" v-model="loginForm.username"></u--input> |
| | | </view> |
| | | <view class="bg_w rd8 ptb30 pl40 bbox mt40 flex input-height"> |
| | | <image src="@/static/login_ic_password@2x.png" mode="" class="img40 mr25"></image> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { wxAccountLogin, getUserInfo } from '@/util/api/index.js' |
| | | export default { |
| | | data() { |
| | | return { |
| | | loginForm: { |
| | | companyId: '', |
| | | account: '', |
| | | username: '', |
| | | password: '' |
| | | } |
| | | }; |
| | | }, |
| | | methods: { |
| | | loginAction() { |
| | | uni.reLaunch({ |
| | | url: '/pages/workbench/workbench' |
| | | async loginAction() { |
| | | if (!this.loginForm.companyId) return uni.showToast({ title: '企业代码不能为空', icon:"error", duration: 2000 }); |
| | | if (!this.loginForm.username) return uni.showToast({ title: '手机号不能为空', icon:"error", duration: 2000 }); |
| | | if (!this.loginForm.password) return uni.showToast({ title: '密码不能为空', icon:"error", duration: 2000 }); |
| | | let res = await wxAccountLogin({ |
| | | companyId: this.loginForm.companyId, |
| | | username: this.loginForm.username, |
| | | password: this.loginForm.password |
| | | }) |
| | | if (res.code === 200) { |
| | | let user = await getUserInfo({}) |
| | | if (user.code === 200) { |
| | | await this.$store.commit('SETUSERINFO', user.data) |
| | | await this.$store.dispatch('getMenuList', 2) |
| | | uni.reLaunch({ |
| | | url: '/pages/workbench/workbench' |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | height: 100%; |
| | | } |
| | | .login-log { |
| | | // margin-top: ; |
| | | margin: 356rpx auto 0 auto ; |
| | | left: 0; |
| | | right: 0; |
| | |
| | | } |
| | | } |
| | | .input-height { |
| | | height: 100rpx; |
| | | height: 100rpx; |
| | | } |
| | | .com-input { |
| | | margin-top: -60px; |