|
12345678910111213141516171819202122232425262728293031 |
- // app.js
- import {
- getPermission
- } from './api/permission.js'
- App({
- onLaunch() {
- // 展示本地存储能力
- const logs = wx.getStorageSync('logs') || []
- logs.unshift(Date.now())
- wx.setStorageSync('logs', logs)
-
- // 登录
- const {roleId} = wx.getStorageSync('userInfo')
- getPermission(roleId).then(i => {
- if (i.code === 0) {
- wx.setStorage({
- key: 'menuList',
- data: i.data.opMenusList
- })
- wx.setStorage({
- key: 'permissionsList',
- data: i.data.permissionsList
- })
- }
- })
-
- },
- globalData: {
- userInfo: null
- }
- })
|