| | |
| | | this.showAuth = false |
| | | this.loadSettings() |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | this.$showToast({ |
| | | type: 'error', |
| | | message: this.$t('settings.authError') || '密码错误' |
| | | }) |
| | |
| | | settings = { |
| | | ip: '127.0.0.1', |
| | | port: '8080', |
| | | project: 'jshdasrs' |
| | | project: 'wms' |
| | | } |
| | | } |
| | | this.settings = settings |
| | |
| | | uni.setStorageSync('app_settings', this.settings) |
| | | console.log(this.settings) |
| | | this.showSettings = false |
| | | this.$refs.uToast.show({ |
| | | this.$showToast({ |
| | | type: 'success', |
| | | position: 'top', |
| | | duration: '1000', |
| | | message: this.$t('settings.saved') || '设置已保存' |
| | | }) |
| | | }, |
| | | async onLogin() { |
| | | try { |
| | | const res = await login( |
| | | const { data } = await login( |
| | | { |
| | | username: this.user.userName, |
| | | password: md5.hex_md5(this.user.password) |
| | |
| | | |
| | | this.loading = true |
| | | this.loginButton = 'login.loging' |
| | | uni.setStorageSync('token', res.data.accessToken) |
| | | uni.setStorageSync('userData', res.data.username) |
| | | uni.setStorageSync('token', data.token) |
| | | uni.setStorageSync('userData', data.username) |
| | | if (this.remberPassword) { |
| | | uni.setStorageSync('user', this.user) |
| | | } else { |
| | |
| | | }, |
| | | goHome() { |
| | | setTimeout(() => { |
| | | this.$refs.uToast.show({ |
| | | this.$showToast({ |
| | | type: 'success', |
| | | message: '登录成功', |
| | | position: 'top' |