feat: add warning message for unauthorized access key usage

This commit is contained in:
hakadao
2024-06-02 13:26:08 +08:00
parent b75bd5e78b
commit 37e4c54910
5 changed files with 21 additions and 25 deletions

View File

@@ -186,10 +186,7 @@ settings:
坐标广州,我不是希望进去一定要做出什么成就出来,在做开源过程中也对项目负责人和开发者不同的想法观念略有感受。我只想进去了解一下正确的前端规范和能与其他志同道合的人一起工作。如果有合适的前端工作机会请联系我,谢谢!
contact_me: 联系我
auth:
err_tip: 授权 access key 失败
plz_login_first: 请先登录 bilibili
receive_verified_url_err: 未知错误,请刷新页面后重试
failed_to_get_accesskey: 获取 access key 失败
auth_access_key_first: 在这之前请先授权 BewlyBewly 使用 access key
topbar:
sign_in: 登录
notifications: 通知

View File

@@ -189,10 +189,7 @@ settings:
坐标广州,我不是希望进去一定要做出什么成就出来,在做开源过程中也对项目负责人和开发者不同的想法观念略有感受。我只想进去了解一下正确的前端规范和能与其他志同道合的人一起工作。如果有合适的前端工作机会请联系我,谢谢!
contact_me: 联系我
auth:
err_tip: 無法授權 access key
plz_login_first: 請先登入 bilibili
receive_verified_url_err: 不明錯誤,請重新整理頁面後再試一次。
failed_to_get_accesskey: 無法取得 access key
auth_access_key_first: 在這之前請先授權 BewlyBewly 使用 access key
topbar:
sign_in: 登入
notifications: 通知

View File

@@ -187,10 +187,7 @@ settings:
坐标广州,我不是希望进去一定要做出什么成就出来,在做开源过程中也对项目负责人和开发者不同的想法观念略有感受。我只想进去了解一下正确的前端规范和能与其他志同道合的人一起工作。如果有合适的前端工作机会请联系我,谢谢!
contact_me: 联系我
auth:
err_tip: Failed to grant access key
plz_login_first: Please login to bilibili first
receive_verified_url_err: Unknown error, please refresh the page and try again.
failed_to_get_accesskey: Failed to get access key
auth_access_key_first: Before doing this, authorize BewlyBewly to use the access key.
topbar:
sign_in: Sign in
notifications: Notifications

View File

@@ -189,10 +189,7 @@ settings:
坐标广州,我不是希望进去一定要做出什么成就出来,在做开源过程中也对项目负责人和开发者不同的想法观念略有感受。我只想进去了解一下正确的前端规范和能与其他志同道合的人一起工作。如果有合适的前端工作机会请联系我,谢谢!
contact_me: 联系我
auth:
err_tip: 無法授權 access key
plz_login_first: 唔該登入 bilibili 先
receive_verified_url_err: 好似神神哋,試吓 refresh 個 page 之後試多次
failed_to_get_accesskey: 攞唔度 access key
auth_access_key_first: 整之前記得先授權 BewlyBewly 去用 access key
topbar:
sign_in: 登入
notifications: 通知

View File

@@ -1,6 +1,7 @@
<script setup lang="ts">
import { onKeyStroke } from '@vueuse/core'
import type { Ref } from 'vue'
import { useI18n } from 'vue-i18n'
import { useToast } from 'vue-toastification'
import Button from '~/components/Button.vue'
@@ -18,6 +19,17 @@ import type { forYouResult, Item as VideoItem } from '~/models/video/forYou'
import { getTvSign, TVAppKey } from '~/utils/authProvider'
import { isVerticalVideo } from '~/utils/uriParse'
const props = defineProps<{
gridLayout: GridLayout
}>()
const emit = defineEmits<{
(e: 'beforeLoading'): void
(e: 'afterLoading'): void
}>()
const { t } = useI18n()
// https://github.com/starknt/BewlyBewly/blob/fad999c2e482095dc3840bb291af53d15ff44130/src/contentScripts/views/Home/components/ForYou.vue#L16
interface VideoElement {
uniqueId: string
@@ -29,15 +41,6 @@ interface AppVideoElement {
item?: AppVideoItem
}
const props = defineProps<{
gridLayout: GridLayout
}>()
const emit = defineEmits<{
(e: 'beforeLoading'): void
(e: 'afterLoading'): void
}>()
const gridValue = computed((): string => {
if (props.gridLayout === 'adaptive')
return '~ 2xl:cols-5 xl:cols-4 lg:cols-3 md:cols-2 gap-5'
@@ -329,6 +332,11 @@ function closeDislikeDialog() {
}
function handleAppDislike() {
if (!accessKey.value) {
toast.warning(t('auth.auth_access_key_first'))
return
}
loadingDislikeDialog.value = true
const params = {
access_key: accessKey.value,