修正IOS登录错误

This commit is contained in:
Abin
2026-01-06 10:56:25 +08:00
parent 04869e749c
commit 15c82bdb46
+7 -1
View File
@@ -58,9 +58,15 @@ Page({
console.log("用户名: "+random_username);
// 复制本地图片到用户数据路径,如果文件不存在,先复制
const UpLoadfilePath = wx.env.USER_DATA_PATH + '/defaultAvatar.png';
try {wx.getFileSystemManager().accessSync(UpLoadfilePath);}
catch (e) {
wx.getFileSystemManager().copyFileSync('static/image/defaultAvatar.png', UpLoadfilePath);
}
wx.uploadFile({
filePath: "static/image/defaultAvatar.png",
filePath: UpLoadfilePath,
name: "HeadIconKey",
url: getApp().globalData.BaseURL+'/API/ApiChangeUserInfo.php',
formData:{