diff --git a/database/app.py b/database/app.py
index dbf0afd..11a4c4b 100644
--- a/database/app.py
+++ b/database/app.py
@@ -93,6 +93,8 @@ async def func(*args, **kwargs):
g.user = Player.get(Player.username == g.username)
return await f(*args, **kwargs)
+ return func
+
def is_developer(token):
if token == "":
diff --git a/web/public/index.html b/web/public/index.html
index 0e03f4d..1f82597 100644
--- a/web/public/index.html
+++ b/web/public/index.html
@@ -1,7 +1,5 @@
-
diff --git a/web/src/components/Profile.vue b/web/src/components/Profile.vue
index d2f44cb..772f81a 100644
--- a/web/src/components/Profile.vue
+++ b/web/src/components/Profile.vue
@@ -28,6 +28,40 @@
(u) => u.length <= 8 || '昵称不能超过 8 个字符',
]"
>
+
+
+
+
+
+
+
+
+ mdi-help-circle-outline
+
+ 成绩导入 Token 可以查询和导入您的成绩。
+
+
+
+ mdi-refresh
+
+ 生成新的成绩导入 Token
+
+
+
+ mdi-content-copy
+
+ 复制 Token
+
+
+
+ mdi-link-variant
+
+ 复制 Http 代理导入链接
+
+
+
@@ -39,6 +73,16 @@
+
+
+
+ mdi-help-circle-outline
+
+ 您可以在频道中输入 cuid 查询自己的频道 ID。
+
+
段位
@@ -120,6 +164,22 @@
+
+
+ 生成 Token
+
+ 确定生成新的 Token?旧的 Token 将失效。
+
+
+ 确定
+ 取消
+
+
+
{
return {
valid: false,
- login: false,
+ login: true,
username: "",
visible: false,
delVisible: false,
+ generateTokenVisible: false,
select: { label: "初学者", ra: 0 },
ratings: [
{ label: "初学者", ra: 0 },
@@ -192,6 +253,8 @@ export default {
{ label: "里皆传", ra: 22 },
],
bind_qq: "",
+ qq_channel_uid: "",
+ import_token: "123456",
nickname: "",
privacy: false,
plate: "",
@@ -268,6 +331,7 @@ export default {
additional_rating: this.select.ra,
nickname: this.nickname,
plate: this.plate_upload,
+ qq_channel_uid: this.qq_channel_uid,
})
.then((resp) => {
this.visible = false;
@@ -275,6 +339,8 @@ export default {
this.username = resp.data.username;
this.privacy = resp.data.privacy;
this.bind_qq = resp.data.bind_qq;
+ this.qq_channel_uid = resp.data.qq_channel_uid;
+ this.import_token = resp.data.import_token;
this.plate = resp.data.plate;
this.nickname = resp.data.nickname;
for (let elem of this.ratings) {
@@ -291,6 +357,14 @@ export default {
this.$message.error(`错误:${err.response.data.message}`)
});
},
+ generateToken() {
+ axios.put("/api/maimaidxprober/player/import_token").then(resp => {
+ this.import_token = resp.data.token;
+ this.$message.success("已生成新的导入 Token");
+ }).catch(() => {
+ this.$message.error(`生成导入 Token 失败!`)
+ }).finally(() => this.generateTokenVisible = false);
+ },
delete_records() {
axios.all([
axios.delete("https://www.diving-fish.com/api/maimaidxprober/player/delete_records"),
@@ -324,6 +398,8 @@ export default {
this.username = resp.data.username;
this.privacy = resp.data.privacy;
this.bind_qq = resp.data.bind_qq;
+ this.qq_channel_uid = resp.data.qq_channel_uid;
+ this.import_token = resp.data.import_token;
this.ra = resp.data.additional_rating;
this.plate = resp.data.plate;
this.nickname = resp.data.nickname;
@@ -340,6 +416,13 @@ export default {
})
.catch(() => {});
},
+ copyToClipboard(text) {
+ navigator.clipboard.writeText(text).then(() => {
+ this.$message.success("已复制到剪贴板");
+ }).catch(() => {
+ this.$message.error("复制失败");
+ })
+ }
},
created: function () {
for (const elem of [
@@ -376,4 +459,9 @@ export default {
display: flex;
align-items: center;
}
+
+.click-icon {
+ cursor: pointer;
+ margin-left: 4px;
+}