APP登录

This commit is contained in:
Vinjor 2024-10-16 17:14:49 +08:00
parent 74c7cf99a6
commit 79969b5827
9 changed files with 354 additions and 386 deletions

View File

@ -79,13 +79,13 @@ export function loginAppuserName(data) {
}) })
} }
// 使用租户域名(标识),获得租户编号 // 使用手机号查询所在的租户获得租户编号
export function getTenantIdByWebsite(website) { export function getTenantIdByPhone(phone) {
return request({ return request({
url: '/admin-api/system/tenant/getListByWebsite', url: '/app-api/system/user/getListByPhone',
method: 'get', method: 'get',
params: { params: {
website phone
} }
}) })
} }

View File

@ -14,13 +14,13 @@
</view> </view>
<view class="">工单处理</view> <view class="">工单处理</view>
</view> </view>
<view class="box" :class="{active: aindex == 3}" @click="getgogo(3)"> <!-- <view class="box" :class="{active: aindex == 3}" @click="getgogo(3)">-->
<view class="imgs"> <!-- <view class="imgs">-->
<image mode="aspectFit" src="@/static/icons/tabbar/my.png" v-show="aindex != 3"></image> <!-- <image mode="aspectFit" src="@/static/icons/tabbar/my.png" v-show="aindex != 3"></image>-->
<image mode="aspectFit" src="@/static/icons/tabbar/my-checked.png" v-show="aindex == 3"></image> <!-- <image mode="aspectFit" src="@/static/icons/tabbar/my-checked.png" v-show="aindex == 3"></image>-->
</view> <!-- </view>-->
<view class="">我的</view> <!-- <view class="">我的</view>-->
</view> <!-- </view>-->
</view> </view>
</template> </template>

View File

