50 lines
1.1 KiB
TypeScript
50 lines
1.1 KiB
TypeScript
import { _decorator, Component, Node,Label} from 'cc';
|
|
const { ccclass, property } = _decorator;
|
|
import {userLabel} from './user/userLabel'
|
|
import dwebAjax from './ajax'
|
|
|
|
@ccclass('userdata')
|
|
export class userdata extends Component {
|
|
@property(Label)
|
|
public Uuid = null;
|
|
@property(Label)
|
|
public address = null;
|
|
@property(userLabel)
|
|
userLabel:userLabel = null;
|
|
|
|
// properties: {
|
|
|
|
// adress:Label,
|
|
// }
|
|
// Userdata:userdata = null
|
|
init(data){
|
|
// this.address.string = data.address;
|
|
this.address = data.address;
|
|
}
|
|
start() {
|
|
|
|
}
|
|
changeUserData(){
|
|
let data={}
|
|
// this.node.active = true
|
|
dwebAjax.sendAjax("/api/v1/user/get",data,"POST",(res)=>{
|
|
console.log(res);
|
|
if(res.code == "200"){
|
|
console.log(res.data.address);
|
|
let Uuid= res.data.address
|
|
this.userLabel.setLabel(Uuid)
|
|
}else{
|
|
console.log(res);
|
|
|
|
return
|
|
}
|
|
|
|
})
|
|
}
|
|
|
|
update(deltaTime: number) {
|
|
|
|
}
|
|
}
|
|
|