1234567891011121314151617181920212223242526272829 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8">
- <title>扫码绑定简历 - 页面1</title>
- <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
- </head>
- <body class="p-3">
- <div class="container">
- <h1>扫码绑定简历</h1>
- <p>请使用手机扫描二维码后进行绑定,等待绑定结果……</p>
- <!-- 显示用户的 UUID -->
- <div class="alert alert-info">您的标识: <strong>{{.UUID}}</strong></div>
- </div>
- <script>
- var uuid = "{{.UUID}}";
- // 建立 SSE 连接,监听后端绑定事件
- var source = new EventSource("/events?uuid=" + encodeURIComponent(uuid));
- source.addEventListener('bind', function(e) {
- var data = JSON.parse(e.data);
- // 当绑定后自动跳转到页面2,将 uuid 和 resume_id 作为参数传递
- window.location.href = "/page2?uuid=" + encodeURIComponent(uuid) + "&resume_id=" + encodeURIComponent(data.resume_id);
- }, false);
- source.onerror = function(e) {
- console.error("SSE error", e);
- };
- </script>
- </body>
- </html>
|