精简页面初始化代码
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { loginStatus, post } from '@/utils/https';
|
||||
import { loginStatusPage, post } from '@/utils/https';
|
||||
import { SaleOrderProcessStateOption } from '@/utils/config';
|
||||
import {
|
||||
cloneLite,
|
||||
@@ -111,16 +111,7 @@ Page({
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
this.setData({ loading: true });
|
||||
loginStatus()
|
||||
.then(() => {
|
||||
this.setData({ isLogin: true, loading: false });
|
||||
this.init();
|
||||
})
|
||||
.catch((err) => {
|
||||
this.setData({ isLogin: false, loading: false });
|
||||
console.log('调用登录状态请求失败', err);
|
||||
});
|
||||
loginStatusPage(this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { loginStatus, post } from '@/utils/https';
|
||||
import { loginStatusPage, post } from '@/utils/https';
|
||||
import { getAuthInfo, getDataSet, toArray } from '@/utils/util';
|
||||
|
||||
Page({
|
||||
@@ -44,16 +44,7 @@ Page({
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad() {
|
||||
this.setData({ loading: true });
|
||||
loginStatus()
|
||||
.then(() => {
|
||||
this.setData({ isLogin: true, loading: false });
|
||||
this.init();
|
||||
})
|
||||
.catch((err) => {
|
||||
this.setData({ isLogin: false, loading: false });
|
||||
console.log('调用登录状态请求失败', err);
|
||||
});
|
||||
loginStatusPage(this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { loginStatus, post } from '@/utils/https';
|
||||
import { loginStatusPage, post } from '@/utils/https';
|
||||
import {
|
||||
cloneLite,
|
||||
getAuthInfo,
|
||||
@@ -113,16 +113,7 @@ Page({
|
||||
title: decodeURIComponent(options.title || ''),
|
||||
});
|
||||
this.data.params.process_id = `${options.process_id || ''}`;
|
||||
this.setData({ loading: true });
|
||||
loginStatus()
|
||||
.then(() => {
|
||||
this.setData({ isLogin: true, loading: false });
|
||||
this.init();
|
||||
})
|
||||
.catch((err) => {
|
||||
this.setData({ isLogin: false, loading: false });
|
||||
console.log('调用登录状态请求失败', err);
|
||||
});
|
||||
loginStatusPage(this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user