oa自动登录

This commit is contained in:
砂糖
2025-07-14 10:04:33 +08:00
parent 94b3ded9fb
commit fc8741c0c1
3 changed files with 87 additions and 103 deletions

View File

@@ -24,12 +24,31 @@
<script>
import CustomNavBar from '@/components/CustomNavBar/index.vue';
import { getUserProfile } from '@/api/oa/user.js';
export default {
name: "WorkbenchIndex",
components: {
CustomNavBar,
},
onShow() {
console.log('页面onLoad被调用');
// 页面加载时调用getUserProfile
this.fetchUserProfile();
},
methods: {
// 获取用户个人信息
async fetchUserProfile() {
console.log('fetchUserProfile方法开始执行');
try {
console.log('开始调用getUserProfile API');
const response = await getUserProfile();
console.log('用户个人信息:', response);
// 这里可以根据需要处理返回的用户信息
} catch (error) {
console.error('获取用户个人信息失败:', error);
}
},
goReportWork() {
uni.navigateTo({
url: '/pages/workbench/reportWork/reportWork'
@@ -45,7 +64,7 @@ export default {
url: '/pages/workbench/task/task'
})
}
}
},
};
</script>