// src/utils/tcb.js
import cloudbase from '@cloudbase/js-sdk';

const app = cloudbase.init({
  env: 'cloud1-6g98iw7i28b01747',
  clientId: 'AOJ8yAABGIqFrq8xZco',
});

const auth = app.auth({ persistence: 'local' }); // 保持登录态

// 匿名登录
if (!auth.hasLoginState()) {
    auth.signInAnonymously().catch(console.error);
}

export { app, auth };