Ionic framework 在Ionic4中,移动电话中的离子数据存储不起作用
我附上了仪表板的图像,我在ionic数据存储中存储了一个令牌值,并在仪表板中显示。虽然我在浏览器中看到了它的显示,但在手机中却没有显示 我还附上了从离子存储中存储和获取值的代码 将响应值存储到离子存储器Ionic framework 在Ionic4中,移动电话中的离子数据存储不起作用,ionic-framework,ionic4,ionic-storage,Ionic Framework,Ionic4,Ionic Storage,我附上了仪表板的图像,我在ionic数据存储中存储了一个令牌值,并在仪表板中显示。虽然我在浏览器中看到了它的显示,但在手机中却没有显示 我还附上了从离子存储中存储和获取值的代码 将响应值存储到离子存储器 // "token":"v7gtljulmg2t4doheuik4c8m7f1xg28n" this.api.postRequest(loginobj).subscribe(res =>{ this.storage.set('token', res[0]
// "token":"v7gtljulmg2t4doheuik4c8m7f1xg28n"
this.api.postRequest(loginobj).subscribe(res =>{
this.storage.set('token', res[0].message);
从离子存储中获取值
// "token":"v7gtljulmg2t4doheuik4c8m7f1xg28n"
this.api.postRequest(loginobj).subscribe(res =>{
this.storage.set('token', res[0].message);
//获取价值
this.storage.get ('token')
.then(res => {
this.tokens1 = res;
});
在Html中
在显示此值{{tokens1}}200.00的p标记im中Hi,欢迎使用堆栈溢出。你进行了什么样的调查?例如,我也在执行与您相同的格式。我不知道如何共享图像。你能解释一下,我将共享我的编码backDashboard(){this.sessionexp();this.storage.get('token')。然后(res=>{let sesstokens=res;if(sesstokens!=null){this.navCtrl.navigateBack(['/dashboard']);}其他{this.navCtrl.navigateRoot(['/login']);} }); }