flying-monkey/pages/guide-page/guide-page.vue

57 lines
1.6 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<view :style="{height: windowHeight+'px'}" style="overflow: hidden;">
<image src="/static/public/icon-guide.png" mode="widthFix" style="width: 100%;"></image>
</view>
</template>
<script>
export default {
data() {
return {
windowHeight:uni.getSystemInfoSync().windowHeight
}
},
onLoad() {
this.checkContext();
},
methods: {
checkContext(){
if(uni.getStorageSync('password')) {
// 是否登录过登录过就直接刷新token重新登录
let params = {
login_type: 'account', // 登陆手机类型: mobile手机登陆、account账号密码登陆
phone: '', // 手机号码login_type 为 mobile 时必填
password: uni.getStorageSync('password'), // 密码login_type 为 account 时必填
sms_code: '', // 短信验证码login_type 为 mobile 时必填
username: uni.getStorageSync('phone'), //账号login_type 为 account 时必填
affiliation: uni.getStorageSync('unitName') // 单位名称
}
this.$requst.post('/universal/api.login/login',params).then(res=>{
if(res.code==1) {
// 缓存token和角色类型
uni.setStorageSync('token',res.data.token);
} else {
this.$toolAll.tools.showToast(res.msg);
}
})
this.goPage(1);
} else {
this.goPage(0);
}
},
// 跳转页面
goPage(index) {
let arr = [
'/pages/login/login',
'/pages/tabbar/pagehome/pagehome'
]
setTimeout(()=>{uni.reLaunch({url:arr[index]})},3000)
}
}
}
</script>
<style>
page{background-color: #FFFFFF;}
</style>