|
|
@@ -7,10 +7,11 @@
|
|
|
<ElTableColumn prop="name" label="名称" min-width="120" />
|
|
|
<ElTableColumn prop="status" label="状态" :formatter="statusFormatter" width="120" />
|
|
|
<ElTableColumn prop="createdAt" label="创建时间" :formatter="timeFormatter" width="150" />
|
|
|
- <ElTableColumn label="操作" align="center" width="200">
|
|
|
+ <ElTableColumn label="操作" align="center" width="350">
|
|
|
<template #default="{ row }">
|
|
|
<ElButton @click="onPlay(row)" type="primary">进入</ElButton>
|
|
|
<ElButton @click="onEdit(row)">编辑</ElButton>
|
|
|
+ <ElButton @click="bindTwitch(row)" type="success">绑定Twitch</ElButton>
|
|
|
<ElButton @click="onDelete(row)" type="danger">删除</ElButton>
|
|
|
</template>
|
|
|
</ElTableColumn>
|
|
|
@@ -154,6 +155,15 @@ function onPlay(row) {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+function bindTwitch(row) {
|
|
|
+ let u = new URL('https://id.twitch.tv/oauth2/authorize?')
|
|
|
+ u.searchParams.append('client_id', '530df6x09eq34be0vjhsezkl2oxap0')
|
|
|
+ u.searchParams.append('redirect_uri', 'http://localhost:3000/api/twitch/auth_callback')
|
|
|
+ u.searchParams.append('response_type', 'code')
|
|
|
+ u.searchParams.append('xxx', 'aaa')
|
|
|
+ u.searchParams.append('scope', 'channel:manage:broadcast chat:read chat:edit channel:manage:polls')
|
|
|
+ window.open(u.href)
|
|
|
+}
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
.charactor-form {
|