提交 9f647019 编写于 作者: A Anne_LXM

兼容处理iOS上uni.getStorage(Sync)没有返回UTSJSONObject类型问题

上级 c78741ad
......@@ -3,6 +3,9 @@ import App from './App.uvue'
import { createSSRApp } from 'vue'
export function createApp() {
const app = createSSRApp(App)
app.config.errorHandler = (err, vm, info) => {
console.log(err, vm, info)
}
return {
app
}
......
......@@ -4,10 +4,10 @@
<button open-type="chooseAvatar" @chooseavatar="bindchooseavatar" @click="uploadAvatarImg" class="box"
:class="{'showBorder':border}" :style="{width,height,lineHeight:height}">
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view @click="uploadAvatarImg" class="box" :class="{'showBorder':border}"
:style="{width,height}">
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view @click="uploadAvatarImg" class="box" :class="{'showBorder':border}"
:style="{width,height}">
<!-- #endif -->
<!-- {{avatar_file!.getString("url")}} -->
<cloud-image v-if="avatar_file != null" :src="avatar_file!.getString('url')" :width="width" :height="height"></cloud-image>
......@@ -136,7 +136,7 @@
count: 1,
crop,
success: (res) => {
// console.log('res', res);
console.log('res', res);
let tempFiles = res.tempFiles as UTSJSONObject[];
let tempFile = tempFiles[0];
let tempFileName = tempFile['name'] as string | null
......@@ -185,7 +185,7 @@
})
// #endif
let _id = this.userInfo["_id"] as string
console.log("id",_id)
// console.log("id",_id)
// if(_id != null){
// _id = "" as string
// }
......
......@@ -15,12 +15,17 @@ export const state = reactive({
isLogin: false
} as State)
function initState() {
try {
let userInfo = uni.getStorageSync('uni-id-pages-x-userInfo')
console.log('init userInfo',userInfo);
// #ifdef APP-IOS
userInfo = new UTSJSONObject(userInfo)
// #endif
if (userInfo instanceof UTSJSONObject) {
state.userInfo = userInfo
console.log('init userInfo',userInfo);
// console.log('init userInfo',userInfo);
}
} catch (e) {
console.error('init userInfo error', e);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册