Skip to content

Commit 40bf0e3

Browse files
author
veedrin
committed
用户名以 dtid 开头的提示回退
1 parent 3fd158d commit 40bf0e3

File tree

7 files changed

+128
-65
lines changed

7 files changed

+128
-65
lines changed

app/dashboard/i18n/en_US/global.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,8 @@
7676
"submitting": "Submitting...",
7777
"eventStreamBulletin1": "Dear developer, due to ",
7878
"eventStreamBulletin2": "[ event-stream package event ]",
79-
"eventStreamBulletin3": " Impact, your plugin needs to manually delete the `yarn.lock` file and reinstall the dependencies, then push the code to release a new version or pre-release."
79+
"eventStreamBulletin3": " Impact, your plugin needs to manually delete the `yarn.lock` file and reinstall the dependencies, then push the code to release a new version or pre-release.",
80+
"globalTip1": "The system has detected that your username has not been modified.",
81+
"globalTip2": "Please go to [ Tencent Cloud Dev Platform > Personal Settings ] and then log in again.",
82+
"gotoModify": "Go to edit"
8083
}

app/dashboard/i18n/zh_CN/global.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,8 @@
7676
"submitting": "提交中...",
7777
"eventStreamBulletin1": "尊敬的开发者,由于受 ",
7878
"eventStreamBulletin2": "[ event-stream 包事件 ]",
79-
"eventStreamBulletin3": " 影响,您的插件需要手动删除 `yarn.lock` 文件并重新安装依赖,再推送代码发布新版本或预发布。"
79+
"eventStreamBulletin3": " 影响,您的插件需要手动删除 `yarn.lock` 文件并重新安装依赖,再推送代码发布新版本或预发布。",
80+
"globalTip1": "系统检测到您的用户名尚未修改。",
81+
"globalTip2": "请先进入 [ 腾讯云开发者平台 > 个人设置 ] 修改后再重新登录使用。",
82+
"gotoModify": "前往修改"
8083
}

app/dashboard/view/home/mas/Mask.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import React, { Component } from 'react';
2+
3+
import './mask.css';
4+
5+
import Inbox from '../../../share/inbox';
6+
7+
import api from '../../../api';
8+
import i18n from '../../../utils/i18n';
9+
10+
class Mask extends Component {
11+
state = {
12+
loading: false,
13+
value: '',
14+
error: '',
15+
}
16+
17+
render() {
18+
const { loading, value, error } = this.state;
19+
return (
20+
<div className="dash-global-mask">
21+
<div className="panel">
22+
<div className="line">{i18n('global.globalTip')}</div>
23+
<Inbox holder="global.inputTip" value={value} onChange={this.handleChange} />
24+
<div className={`error${error ? ' on' : ''}`}>{error}</div>
25+
{!loading ? (
26+
<button className="com-button primary" onClick={this.handleSubmit}>{i18n('global.ok')}</button>
27+
) : <button className="com-button primary">{i18n('global.submitting')}</button>}
28+
</div>
29+
</div>
30+
);
31+
}
32+
33+
handleChange = (event) => {
34+
this.setState({ value: event.target.value });
35+
}
36+
37+
handleSubmit = () => {
38+
const { value } = this.state;
39+
this.setState({ loading: true });
40+
api.renameGlobalKey({ newGlobalKey: value }).then(res => {
41+
this.setState({ loading: false });
42+
if (res.code === 0) {
43+
window.reload();
44+
} else {
45+
this.setState({ error: res.msg });
46+
}
47+
});
48+
}
49+
}
50+
51+
export default Mask;

app/dashboard/view/home/mas/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import Mask from './Mask';
2+
3+
export default Mask;

app/dashboard/view/home/mas/mask.css

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.dash-global-mask {
2+
width: 100%;
3+
height: 100%;
4+
background-color: #000;
5+
position: fixed;
6+
top: 0;
7+
left: 0;
8+
z-index: 100;
9+
}
10+
.dash-global-mask .panel {
11+
width: 95%;
12+
max-width: 420px;
13+
padding: 15px;
14+
border-radius: 4px;
15+
font-size: 14px;
16+
color: #ccc;
17+
background-color: #333;
18+
transform: translate(-50%, -50%);
19+
position: absolute;
20+
top: 40%;
21+
left: 50%;
22+
}
23+
.dash-global-mask .panel input {
24+
margin-top: 10px;
25+
}
26+
.dash-global-mask .panel .error {
27+
height: 0;
28+
font-size: 12px;
29+
color: #f84a4a;
30+
overflow: hidden;
31+
transition: height .2s ease, margin-top .2s ease;
32+
}
33+
.dash-global-mask .panel .error.on {
34+
height: 16px;
35+
margin-top: 5px;
36+
}
37+
.dash-global-mask .panel button {
38+
min-width: 55px;
39+
padding: 4px 13px;
40+
margin-top: 10px;
41+
font-size: 12px;
42+
}

