Commit af4c7629 authored by 程恺文's avatar 程恺文

feat: 广州登陆页

parent 0d351ead
Pipeline #55041 passed with stages
......@@ -47,12 +47,13 @@ class HuaNongLogin extends Component {
this.setSubmitting(true);
this.props.updateCurrentIndex(-1);
console.log('登陆');
//没取到0id 要给定时器
appService
. getInOnLine({
UserID: 58,
SatrtDate: '2022-07-08 17:48:51',
UserID: globalConfig.userInfo.oid,
SatrtDate: this.getNowDate(),
Port: location.port,
Oid:'83A3F3E9-96D3-4430-B90D-6E903BFF8D04',
Oid:this._createGuid(),
})
};
onActinoChange = action => {
......@@ -140,6 +141,44 @@ class HuaNongLogin extends Component {
clearTime() {
this.timeTimer && clearInterval(this.timeTimer);
}
getNowDate () {
var date = new Date();
var sign2 = ":";
var year = date.getFullYear() // 年
var month = date.getMonth() + 1; // 月
var day = date.getDate(); // 日
var hour = date.getHours(); // 时
var minutes = date.getMinutes(); // 分
var seconds = date.getSeconds() //秒
var weekArr = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期天'];
var week = weekArr[date.getDay()];
// 给一位数的数据前面加 “0”
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (day >= 0 && day <= 9) {
day = "0" + day;
}
if (hour >= 0 && hour <= 9) {
hour = "0" + hour;
}
if (minutes >= 0 && minutes <= 9) {
minutes = "0" + minutes;
}
if (seconds >= 0 && seconds <= 9) {
seconds = "0" + seconds;
}
return year + "-" + month + "-" + day + " " + hour + sign2 + minutes + sign2 + seconds;
}
_createGuid() {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
.replace(/[xy]/g, function (c) {
let r = (Math.random() * 16) | 0,
v = c == "x" ? r : (r & 0x3) | 0x8;
return v.toString(16);
})
.toUpperCase();
}
componentDidMount() {
console.log(this.props);
console.log(this);
......@@ -155,14 +194,10 @@ class HuaNongLogin extends Component {
Oid,
}
}) */
console.log('在线时长服务');
appService
. getInOnLine({
UserID: 58,
SatrtDate: '2022-07-08 17:48:51',
Port: location.port,
Oid:'83A3F3E9-96D3-4430-B90D-6E903BFF8D04',
})
}
componentWillUnmount() {
this.clearTime();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment