加载优化
This commit is contained in:
7
App.vue
7
App.vue
@@ -1,6 +1,6 @@
|
||||
<script>
|
||||
import { queryDictDataCache } from './common/api/dictionary.js'
|
||||
import { getImageUrl } from '@/common/api/basic'
|
||||
import {queryDictDataCache} from './common/api/dictionary.js'
|
||||
import {getImageUrl} from '@/common/api/basic'
|
||||
|
||||
export default {
|
||||
onLaunch: function () {
|
||||
@@ -20,13 +20,14 @@ export default {
|
||||
url: '/pages/user/login',
|
||||
})
|
||||
}
|
||||
let userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
if (!userInfo) return
|
||||
// 查询字典
|
||||
queryDictDataCache().then((res) => {
|
||||
uni.setStorageSync(this.$cacheKey.dictData, res.data)
|
||||
})
|
||||
|
||||
// 更新用户头像
|
||||
let userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
if (userInfo.headSculpture) {
|
||||
getImageUrl(userInfo.headSculpture).then((res) => {
|
||||
userInfo.avatar = res.data
|
||||
|
||||
Reference in New Issue
Block a user