feat(): 修复我的页面报错问题

master
李神峰 2025-12-12 11:08:38 +08:00
parent b0fdfa16c1
commit 56a9d1b312
4 changed files with 22 additions and 8 deletions

14
main.js
View File

@ -13,10 +13,18 @@ $http.baseUrl = 'http://223.75.53.141:83'
// $http.baseUrl = 'http://192.168.66.27:24105' // $http.baseUrl = 'http://192.168.66.27:24105'
// 请求拦截器 // 请求拦截器
$http.beforeRequest = function (options) { $http.beforeRequest = function (options) {
if (options.url.indexOf('/doLogin') == -1) { if (options.url.indexOf('/login') == -1) {
options.header = { options.header = {
'Authorization': 'Bearer ' + uni.getStorageSync('Gs-Token') ...(options.header || {}),
'Authorization': 'Bearer ' + uni.getStorageSync('Gs-Token'),
loginType: 1
} }
// if (options.url.indexOf('/gunshiApp/tsg/visitMenuLog/insert') !== -1) {
// options.header = {
// ...options.header,
// loginType: 1
// }
// }
} }
} }
// 响应拦截器 // 响应拦截器
@ -58,4 +66,4 @@ export function createApp() {
app app
} }
} }
// #endif // #endif

View File

@ -2,7 +2,7 @@
"name" : "檀树岗水库", "name" : "檀树岗水库",
"appid" : "__UNI__33ED56F", "appid" : "__UNI__33ED56F",
"description" : "", "description" : "",
"versionName" : "1.0.4", "versionName" : "1.0.5",
"versionCode" : 1, "versionCode" : 1,
"transformPx" : false, "transformPx" : false,
"app-plus" : { "app-plus" : {

View File

@ -603,4 +603,4 @@ export default {
.noData { .noData {
width: 100px; width: 100px;
} }
</style> </style>

View File

@ -7,13 +7,13 @@
</div> </div>
<div class="user"> <div class="user">
<div class="username">{{userList.nickName}}</div> <div class="username">{{userList.nickName}}</div>
<div class="userresponse">{{userList.dept.deptName}}</div> <div class="userresponse">{{deptName}}</div>
</div> </div>
</view> </view>
<view class="funcBar"> <view class="funcBar">
<div class="funcList" v-for="(item, index) in func" :key="index"> <div class="funcList" v-for="(item, index) in func" :key="index">
<div @click="navigateToSubPage(func,index)"> <div @click="navigateToSubPage(func,index)">
<div class="funcIcon" style="width:30px:;height:30px"> <div class="funcIcon" style="width:30px;height:30px">
<image class="icon-left" style="width: 100%; height: 100%" :src="item.img" mode="aspectFit"> <image class="icon-left" style="width: 100%; height: 100%" :src="item.img" mode="aspectFit">
</image> </image>
</div> </div>
@ -49,7 +49,7 @@
}, },
] ]
console.log(uni.getStorageSync('value')); console.log(uni.getStorageSync('value'));
export default { export default {
data() { data() {
return { return {
userList: uni.getStorageSync('value'), userList: uni.getStorageSync('value'),
@ -60,6 +60,12 @@
default_src: uni.getStorageSync('avatar'), default_src: uni.getStorageSync('avatar'),
} }
}, },
computed: {
deptName() {
const d = this.userList && this.userList.dept
return (d && d.deptName) || ''
}
},
methods: { methods: {
navigateToSubPage(item,index) { navigateToSubPage(item,index) {
uni.navigateTo({ uni.navigateTo({