message:Error: 上传失败:网络请求错误 非法的文件,错误信息:invalid file: uni_modules/uni-id-pages/common/store.js, 1:1386, SyntaxError: Unexpected token ?!function(){"use strict";const e=require("../../../common/vendor.js"),n=require("../config.js"),t=e.Ds.importObject("uni-id-co"),i=e.Ds.database().collection("uni-id-users");let o=e.index.getStorageSync("uni-id-pages-userInfo")||{};const s={userInfo:o,hasLogin:0!=Object.keys(o).length},r={async updateUserInfo(n=!1){if(n)i.where("_id==$env.uid").update(n).then(t=>{t.result.updated?(e.index.showToast({title:"更新成功",icon:"none",duration:3e3}),this.setUserInfo(n)):e.index.showToast({title:"没有改变",icon:"none",duration:3e3})});else{const n=e.Ds.importObject("uni-id-co",{customUI:!0});try{let e=await i.where("'_id' == $cloudEnv_uid").field("mobile,nickname,username,email,avatar_file").get();const t=await n.getRealNameInfo();this.setUserInfo({...e.result.data[0],realNameAuth:t})}catch(e){this.setUserInfo({},{cover:!0}),console.error(e.message,e.errCode)}}},async setUserInfo(n,{cover:t}={cover:!1}){let i=t?n:Object.assign(a.userInfo,n);return a.userInfo=Object.assign({},i),a.hasLogin=0!=Object.keys(a.userInfo).length,e.index.setStorage({key:"uni-id-pages-userInfo",data:a.userInfo}),n},async logout(){var n;if(e.Ds.getCurrentUserInfo().tokenExpired>Date.now())try{await t.logout()}catch(e){console.error(e)}e.index.removeStorageSync("uni_id_token"),e.index.setStorageSync("uni_id_token_expired",0),e.index.redirectTo({url:"/"+((null==(n=e.pageJson.uniIdRouter)?void 0:n.loginPage)??"uni_modules/uni-id-pages/pages/login/login-withoutpwd")}),e.index.$emit("uni-id-pages-logout"),this.setUserInfo({},{cover:!0})},loginBack(n={}){const{uniIdRedirectUrl:t=""}=n;let i=0,o=getCurrentPages();if(o.forEach((e,n)=>{"login"==o[o.length-n-1].route.split("/")[3]&&i++}),t)return e.index.reLaunch({url:t});if(i){const n=e.pageJson.pages[0];return e.index.reLaunch({url:"/"+n.path})}e.index.navigateBack({delta:i})},loginSuccess(t={}){const{showToast:i=!0,toastText:o="登录成功",autoBack:s=!0,uniIdRedirectUrl:r="",passwordConfirmed:a}=t;if(i&&e.index.showToast({title:o,icon:"none",duration:3e3}),this.updateUserInfo(),e.index.$emit("uni-id-pages-login-success"),n.config.setPasswordAfterLogin&&!a)return e.index.redirectTo({url:r?/uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd?uniIdRedirectUrl=${r}&loginType=${t.loginType}
:"/uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd?loginType="+t.loginType,fail:e=>{console.log(e)}});s&&this.loginBack({uniIdRedirectUrl:r})}},a=e.reactive(s);exports.mutations=r,exports.store=a}(); [20231026 11:10:21][wx87ef30365bbe7964]
appid: wx87ef30365bbe7964
openid: o6zAJs9uWOfOGDbguWnqmOIUGOP4
ideVersion: 1.06.2308310
osType: win32-x64
time: 2023-10-26 11:10:36
smoot
- 发布:2023-10-26 13:00
- 更新:2024-08-12 15:01
- 阅读:546
2 个回复
禅川 - 组件bug
同问
乔小猿
最后怎么解决的?