You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
493 B
21 lines
493 B
export class Commons {
|
|
// 页面高度=屏幕的高度/2
|
|
height = 'height:' + screen.height / 2 + 'px';
|
|
|
|
message = null;
|
|
messageStyle = 'warning';
|
|
|
|
// 清空警告信息
|
|
clearError() {
|
|
this.message = null;
|
|
}
|
|
|
|
// post请求
|
|
request(url, b, res) {
|
|
const header = new Headers();
|
|
header.append('Content-Type', 'application/json');
|
|
const req = new Request(url,
|
|
{method: 'POST', body: b, headers: header});
|
|
fetch(req).then(r => r.json()).then(res);
|
|
}
|
|
}
|
|
|