| | |
| | | @click="gotoIndex"></u-button> |
| | | </view> |
| | | |
| | | <u-modal :show="isShow" :showCancelButton="isShowCancelButton" :showConfirmButton='false' title="" |
| | | @confirm='isShowConfirm' @cancel='isShowCancel'> |
| | | <view> |
| | | <view> |
| | | <u--text type="info" :size='32' :block='false' text="当前版本不是最新版本,请点击"></u--text> |
| | | </view> |
| | | <view> |
| | | <u--text :block='false' mode="link" :size='50' text="链接下载" :href="downloadUrl"></u--text> |
| | | </view> |
| | | </view> |
| | | </u-modal> |
| | | |
| | | </view> |
| | | |
| | |
| | | import { |
| | | LoginSave, |
| | | ForcedOffline, |
| | | AppUpgrade |
| | | } from '../../config/api.js'; |
| | | import { |
| | | decode |
| | | } from 'jsonwebtoken'; |
| | | export default { |
| | | data() { |
| | | return { |
| | | // #ifdef H5 |
| | | usercode: '999', |
| | | usercode: '', |
| | | // #endif |
| | | |
| | | // #ifdef APP-PLUS |
| | | usercode: '999', |
| | | usercode: '', |
| | | // #endif |
| | | |
| | | userpassword: '123', |
| | | userpassword: '', |
| | | isView: false, //密码是否可见 |
| | | |
| | | |
| | | |
| | | isDisabledSubmitButton: false, //提交按钮是否处于加载中 |
| | | |
| | | |
| | | isShowCancelButton: false, |
| | | isShowCancelButton: true, |
| | | isShow: false, |
| | | downloadUrl: '', //下载地址 |
| | | |
| | |
| | | |
| | | }, |
| | | created() { |
| | | |
| | | this.getAppUpgrade() |
| | | }, |
| | | mounted() { |
| | | |
| | | }, |
| | | methods: { |
| | | getAppUpgrade() { |
| | | AppUpgrade().then(res => { |
| | | this.isShow = res.data[0].version !== this.$appVersion |
| | | if (res.data[0].version !== this.$appVersion) { // 说明与最新版本不匹配 |
| | | this.downloadUrl = this.$baseUrl.substring(0, 25) + '/APK/JLAPP.apk' |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | //密码是否查看 显示明文 |
| | | isViewClick() { |
| | | this.isView = !this.isView |
| | |
| | | LoginSave({ |
| | | params: data |
| | | }).then(result => { |
| | | console.log(result.data) |
| | | if (result.code === '200') { |
| | | uni.setStorageSync("Token", result.data) |
| | | |
| | | // uni.setStorageSync("usercode", result.data.usercode) |
| | | // uni.setStorageSync("username", result.data.username) |
| | | |
| | | const jwt = decode(result.data) |
| | | uni.setStorageSync("usercode", jwt.usercode) |
| | | uni.setStorageSync("username", jwt.username) |
| | | uni.setStorageSync("storg_code", jwt.storg_code) |
| | | uni.setStorageSync("storg_name", jwt.storg_name) |
| | | uni.redirectTo({ |
| | | //关闭当前页面,跳转到应用内的某个页面。 |
| | | url: '../xtsy/index' |
| | | }); |
| | | // uni.$u.toast(result.Message) |
| | | } else if (result.code === '302') { |
| | | const data2 = { |
| | | // token: uni.getStorageSync('Token'), |
| | | token: result.data, |
| | | rid: '' |
| | | } |
| | | ForcedOffline('', { |
| | | params: data2 |
| | | }).then(res2 => { |
| | | if (res2.code === '200') { |
| | | console.log('成功了!') |
| | | uni.redirectTo({ |
| | | //关闭当前页面,跳转到应用内的某个页面。 |
| | | url: '../xtsy/index' |
| | | }); |
| | | } |
| | | }) |
| | | } else { |
| | | } |
| | | |
| | | // else if (result.code === '302') { |
| | | // const data2 = { |
| | | // // token: uni.getStorageSync('Token'), |
| | | // token: result.data, |
| | | // rid: '' |
| | | // } |
| | | // const jwt = decode(result.data) |
| | | // console.log(jwt, 2) |
| | | // uni.setStorageSync("usercode", jwt.usercode) |
| | | // uni.setStorageSync("username", jwt.username) |
| | | // uni.setStorageSync("storg_code", jwt.storg_code) |
| | | // uni.setStorageSync("storg_name", jwt.storg_name) |
| | | |
| | | // ForcedOffline('', { |
| | | // params: data2 |
| | | // }).then(res2 => { |
| | | // if (res2.code === '200') { |
| | | // uni.redirectTo({ |
| | | // //关闭当前页面,跳转到应用内的某个页面。 |
| | | // url: '../xtsy/index' |
| | | // }); |
| | | // } |
| | | // }) |
| | | // } |
| | | else { |
| | | this.isDisabledSubmitButton = false |
| | | } |
| | | }) |