From 729878405989b26424c84ddf916aa2a1cd8fe3b0 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期三, 28 十二月 2022 16:47:36 +0800
Subject: [PATCH] #
---
pages/user/user_detail/userDetail.vue | 37 ++++++++++++++++--
pages/business/cstmr/csmtr.vue | 1
pages/user/user.vue | 33 +++++++++++++++-
3 files changed, 62 insertions(+), 9 deletions(-)
diff --git a/pages/business/cstmr/csmtr.vue b/pages/business/cstmr/csmtr.vue
index 581f0d5..ee74470 100644
--- a/pages/business/cstmr/csmtr.vue
+++ b/pages/business/cstmr/csmtr.vue
@@ -57,7 +57,6 @@
data: {curr:1,limit:16},
method:'POST',
success(result) {
- console.log(res);
if (result.statusCode === 404) {
uni.showToast({title: '璇烽噸鏂扮櫥褰�', icon: "none", position: 'top'})
return
diff --git a/pages/user/user.vue b/pages/user/user.vue
index a896db2..cb5bc04 100644
--- a/pages/user/user.vue
+++ b/pages/user/user.vue
@@ -8,7 +8,7 @@
</view>
<!-- 淇℃伅 -->
<view class="user-info">
- <view class="user-name">闄堥箯</view>
+ <view class="user-name">{{username}}</view>
<view class="user-company">涓壃绔嬪簱鎶�鏈湁闄愬叕鍙�</view>
</view>
<!-- 鏇村 -->
@@ -23,15 +23,42 @@
export default{
data() {
return {
-
+ username: ''
}
+ },
+ onShow() {
+ this.getDetail()
},
methods: {
userDetail() {
uni.navigateTo({
url:'/pages/user/user_detail/userDetail'
})
- }
+ },
+ getDetail() {
+ let that = this
+ uni.request({
+ url: that.baseUrl + '/user/detail/auth',
+ header: {'token' : uni.getStorageSync('token')},
+ method: 'POST',
+ success(res) {
+ res = res.data
+ if (res.code === 200) {
+ that.username = res.data.username
+ } else if (res.code === 403) {
+ uni.showToast({title: res.msg, icon: "none", position: 'top'})
+ setTimeout(() => {
+ uni.reLaunch({
+ url: '../../login/login'
+ });
+ }, 1000);
+ } else {
+ uni.showToast({title: res.msg, icon: "none",position: 'top'})
+ }
+ console.log(res.data);
+ }
+ })
+ },
}
}
</script>
diff --git a/pages/user/user_detail/userDetail.vue b/pages/user/user_detail/userDetail.vue
index 73cda0f..1c36780 100644
--- a/pages/user/user_detail/userDetail.vue
+++ b/pages/user/user_detail/userDetail.vue
@@ -1,6 +1,6 @@
<template>
<view>
- <view style="background-color: #fff;">
+ <view style="background-color: #fff;" @click="clickk">
<view class="item">
<view>瑙掕壊</view><view class="item-right">{{detail.roleName}}</view>
<view class="user-icons">
@@ -38,7 +38,7 @@
</view>
</view>
<view class="item">
- <view>瀵嗙爜</view><view class="item-right">{{detail.roleName}}</view>
+ <view>瀵嗙爜</view><view class="item-right"></view>
<view class="user-icons">
<uni-icons type="right" color="#c1c1c1"></uni-icons>
</view>
@@ -75,13 +75,40 @@
method: 'POST',
success(res) {
res = res.data
- that.detail = res.data
- console.log(res.data);
+ if (res.code === 200) {
+ that.detail = res.data
+ } else if (res.code === 403) {
+ uni.showToast({title: res.msg, icon: "none", position: 'top'})
+ setTimeout(() => {
+ uni.reLaunch({
+ url: '../../login/login'
+ });
+ }, 1000);
+ } else {
+ uni.showToast({title: res.msg, icon: "none",position: 'top'})
+ }
}
})
},
+ clickk() {
+ uni.showToast({
+ icon:'error',
+ title: '绉诲姩绔殏涓嶆敮鎸佷慨鏀癸紝璇疯嚦鐢佃剳绔慨鏀�',
+ duration: 2000
+ })
+ },
logOut() {
-
+ uni.showToast({
+ title: '閫�鍑烘垚鍔�',
+ duration: 1000
+ })
+ setTimeout(() => {
+ uni.removeStorageSync('token');
+ uni.removeStorageSync('password');
+ uni.reLaunch({
+ url:"/pages/login/login"
+ });
+ }, 1000);
}
}
--
Gitblit v1.9.1