mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-18 01:06:39 +08:00
luma page video list component is ready
This commit is contained in:
parent
04d6ba0853
commit
d000cc5a67
@ -131,10 +131,10 @@ func (c RedisConfig) Url() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SystemConfig struct {
|
type SystemConfig struct {
|
||||||
Title string `json:"title,omitempty"` // 网站标题
|
Title string `json:"title,omitempty"` // 网站标题
|
||||||
Slogan string `json:"slogan,omitempty"` // 网站 slogan
|
Slogan string `json:"slogan,omitempty"` // 网站 slogan
|
||||||
AdminTitle string `json:"admin_title,omitempty"` // 管理后台标题
|
AdminTitle string `json:"admin_title,omitempty"` // 管理后台标题
|
||||||
Logo string `json:"logo,omitempty"`
|
Logo string `json:"logo,omitempty"` // 方形 Logo
|
||||||
InitPower int `json:"init_power,omitempty"` // 新用户注册赠送算力值
|
InitPower int `json:"init_power,omitempty"` // 新用户注册赠送算力值
|
||||||
DailyPower int `json:"daily_power,omitempty"` // 每日赠送算力
|
DailyPower int `json:"daily_power,omitempty"` // 每日赠送算力
|
||||||
InvitePower int `json:"invite_power,omitempty"` // 邀请新用户赠送算力值
|
InvitePower int `json:"invite_power,omitempty"` // 邀请新用户赠送算力值
|
||||||
|
@ -452,18 +452,24 @@ func (h *UserHandler) CLoginCallback(c *gin.Context) {
|
|||||||
// Session 获取/验证会话
|
// Session 获取/验证会话
|
||||||
func (h *UserHandler) Session(c *gin.Context) {
|
func (h *UserHandler) Session(c *gin.Context) {
|
||||||
user, err := h.GetLoginUser(c)
|
user, err := h.GetLoginUser(c)
|
||||||
if err == nil {
|
if err != nil {
|
||||||
var userVo vo.User
|
resp.NotAuth(c, err.Error())
|
||||||
err := utils.CopyObject(user, &userVo)
|
return
|
||||||
if err != nil {
|
|
||||||
resp.ERROR(c)
|
|
||||||
}
|
|
||||||
userVo.Id = user.Id
|
|
||||||
resp.SUCCESS(c, userVo)
|
|
||||||
} else {
|
|
||||||
resp.NotAuth(c)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var userVo vo.User
|
||||||
|
err = utils.CopyObject(user, &userVo)
|
||||||
|
if err != nil {
|
||||||
|
resp.ERROR(c, err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 用户 VIP 到期
|
||||||
|
if user.ExpiredTime > 0 && user.ExpiredTime < time.Now().Unix() {
|
||||||
|
h.DB.Model(&user).UpdateColumn("vip", false)
|
||||||
|
}
|
||||||
|
userVo.Id = user.Id
|
||||||
|
resp.SUCCESS(c, userVo)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type userProfile struct {
|
type userProfile struct {
|
||||||
|
@ -29,15 +29,9 @@ func NewLevelDB() (*LevelDB, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (db *LevelDB) Put(key string, value interface{}) error {
|
func (db *LevelDB) Put(key string, value interface{}) error {
|
||||||
var byteData []byte
|
byteData, err := json.Marshal(value)
|
||||||
if v, ok := value.(string); ok {
|
if err != nil {
|
||||||
byteData = []byte(v)
|
return err
|
||||||
} else {
|
|
||||||
b, err := json.Marshal(value)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
byteData = b
|
|
||||||
}
|
}
|
||||||
return db.driver.Put([]byte(key), byteData, nil)
|
return db.driver.Put([]byte(key), byteData, nil)
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
VUE_APP_API_HOST=http://localhost:5678
|
VUE_APP_API_HOST=http://localhost:5678
|
||||||
VUE_APP_WS_HOST=ws://localhost:5678
|
VUE_APP_WS_HOST=ws://localhost:5678
|
||||||
VUE_APP_USER=18575670125
|
VUE_APP_USER=18888888888
|
||||||
VUE_APP_PASS=12345678
|
VUE_APP_PASS=12345678
|
||||||
VUE_APP_ADMIN_USER=admin
|
VUE_APP_ADMIN_USER=admin
|
||||||
VUE_APP_ADMIN_PASS=admin123
|
VUE_APP_ADMIN_PASS=admin123
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 250 KiB After Width: | Height: | Size: 35 KiB |
@ -23,6 +23,8 @@
|
|||||||
.el-image {
|
.el-image {
|
||||||
width 48px
|
width 48px
|
||||||
height 48px
|
height 48px
|
||||||
|
background-color #ffffff
|
||||||
|
border-radius 50%
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,6 +56,7 @@
|
|||||||
|
|
||||||
.el-image {
|
.el-image {
|
||||||
height 50px
|
height 50px
|
||||||
|
background-color #ffffff
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-button {
|
.el-button {
|
||||||
@ -72,6 +73,9 @@
|
|||||||
.content {
|
.content {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
position relative
|
position relative
|
||||||
|
display flex
|
||||||
|
flex-flow: column;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 5rem;
|
font-size: 5rem;
|
||||||
@ -88,6 +92,10 @@
|
|||||||
max-width 900px
|
max-width 900px
|
||||||
padding 20px
|
padding 20px
|
||||||
|
|
||||||
|
.el-space--horizontal {
|
||||||
|
justify-content center
|
||||||
|
}
|
||||||
|
|
||||||
.nav-item {
|
.nav-item {
|
||||||
width 200px
|
width 200px
|
||||||
.el-button {
|
.el-button {
|
||||||
|
@ -30,6 +30,8 @@
|
|||||||
.el-image {
|
.el-image {
|
||||||
width 120px;
|
width 120px;
|
||||||
cursor pointer
|
cursor pointer
|
||||||
|
background-color #ffffff
|
||||||
|
border-radius 50%
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,12 +95,49 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.h-title {
|
|
||||||
color #ffffff
|
.video-container {
|
||||||
max-width 56rem
|
display flex
|
||||||
|
flex-flow column
|
||||||
width 100%
|
width 100%
|
||||||
padding 40px 20
|
padding 0 40px
|
||||||
font-size 36px
|
|
||||||
text-align left
|
.h-title {
|
||||||
|
color #ffffff
|
||||||
|
width 100%
|
||||||
|
font-size 36px
|
||||||
|
text-align left
|
||||||
|
}
|
||||||
|
|
||||||
|
.videos {
|
||||||
|
display flex
|
||||||
|
flex-flow row
|
||||||
|
|
||||||
|
.item {
|
||||||
|
|
||||||
|
.video-box {
|
||||||
|
width 100%
|
||||||
|
border-radius 10px
|
||||||
|
video,img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
border-radius 10px
|
||||||
|
cursor pointer
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-name {
|
||||||
|
color #e1e1e1
|
||||||
|
font-size 16px
|
||||||
|
white-space nowrap
|
||||||
|
overflow hidden
|
||||||
|
text-overflow ellipsis
|
||||||
|
padding 6px 0
|
||||||
|
text-align center
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -15,7 +15,7 @@ export function checkSession() {
|
|||||||
httpGet('/api/user/session').then(res => {
|
httpGet('/api/user/session').then(res => {
|
||||||
item.data = res.data
|
item.data = res.data
|
||||||
// cache expires after 10 secs
|
// cache expires after 10 secs
|
||||||
item.expire = Date.now() + 1000 * 60 * 5
|
item.expire = Date.now() + 1000 * 30
|
||||||
Storage.set(userDataKey, item)
|
Storage.set(userDataKey, item)
|
||||||
resolve(item.data)
|
resolve(item.data)
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
@ -37,7 +37,7 @@ export function checkAdminSession() {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
httpGet('/api/admin/session').then(res => {
|
httpGet('/api/admin/session').then(res => {
|
||||||
item.data = res.data
|
item.data = res.data
|
||||||
item.expire = Date.now() + 1000 * 60 * 5
|
item.expire = Date.now() + 1000 * 30
|
||||||
Storage.set(adminDataKey, item)
|
Storage.set(adminDataKey, item)
|
||||||
resolve(item.data)
|
resolve(item.data)
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
@ -59,7 +59,7 @@ export function getSystemInfo() {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
httpGet('/api/config/get?key=system').then(res => {
|
httpGet('/api/config/get?key=system').then(res => {
|
||||||
item.data = res
|
item.data = res
|
||||||
item.expire = Date.now() + 1000 * 60 * 10
|
item.expire = Date.now() + 1000 * 30
|
||||||
Storage.set(systemInfoKey, item)
|
Storage.set(systemInfoKey, item)
|
||||||
resolve(item.data)
|
resolve(item.data)
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
@ -77,7 +77,7 @@ export function getLicenseInfo() {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
httpGet('/api/config/license').then(res => {
|
httpGet('/api/config/license').then(res => {
|
||||||
item.data = res
|
item.data = res
|
||||||
item.expire = Date.now() + 1000 * 60 * 10
|
item.expire = Date.now() + 1000 * 30
|
||||||
Storage.set(licenseInfoKey, item)
|
Storage.set(licenseInfoKey, item)
|
||||||
resolve(item.data)
|
resolve(item.data)
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
<div class="navs">
|
<div class="navs">
|
||||||
<el-space wrap>
|
<el-space wrap>
|
||||||
<div v-for="item in navs" class="nav-item">
|
<div v-for="item in navs" :key="item.url" class="nav-item">
|
||||||
<el-button @click="router.push(item.url)" :color="theme.btnBgColor" :style="{color: theme.btnTextColor}" class="shadow" :dark="false">
|
<el-button @click="router.push(item.url)" :color="theme.btnBgColor" :style="{color: theme.btnTextColor}" class="shadow" :dark="false">
|
||||||
<i :class="'iconfont '+iconMap[item.url]"></i>
|
<i :class="'iconfont '+iconMap[item.url]"></i>
|
||||||
<span>{{item.name}}</span>
|
<span>{{item.name}}</span>
|
||||||
|
@ -27,7 +27,21 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2 class="h-title">你的作品</h2>
|
<el-container class="video-container">
|
||||||
|
<h2 class="h-title">你的作品</h2>
|
||||||
|
|
||||||
|
<el-row :gutter="20" class="videos">
|
||||||
|
<el-col :span="8" class="item" :key="item.id" v-for="item in videos">
|
||||||
|
<div class="video-box" @mouseover="item.playing = true" @mouseout="item.playing = false">
|
||||||
|
<img :src="item.cover" :alt="item.name" v-if="!item.playing"/>
|
||||||
|
<video :src="item.url" preload="auto" :autoplay="true" loop="loop" muted="muted" v-else>
|
||||||
|
您的浏览器不支持视频播放
|
||||||
|
</video>
|
||||||
|
</div>
|
||||||
|
<div class="video-name">{{item.name}}</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-container>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -42,11 +56,27 @@ const images = ref([
|
|||||||
"http://nk.img.r9it.com/chatgpt-plus/1719371605709871.jpg"
|
"http://nk.img.r9it.com/chatgpt-plus/1719371605709871.jpg"
|
||||||
])
|
])
|
||||||
|
|
||||||
const list = ref([
|
const videos = ref([
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
name: '1',
|
name: 'a dancing girl',
|
||||||
url: 'http://localhost/download/xmind.mp4'
|
url: 'http://localhost/download/xmind.mp4',
|
||||||
|
cover: 'https://storage.cdn-luma.com/dream_machine/d133794f-3124-4059-a9f2-e5fed79f0d5b/video_0_thumb.jpg',
|
||||||
|
playing: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
name: 'a dancing girl',
|
||||||
|
url: 'http://localhost/download/dancing.mp4',
|
||||||
|
cover: 'https://storage.cdn-luma.com/dream_machine/92efa55a-f381-4161-a999-54f8fe460fca/video_1_thumb.jpg',
|
||||||
|
playing: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
name: 'a dancing girl',
|
||||||
|
url: 'http://localhost/download/xmind.mp4',
|
||||||
|
cover: 'https://storage.cdn-luma.com/dream_machine/d133794f-3124-4059-a9f2-e5fed79f0d5b/video_0_thumb.jpg',
|
||||||
|
playing: false
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
|
@ -23,8 +23,8 @@
|
|||||||
--el-table-row-hover-bg-color:#373C47;
|
--el-table-row-hover-bg-color:#373C47;
|
||||||
--el-table-header-bg-color:#474E5C;
|
--el-table-header-bg-color:#474E5C;
|
||||||
--el-table-text-color:#d1d1d1">
|
--el-table-text-color:#d1d1d1">
|
||||||
<el-table-column prop="username" label="用户"/>
|
<el-table-column prop="username" label="用户" width="130px"/>
|
||||||
<el-table-column prop="model" label="模型"/>
|
<el-table-column prop="model" label="模型" width="130px"/>
|
||||||
<el-table-column prop="type" label="类型">
|
<el-table-column prop="type" label="类型">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tag size="small" :type="tagColors[scope.row.type]">{{ scope.row.type_str }}</el-tag>
|
<el-tag size="small" :type="tagColors[scope.row.type]">{{ scope.row.type_str }}</el-tag>
|
||||||
@ -39,7 +39,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="balance" label="余额"/>
|
<el-table-column prop="balance" label="余额"/>
|
||||||
<el-table-column label="发生时间">
|
<el-table-column label="发生时间" width="160px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span>{{ dateFormat(scope.row['created_at']) }}</span>
|
<span>{{ dateFormat(scope.row['created_at']) }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
@ -335,6 +335,8 @@ const doSubmitRegister = (verifyData) => {
|
|||||||
.el-image {
|
.el-image {
|
||||||
width 120px;
|
width 120px;
|
||||||
cursor pointer
|
cursor pointer
|
||||||
|
background-color #ffffff
|
||||||
|
border-radius 50%
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,6 +145,8 @@ const doLogin = function (verifyData) {
|
|||||||
.el-image {
|
.el-image {
|
||||||
width 120px;
|
width 120px;
|
||||||
cursor pointer
|
cursor pointer
|
||||||
|
background-color #ffffff
|
||||||
|
border-radius 50%
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -376,6 +376,12 @@
|
|||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
|
|
||||||
|
<h3>激活后可获得以下权限:</h3>
|
||||||
|
<ol class="active-info">
|
||||||
|
<li>1、使用任意第三方中转 API KEY,而不用局限于 GeekAI 推荐的白名单列表</li>
|
||||||
|
<li>2、可以在相关页面去除 GeekAI 的版权信息,或者修改为自己的版权信息</li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
<el-form :model="system" label-width="150px" label-position="right">
|
<el-form :model="system" label-width="150px" label-position="right">
|
||||||
<el-form-item label="许可授权码" prop="license">
|
<el-form-item label="许可授权码" prop="license">
|
||||||
<el-input v-model="licenseKey"/>
|
<el-input v-model="licenseKey"/>
|
||||||
@ -592,6 +598,11 @@ const onUploadImg = (files, callback) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.active-info {
|
||||||
|
line-height 1.5
|
||||||
|
padding 10px 0 30px 0
|
||||||
|
}
|
||||||
.el-descriptions {
|
.el-descriptions {
|
||||||
margin-bottom 20px
|
margin-bottom 20px
|
||||||
.el-icon {
|
.el-icon {
|
||||||
|
Loading…
Reference in New Issue
Block a user