const storage = require('@/common/storage.js');

export const loginToast = () => {
    const token = storage.getUserToken()
    if (!token) {
        uni.showModal({
            title: '提示',
            content: '您还未登录，请先登录',
            showCancel: false,
            confirmText: '确定',
            success: function(res) {
                if (res.confirm) {
                    //#ifdef MP-ALIPAY
                    uni.navigateTo({
                        url: '/pages/phoneLogin/phoneLogin',
                    })
                    //#endif
                    //#ifdef MP-WEIXIN
                    uni.navigateTo({
                        url: '/pages/login/login',
                    })
                    //#endif
                }
            }
        })
        return false
    }
    return true
}