| | |
| | | <image class="login_bg" src="@/static/login_bg@2x.png" /> |
| | | <image class="login_logo" src="@/static/logo@2x.png" mode="widthFix" /> |
| | | <view class="login_title" style="marginTop: 40rpx;">安泰物流智慧园区</view> |
| | | <view class="login_title" style="marginBottom: 80rpx;">物流车管理系统</view> |
| | | <view class="login_title" style="marginBottom: 60rpx;">数字化月台调度平台</view> |
| | | <view class="login_list"> |
| | | <view class="login_list_item"> |
| | | <image src="@/static/login_ic_phone@2x.png" mode="widthFix" /> |
| | |
| | | data() { |
| | | return { |
| | | form: { |
| | | account: '', |
| | | password: '', |
| | | username: '13996529050', |
| | | password: '123456', |
| | | }, |
| | | isShowProtocol: false, |
| | | ProtocolFlag: false, |
| | |
| | | }, |
| | | |
| | | onLoad() { |
| | | // this.initCaptcha() |
| | | this.initCaptcha() |
| | | }, |
| | | |
| | | methods: { |
| | | ...mapMutations(["setToken", "setUserInfo"]), |
| | | changeFalg() { |
| | | this.ProtocolFlag = !this.ProtocolFlag |
| | | }, |
| | | onLogin() { |
| | | const { form, ProtocolFlag } = this |
| | | if (!form.username) return uni.showToast({ |
| | | title: '账号不能为空', |
| | | icon: 'none' |
| | | }) |
| | | if (!form.password) return uni.showToast({ |
| | | title: '密码不能为空', |
| | | icon: 'none' |
| | | }) |
| | | loginPost({ |
| | | ...form, |
| | | code: 1, |
| | | uuid: this.captcha.uuid, |
| | | openId: this.$store.state.openId |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | this.setToken(res.data) |
| | | getUserInfo().then(ress => { |
| | | this.setUserInfo(ress.data) |
| | | uni.redirectTo({ |
| | | url: "/pages/index/index" |
| | | }) |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | getContent() { |
| | | getSystemDictData({ |
| | |
| | | this.captcha = res.data |
| | | }) |
| | | }, |
| | | |
| | | onLogin() { |
| | | const { form, ProtocolFlag } = this |
| | | if (!ProtocolFlag) return uni.showToast({ |
| | | title: '请先阅读并同意用户协议', |
| | | icon: 'none' |
| | | }) |
| | | if (!form.username) return uni.showToast({ |
| | | title: '账号不能为空', |
| | | icon: 'none' |
| | | }) |
| | | if (!form.password) return uni.showToast({ |
| | | title: '密码不能为空', |
| | | icon: 'none' |
| | | }) |
| | | if (!form.code) return uni.showToast({ |
| | | title: '验证码不能为空', |
| | | icon: 'none' |
| | | }) |
| | | loginPost({ |
| | | ...form, |
| | | uuid: this.captcha.uuid, |
| | | openId: this.$store.state.openId |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | this.setToken(res.data) |
| | | getUserInfo().then(ress => { |
| | | this.setUserInfo(ress.data) |
| | | uni.redirectTo({ |
| | | url: "/pages/staff/index" |
| | | }) |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <style lang="scss" scoped> |
| | | .login { |
| | | width: 100%; |
| | | height: 100vh; |
| | | display: flex; |
| | | padding-top: 160rpx; |
| | | padding-top: 100rpx; |
| | | box-sizing: border-box; |
| | | align-items: center; |
| | | flex-direction: column; |