@ -1,7 +1,7 @@
// 应用全局配置 // 应用全局配置
module.exports = { module.exports = {
baseUrl: 'https://www.nuoyunr.com', // baseUrl: 'https://www.nuoyunr.com',
// baseUrl: 'http://192.168.1.4:48080', baseUrl: 'http://192.168.1.17:48080',
// baseUrl: "http://localhost:48080", // baseUrl: "http://localhost:48080",
imagesUrl: 'http://shequ.0315e.com/static/images/pages/', imagesUrl: 'http://shequ.0315e.com/static/images/pages/',
baseImageUrl: 'https://www.nuoyunr.com/minio/', baseImageUrl: 'https://www.nuoyunr.com/minio/',

View File

@ -3,13 +3,14 @@
<!--<VNavigationBar style="position: relative;z-index: 99;" leftTitle="true" backgroundColor="rgba(0,0,0,0)" title-color="#fff" title=" "></VNavigationBar>--> <!--<VNavigationBar style="position: relative;z-index: 99;" leftTitle="true" backgroundColor="rgba(0,0,0,0)" title-color="#fff" title=" "></VNavigationBar>-->
<view class="bodyTopBg"></view> <view class="bodyTopBg"></view>
<view class="body"> <view class="body">
<view class="userInfoBox"> <view class="userInfoBox" @click="showUserDetail">
<image style="width: 104rpx;height: 104rpx" :src="userInfo.avatarUrl || defaultAvatar" mode="aspectFill" @error="avatarErr"></image> <image style="width: 104rpx;height: 104rpx;border-radius: 50%;" v-if="''==userInfo.avatar || null == userInfo.avatar" :src="defaultAvatar" mode="scaleToFill" @error="avatarErr"></image>
<image style="width: 104rpx;height: 104rpx;border-radius: 50%;" v-else :src="imgUrlPrex+userInfo.avatar" mode="scaleToFill" @error="avatarErr"></image>
<view class="userInfo"> <view class="userInfo">
<text class="userName">{{ userInfo.userName }}</text> <text class="userName">{{ userInfo.nickname }}</text>
<text class="userType">{{ userInfo.userType }}</text> <!-- <text class="userType">{{ userInfo.userType }}</text>-->
</view> </view>
<image @click="showUserDetail" style="width: 48rpx;height: 48rpx" src="/static/icons/more.png" mode="aspectFita"></image> <image style="width: 48rpx;height: 48rpx" src="/static/icons/more.png" mode="aspectFita"></image>
</view> </view>
<view class="body-top-grid"> <view class="body-top-grid">
<view v-for="(item, index) in menuList" :key="index" class="body-top-item" @click="gotoPage(item)"> <view v-for="(item, index) in menuList" :key="index" class="body-top-item" @click="gotoPage(item)">
@ -43,6 +44,11 @@
import tabBarVue from '@/components/tabBar/tabBar.vue' import tabBarVue from '@/components/tabBar/tabBar.vue'
import VNavigationBar from '@/components/VNavigationBar.vue' import VNavigationBar from '@/components/VNavigationBar.vue'
import OrderCard from "@/components/orderCard.vue"; import OrderCard from "@/components/orderCard.vue";
import config from '@/config'
import {
getToken,
getUserInfo
} from '@/utils/auth'
export default { export default {
components: { components: {
@ -52,10 +58,10 @@ export default {
}, },
data() { data() {
return { return {
imgUrlPrex:config.baseImageUrl,
userInfo: { userInfo: {
avatarUrl: undefined, avatar: undefined,
userName: '曾廷', nickname: '曾廷'
userType: '服务顾问'
}, },
menuList: [ menuList: [
{ {
@ -103,7 +109,15 @@ export default {
defaultAvatar: require('@/static/icons/avatar.png') defaultAvatar: require('@/static/icons/avatar.png')
} }
}, },
onShow() { onLoad() {
if(!getToken()){
uni.reLaunch({
url: '/pages/login/login'
})
}else{
//
this.userInfo = getUserInfo()
}
}, },
methods: { methods: {
gotoPage(menu) { gotoPage(menu) {
@ -113,7 +127,7 @@ export default {
}, },
avatarErr(err) { avatarErr(err) {
console.log('err', err) console.log('err', err)
this.userInfo.avatarUrl = this.defaultAvatar this.userInfo.avatar = this.defaultAvatar
}, },
showUserDetail() { showUserDetail() {
uni.navigateTo({ uni.navigateTo({

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -17,7 +17,7 @@
}, },
onLoad() { onLoad() {
uni.reLaunch({ uni.reLaunch({
url: '/pages-home/home/home' url: '/pages/login/login'
}) })
}, },
methods: { methods: {

View File

@ -1,61 +1,85 @@
<template> <template>
<view class="content"> <view class="content">
<!-- #ifdef APP-PLUS || H5 -->
<view class="kuang"> <view class="top">
<view class="land">您好</view> <view class="touxiang">
<view class="land">欢迎登录智修小助手</view> <image src="../../static/xinlogo.png" mode=""></image>
</view> </view>
<view class="xiaoannoi"> <view class="twotap">
<u-button v-if="privacyPolicyChecked == true" text="手机号快捷登录" class="dl" :customStyle="{color:'#ffffff'}" <view :class="{'blck':activeid == index}" v-for="(item,index) in qh " :key="index"
color="#0D2E8D" open-type='getPhoneNumber' @click="getxz(index)">{{item.text}}</view>
@getphonenumber="getPhone"></u-button>
<u-button v-else text="手机号快捷登录" class="dl" :customStyle="{color:'#ffffff'}"
color="#0D2E8D" @click="shibai()" ></u-button>
</view> </view>
<view class="inputs" v-if="activeid == 0 || activeid == 2 ">
<input type="text" v-model="tel" placeholder="请输入手机号">
</view>
<view class="inputs" v-if="activeid == 1">
<input type="text" v-model="tel" placeholder="请输入手机号">
</view>
<view class="inputs" style="justify-content: space-between; " v-if="activeid == 1">
<input type="text" v-model="yzm" placeholder="请输入验证码">
<button class="jsq" :disabled="isButtonDisabled" @click="sendVerificationCode">{{ buttonText }}</button>
</view>
<view class="inputs" v-if="activeid == 0 || activeid == 2 ">
<input type="password" v-model="wrod" placeholder="请输入密码">
</view>
<view class="wjworb" v-if="activeid == 0 || activeid == 2" @click="goforgot()">
<view class="">忘记密码</view>
</view>
</view>
<view class="dl" @click="getlogin()">
<text> </text>
</view>
<!-- #endif -->
<view class="dbottom"> <view class="dbottom">
<view class="quanzi" v-if="qindex == false " @click="qindex =! qindex"></view>
<view class="axquan" v-if="privacyPolicyChecked == false" @click="privacyPolicyChecked = true"></view> <view class="lanquanzi" v-if="qindex == true" @click="qindex =! qindex"><u-icon name="checkbox-mark"
<view class="axquanl" v-if="privacyPolicyChecked == true" @click="privacyPolicyChecked = false"> color="#ffffff" size="14"></u-icon></view>
<uni-icons type="checkmarkempty" color="#ffffff" size="14"></uni-icons> <text>请仔细阅读</text>
</view> <text class="lan">用户协议</text>
<text>请您认真阅读</text>
<text class="lan" @click="goPolicy()">用户协议</text>
<text></text> <text></text>
<text class="lan" @click="goPolicy()">隐私政策</text> <text class="lan">隐私政策</text>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import request from '../../utils/request'; import request from '@/utils/request';
import {setToken} from '@/utils/auth.js' import {
loginApp
} from '@/api/login';
import {
setToken,
setTenantId,
setUserInfo
} from '@/utils/auth'
import {
login,
getInfo,
getTenantIdByPhone
} from '@/api/login'
export default { export default {
data() { data() {
return { return {
yd : false, //
shenfen:'jcyh', sysCode:"weixiu",
show:false,
baseUrl:this.$baseUrl,
privacyPolicyChecked:false,
phoneNumber: "", phoneNumber: "",
baseUrl: this.$baseUrl,
isButtonDisabled: false, isButtonDisabled: false,
countdownTime: 60, countdownTime: 60,
qh:[ qh: [{
{text:'密码登录'}, text: '密码登录'
{text:'验证码登录'} },
], {
columns: [ text: '验证码登录'
['用户','代办' ] },
], ],
qindex: false,
tel: '', tel: '',
yzm: '', yzm: '',
wrod: '', wrod: '',
activeid: 0 activeid: 0
} }
}, },
onLoad() {
this.wxlogin()
},
computed: { computed: {
buttonText() { buttonText() {
if (this.isButtonDisabled) { if (this.isButtonDisabled) {
@ -65,80 +89,25 @@
} }
}, },
}, },
mounted() {},
methods: { methods: {
async getsxshenfen(){
let data = {
roleCode : this.shenfen
}
let res = await request({
url:'/appInspection/userOwn/updateRole',
method:'post',
params: data
})
if(res.code == 200){
uni.redirectTo({
url: '/pages/detection/my'
})
}
},
getshenfen(text){
this.shenfen = text
},
open() {
// console.log('open');
},
close() {
// this.show = false
// uni.reLaunch({
// url: '/pages/detection/my'
// })
// // console.log('close');
},
goPolicy() {
uni.navigateTo({
url: "/pages/login/PrivacyPolicy"
})
},
wxlogin() { wxlogin() {
uni.login({ uni.login({
provider: 'weixin', provider: 'weixin',
success(res) { success(res) {
console.log(543, res);
if (res.code) { if (res.code) {
uni.setStorageSync('c1', res.code); uni.setStorageSync('c1', res.code);
console.log('wxlogin:', res.code);
} else { } else {
console.log('登录失败!' + res.errMsg) console.log('登录失败!' + res.errMsg)
} }
} }
}) })
}, },
async getAppinfo(){ //
let res = await request({ getlogin() {
url:'/getAppInfo', if (this.qindex != true) {
method:'get',
})
console.log('getappinfo',res);
},
//
authorize() {
uni.showToast({
icon: "none",
title: "请阅读并勾选用户协议",
duration: 2000
})
},
shibai(){
uni.showToast({
icon: "none",
title: "请阅读并勾选用户协议",
duration: 2000
})
},
getPhone(e) {
console.log('执行了');
if (this.privacyPolicyChecked == false) {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
title: "请阅读并勾选用户协议", title: "请阅读并勾选用户协议",
@ -146,98 +115,91 @@
}) })
return; return;
} }
uni.checkSession({ if (this.tel == '') {
success: () => { uni.showToast({
uni.request({ title: '手机号不能为空!',
url: this.baseUrl + "/userClient/repair/wxLogin", icon: 'none'
method: "POST",
data: {
code: uni.getStorageSync('c1'),
encryptedIv: e.detail.iv,
encryptedData: e.detail.encryptedData,
inviteId: uni.getStorageSync('inviteId') ? uni.getStorageSync('inviteId') : null
},
success: (rex) => {
if (rex.data.code == 0) {
//token
setToken(rex.data.data.token)
if (rex.data.data.ifNeedFill) {
uni.reLaunch({
url: '/pages/my/register'
}) })
return
}
const loginFun = () => {
let data;
if (this.activeid == 1) {
//
data = {
phone: this.tel,
code: this.yzm,
type: 1,
sysCode:this.sysCode
}
} else { } else {
uni.reLaunch({ //
data = {
username: this.tel,
password: this.wrod,
type: 0,
sysCode:this.sysCode
}
}
request({
url: '/app-api/company/staff/loginApp',
method: 'post',
data: data
}).then((res) => {
console.log(res)
if (res.code == 200) {
uni.showToast({
title: '登录成功',
icon: 'none'
})
setToken(res.data.loginResult.accessToken)
setUserInfo(res.data.userinfo)
//
uni.navigateTo({
url: '/pages-home/home/home' url: '/pages-home/home/home'
}) })
}
}else{ }else{
uni.showToast({ uni.showToast({
icon: 'none', title: res.msg,
title: '登录失败,请联系管理人员' icon: 'none'
})
}
},
fail: (res) => {
console.log("fail", res);
uni.showToast({
icon: "error",
title: "登录失败,请重新点击并授权!",
duration: 2000
}) })
} }
}) })
}, }
fail: () => { //
uni.showToast({ getTenantIdByPhone(this.tel).then(res => {
icon: 'error', if (res.code === 200 && res.data && res.data.length > 0) {
duration: 2000, uni.showActionSheet({
title: "登录状态过期,重新登录" itemList: res.data.map(m => m.name),
}); success: ({
tapIndex
}) => {
setTenantId(res.data[tapIndex].id)
loginFun()
} }
}) })
},
userinfo(){
console.log('执行了');
request({
url: '/getAppInfo',
method: 'get',
}).then((res)=>{
let userJson = {}
userJson.userId = res.user.userId
console.log('身份信息',res,res.role.length);
uni.setStorageSync('role',res.role)
uni.setStorageSync('userinfo',res.user)
if(!res.role||res.role.length==0){
this.show = true
} else { } else {
uni.reLaunch({ //
url: '/pages/detection/my' uni.showToast({
title: '抱歉,您没有权限登录!',
icon: 'none'
}) })
} }
}) })
}, },
getxz(index) { getxz(index) {
this.activeid = index this.activeid = index
}, },
goregister() { goregister() {
uni.redirectTo({ uni.navigateTo({
url: '/pages/login/register' url: '/pages/login/register'
}) })
}, },
goforgot() { goforgot() {
uni.redirectTo({ uni.navigateTo({
url: '/pages/login/forgot' url: '/pages/login/forgot'
}) })
}, },
goselect(){
console.log('执行');
uni.redirectTo({
url:'/pages/index/index'
})
},
// //
sendVerificationCode() { sendVerificationCode() {
let reg = /^((13[0-9])|(14[0-9])|(15[0-9])|(17[0-9])|(18[0-9]))\d{8}$/; let reg = /^((13[0-9])|(14[0-9])|(15[0-9])|(17[0-9])|(18[0-9]))\d{8}$/;
@ -254,14 +216,17 @@
} }
const data = { const data = {
phone: this.tel, phone: this.tel,
sysCode:this.sysCode,
} }
request({ request({
url: '/loginSmsCode', url: '/app-api/company/staff/loginSmsCode',
method: 'post', method: 'post',
params: data params: data
}).then((res) => { }).then((res) => {
console.log('验证码', res); console.log('验证码', res);
if (res.code == 200) { if (res.code == 200) {
this.disableButton(); //
this.startCountdown(); //
uni.showToast({ uni.showToast({
title: '验证码已发送 请注意查收', title: '验证码已发送 请注意查收',
icon: 'none' icon: 'none'
@ -273,11 +238,6 @@
}) })
} }
}) })
this.disableButton(); //
this.startCountdown(); //
}, },
disableButton() { disableButton() {
this.isButtonDisabled = true; this.isButtonDisabled = true;
@ -296,7 +256,6 @@
}, },
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@ -306,93 +265,37 @@
font-weight: 400; font-weight: 400;
color: #0078FF; color: #0078FF;
} }
.anniu{
width: 150px;
height: 40px;
border-radius: 50px;
display: flex;
align-items: center;
justify-content: center;
color: white;
background: #0D2E8D;
color: #FFFFFF;
margin: 0 auto;
}
.cont-popup{
height: 250px;
width: 300px;
background-color: #FFFFFF;
box-sizing: border-box;
padding: 15px;
border-radius: 10px;
}
.popup-title{
width: 100%;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
font-weight: bold;
color: #0D2E8D;
}
.dix{
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
margin: 20px 0px;
font-size: 18px;
font-weight: bold;
}
.lqiu{
width: 15px;
height: 15px;
border-radius: 50%;
border: 1px solid #0D2E8D;
background: #0D2E8D;
color: white;
display: flex;
align-items: center;
justify-content: center;
}
.qiu{
width: 15px;
height: 15px;
border-radius: 50%;
border: 1px solid #E8E8E8;
}
button { button {
border: none !important; border: none !important;
background: none !important; background: none !important;
margin: 0px; margin: 0px;
display: block; display: block;
} }
button:focus { button:focus {
color: #0078FF; color: #0078FF;
outline: none; outline: none;
box-shadow: none; box-shadow: none;
} }
.content { .content {
box-sizing: border-box; box-sizing: border-box;
padding-top: 1px;
background-image: url('http://www.nuoyunr.com/lananRsc/jdc-bj.png');
background-size: cover;
width: 100%;
height: calc(100vh);
} }
.top { .top {
box-sizing: border-box; box-sizing: border-box;
padding: 0px 27px; padding: 0px 27px;
padding-top: 100px; padding-top: 100px;
background-image: url('../../static/loginbj.png');
// background-color:lightseagreen; // background-color:lightseagreen;
// background-image: url('../../static/loginbj.png');
background-size: cover;
background-position: center; background-position: center;
width: 100%; width: 100%;
// height: 385px; // height: 385px;
} }
.touxiang { .touxiang {
width: 88px; width: 88px;
height: 88px; height: 88px;
@ -401,15 +304,18 @@
margin: 0 auto; margin: 0 auto;
margin-bottom: 40px; margin-bottom: 40px;
overflow: hidden; overflow: hidden;
image { image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
} }
.twotap { .twotap {
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
view { view {
font-size: 15px; font-size: 15px;
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
@ -418,10 +324,12 @@
margin-right: 38.5px; margin-right: 38.5px;
} }
} }
.blck { .blck {
color: #333333 !important; color: #333333 !important;
font-weight: bold !important; font-weight: bold !important;
} }
.inputs { .inputs {
box-sizing: border-box; box-sizing: border-box;
padding: 16px 0px; padding: 16px 0px;
@ -430,6 +338,7 @@
border-bottom: 2px solid #E8E8E8; border-bottom: 2px solid #E8E8E8;
margin-top: 20px; margin-top: 20px;
} }
.wjworb { .wjworb {
margin-top: 5px; margin-top: 5px;
width: 100%; width: 100%;
@ -440,27 +349,21 @@
align-items: center; align-items: center;
} }
.dl { .dl {
width: 90%; width: 90%;
height: 44px; height: 44px;
background-color: #0D2E8D; background: linear-gradient(-46deg, #0853C4 0%, #4282D8 80%);
border-radius: 50px; border-radius: 5px;
margin: 0 auto; margin: 0 auto;
font-size: 16px; font-size: 16px;
color: #FFFFFF; color: #FFFFFF;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin-top: 300px; margin-top: 22px;
}
.xiaoannoi{
width: 90%;
height: 40px;
margin: 0 auto;
border-radius: 50px;
overflow: hidden;
margin-top: 300px;
} }
.hging { .hging {
width: 100%; width: 100%;
text-align: center; text-align: center;
@ -469,6 +372,7 @@
color: #636363; color: #636363;
margin-top: 20px; margin-top: 20px;
} }
.wx { .wx {
width: 38px; width: 38px;
height: 38px; height: 38px;
@ -476,11 +380,13 @@
box-sizing: border-box; box-sizing: border-box;
margin: 0px auto; margin: 0px auto;
margin-top: 20px; margin-top: 20px;
image { image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
} }
.hui { .hui {
font-size: 10px; font-size: 10px;
width: 100%; width: 100%;
@ -488,6 +394,7 @@
font-weight: 400; font-weight: 400;
color: #666666; color: #666666;
} }
.dbottom { .dbottom {
width: 100%; width: 100%;
text-align: center; text-align: center;
@ -497,38 +404,73 @@
position: fixed; position: fixed;
bottom: 25px; bottom: 25px;
display: flex; display: flex;
justify-content: center;
align-items: center; align-items: center;
justify-content: center;
}
.quanzi {
width: 14px;
height: 14px;
border: 1px solid #666666;
border-radius: 50%;
margin-right: 10px;
}
.lanquanzi {
width: 14px;
height: 14px;
border: 1px solid #0078FF;
border-radius: 50%;
margin-right: 10px;
background: #0078FF;
color: white;
} }
.lan { .lan {
color: #0D2E8D; color: #0078FF;
} }
.land{
font-size: 25px; .jiuzhong {
font-weight: bold;
color: #0D2E8D;
margin-bottom: 5px;
}
.kuang{
width: 90%; width: 90%;
margin: 0 auto; margin: 10px auto;
margin-top: 100px; display: flex;
align-items: center;
} }
.axquan{
width: 18px; .dist {
height: 18px; display: flex;
border-radius: 50%; align-items: center;
border: 1px solid #AAAAAA; margin: 0px 10px;
margin-right: 5px;
} }
.axquanl{
width: 18px; .d-zi {
height: 18px; font-size: 14px;
border-radius: 50%; }
border: 1px solid #AAAAAA;
.d-qian {
width: 14px;
height: 14px;
margin-right: 5px; margin-right: 5px;
background-color: #0D2E8D; overflow: hidden;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid #666666;
color: white;
}
.d-qian-lan {
width: 14px;
height: 14px;
margin-right: 5px;
overflow: hidden;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
background: #0078FF;
border: 1px solid #0078FF;
color: white;
} }
</style> </style>

View File

@ -17,12 +17,20 @@
<text class="formValue">{{ customInfo.name }}</text> <text class="formValue">{{ customInfo.name }}</text>
<u-icon color="#999" name="arrow-right" size="12"></u-icon> <u-icon color="#999" name="arrow-right" size="12"></u-icon>
</view> </view>
<view style="padding-bottom: 60rpx;border-bottom: 1px solid #ddd" class="formItem"> <view class="formItem">
<image class="formIcon" mode="aspectFit" src="/static/icons/userInfo_3.png"></image> <image class="formIcon" mode="aspectFit" src="/static/icons/userInfo_3.png"></image>
<text class="formLabel">绑定电话</text> <text class="formLabel">绑定电话</text>
<text class="formValue">{{ customInfo.phone }}</text> <text class="formValue">{{ customInfo.phone }}</text>
<u-icon color="#999" name="arrow-right" size="12"></u-icon> <u-icon color="#999" name="arrow-right" size="12"></u-icon>
</view> </view>
<view class="formItem">
<image class="formIcon" mode="aspectFit" src="/static/icons/userInfo_3.png"></image>
<text class="formLabel">我的邀请码</text>
<text class="formValue"></text>
</view>
<view style="padding-bottom: 60rpx;border-bottom: 1px solid #ddd;" class="formItem">
<image style="width: 200px; height: 200px;margin: auto" class="formIcon" mode="scaleToFill" src="@/pages-home/static/yaoqingma.png"></image>
</view>
<view class="btn"> <view class="btn">
退出登录 退出登录

View File

@ -32,9 +32,13 @@ export function hasRole(roleCode) {
} }
export function getUserInfo() { export function getUserInfo() {
return uni.getStorageSync(UserInfo) if(uni.getStorageSync(UserInfo)){
return JSON.parse(uni.getStorageSync(UserInfo))
}else{
return undefined;
}
} }
export function setUserInfo(userInfo) { export function setUserInfo(dataObj) {
return uni.setStorageSync(UserInfo, userInfo) return uni.setStorageSync(UserInfo, JSON.stringify(dataObj))
} }