app/dashboard/view/home/mask/Mask.js

Lines changed: 12 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,22 @@ import React, { Component } from 'react';
22

33
import './mask.css';
44

5-
import Inbox from '../../../share/inbox';
6-
7-
import api from '../../../api';
85
import i18n from '../../../utils/i18n';
96

10-
class Mask extends Component {
11-
state = {
12-
loading: false,
13-
value: '',
14-
error: '',
15-
}
16-
17-
render() {
18-
const { loading, value, error } = this.state;
19-
return (
20-
<div className="dash-global-mask">
21-
<div className="panel">
22-
<div className="line">{i18n('global.globalTip')}</div>
23-
<Inbox holder="global.inputTip" value={value} onChange={this.handleChange} />
24-
<div className={`error${error ? ' on' : ''}`}>{error}</div>
25-
{!loading ? (
26-
<button className="com-button primary" onClick={this.handleSubmit}>{i18n('global.ok')}</button>
27-
) : <button className="com-button primary">{i18n('global.submitting')}</button>}
7+
const Mask = () => {
8+
return (
9+
<div className="dash-global-mask">
10+
<div className="panel">
11+
<div className="line">{i18n('global.globalTip1')}</div>
12+
<div className="line">{i18n('global.globalTip2')}</div>
13+
<div className="control">
14+
<a href="https://dev.tencent.com/user/account" target="_blank" rel="noopener noreferrer">
15+
<button className="com-button primary">{i18n('global.gotoModify')}</button>
16+
</a>
2817
</div>
2918
</div>
30-
);
31-
}
32-
33-
handleChange = (event) => {
34-
this.setState({ value: event.target.value });
35-
}
36-
37-
handleSubmit = () => {
38-
const { value } = this.state;
39-
this.setState({ loading: true });
40-
api.renameGlobalKey({ newGlobalKey: value }).then(res => {
41-
this.setState({ loading: false });
42-
if (res.code === 0) {
43-
window.reload();
44-
} else {
45-
this.setState({ error: res.msg });
46-
}
47-
});
48-
}
19+
</div>
20+
);
4921
}
5022

5123
export default Mask;

app/dashboard/view/home/mask/mask.css

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,31 @@
11
.dash-global-mask {
22
width: 100%;
33
height: 100%;
4-
background-color: #000;
4+
background-color: rgba(0, 0, 0, .6);
55
position: fixed;
66
top: 0;
77
left: 0;
88
z-index: 100;
99
}
1010
.dash-global-mask .panel {
11-
width: 95%;
12-
max-width: 420px;
13-
padding: 15px;
14-
border-radius: 4px;
11+
width: 465px;
12+
padding: 20px;
13+
border-radius: 5px;
1514
font-size: 14px;
1615
color: #ccc;
1716
background-color: #333;
18-
transform: translate(-50%, -50%);
1917
position: absolute;
2018
top: 40%;
21-
left: 50%;
19+
left: calc(50% - 210px);
2220
}
23-
.dash-global-mask .panel input {
24-
margin-top: 10px;
21+
.dash-global-mask .panel .line {
22+
padding-bottom: 5px;
2523
}
26-
.dash-global-mask .panel .error {
27-
height: 0;
28-
font-size: 12px;
29-
color: #f84a4a;
30-
overflow: hidden;
31-
transition: height .2s ease, margin-top .2s ease;
32-
}
33-
.dash-global-mask .panel .error.on {
34-
height: 16px;
35-
margin-top: 5px;
24+
.dash-global-mask .panel .control {
25+
padding-top: 20px;
26+
text-align: center;
3627
}
3728
.dash-global-mask .panel button {
38-
min-width: 55px;
39-
padding: 4px 13px;
40-
margin-top: 10px;
41-
font-size: 12px;
29+
width: 90px;
30+
height: 35px;
4231
}

0 commit comments

Comments
 (0)