加载优化

This commit is contained in:
仲么了
2023-08-30 10:03:07 +08:00
parent d0168235d4
commit d61a1614f9
9 changed files with 85 additions and 64 deletions

View File

@@ -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