AdminLogin.ts 564 B

123456789101112131415161718192021222324252627
  1. import { UserData } from "../game/data/udata/Player";
  2. /**
  3. * 管理员从后台登陆
  4. */
  5. const {ccclass, property} = cc._decorator;
  6. @ccclass
  7. export default class AdminLogin extends cc.Component {
  8. @property(cc.EditBox)
  9. mId: cc.EditBox = null;
  10. @property(cc.EditBox)
  11. mToken: cc.EditBox = null;
  12. public static userData:UserData;
  13. public onclick(){
  14. AdminLogin.userData = {
  15. id:parseInt(this.mId.string),
  16. token:this.mToken.string,
  17. zone:null
  18. }
  19. cc.director.loadScene('main');
  20. }
  21. }