import React from 'react' ; import { runApp , IAppConfig , Link } from 'ice' ; const appConfig = { app : { getInitialData : async ( ) => { const data = { role : 'guest' , starPermission : true , followPermission : true } ; return { auth : { admin : data . role === 'admin' , guest : data . role === 'guest' , starRepo : data . starPermission , followRepo : data . followPermission } } ; } , } , auth : { NoAuthFallback : ( props ) => { console . log ( 'NoAuthFallback props' , props ) ; return ( < div > 没有权限 ... < Link to = "/" > 返回首页 < /Link> < /div>); } } , } ; runApp ( appConfig ) ;