var app = getApp(); var that; Page({ data: { code:'', str:'企业信息同步中...', isShow:false, }, onLoad(e) { that = this; dd.setNavigationBar({ title: "授权登录" }); if (e.code) { this.setData({ code: e.code }) } }, onShow() { if (app.globalData.userData&&app.globalData.isSuperAdministrator) { that.setData({ //获取扫码进入参数 isShow: true }) } else { app.login(app.globalData.corpId, function (is) { if (is&&app.globalData.isSuperAdministrator) { that.setData({ //获取扫码进入参数 isShow: true }) } else { dd.reLaunch({ url: '../../noJurisdiction/noJurisdiction' }) } }, function () { }) } }, loginAll2(){ app.globalData.showToast("已取消"); dd.reLaunch({ url: '../workbench/index/index' }) }, loginAll(){ app.$post("api/auth/qr",{code:this.data.code}).then((res) => { app.globalData.showToast("已登录"); setTimeout(() => { dd.reLaunch({ url: '../workbench/index/index' }) }, 1000); }) }, });