123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <!DOCTYPE html>
- <html>
- <head>
- <title>CloudSQL 管理员后台</title>
- <meta charset="UTF-8">
- <link rel="stylesheet" href="//cdn.bootcss.com/mdui/0.3.0/css/mdui.min.css">
- <link href="./css/index.css" rel="stylesheet" type="text/css">
- <script src="//cdn.bootcss.com/mdui/0.3.0/js/mdui.min.js"></script>
- <script type="text/javascript" src="./scr/index-dev.js"></script>
- </head>
- <body>
- <main id="router-view"></main>
- </body>
- <script>
- let routes = [{
- path: '/signin',
- fileName: 'src/components/signin.js'
- },
- {
- path: '/signup',
- fileName: 'src/components/signup.js'
- },
- {
- path: '/index',
- fileName: 'src/components/index.js'
- },
- ];
- const el = document.getElementById('router-view');
- let router = new SPARouter(el, routes, 'hash');
- router.beforeEach((to, next) => {
- Utils.ajaxGet('http://admin.cloudsql.1473.cn/v1/index/signStatus', function (response) {
- if (response.status === 'signedin') {
- next();
- } else {
- if (to.path === '/signin' || to.path === '/signup') {
- next();
- } else {
- window.location.hash = '/signin';
- }
- }
- });
- });
- </script>
- </html>
|