liuhairui před 3 týdny
rodič
revize
bbacba91b5

+ 1 - 1
application/api/controller/User.php

@@ -182,7 +182,7 @@ class User extends Api
         $user->bio = $bio;
         $user->avatar = $avatar;
         $user->save();
-        $this->success();
+        $this->success(__('修改成功'));
     }
 
     /**

+ 5 - 4
application/api/controller/WorkOrder.php

@@ -1201,7 +1201,7 @@ class WorkOrder extends Api{
             $size = $params['size'] ?? '';
             $style = $params['style'] ?? '';
             $type = $params['type'] ?? '';
-            $sys_id = $params['sys_id'] ?? '';
+            $user_id = $params['user_id'] ?? '';
             $seconds = $params['seconds'] ?? '';
             $video_id = $params['video_id'] ?? '';
 
@@ -1210,6 +1210,7 @@ class WorkOrder extends Api{
             }
 
             $data = [
+                'toexamine' => "未审核",
                 'chinese_description' => $chinese_description,
                 'template_image_url' => $template_image_url,
                 'template_name' => $template_name,
@@ -1218,8 +1219,8 @@ class WorkOrder extends Api{
                 'seconds' => $seconds,
                 'size' => $size,
                 'video_id' => $video_id,
-                'sys_id' => $sys_id,
-                'sys_rq' => date('Y-m-d H:i:s'),
+                'user_id' => $user_id,
+                'sys_rq' => date('Y-m-d'),
                 'create_time' => date('Y-m-d H:i:s')
             ];
 
@@ -1253,7 +1254,7 @@ class WorkOrder extends Api{
     public function product_template()
     {
         // 查询模版表
-        $products = Db::name('product_template')->select();
+        $products = Db::name('product_template')->order('id desc')->select();
 
         $http_url = Db::name('http_url')->field('baseUrl,port')->find();
         if ($products && $http_url) {

+ 1 - 0
application/api/lang/zh-cn/user.php

@@ -36,4 +36,5 @@ return [
     'Change password failure'               => '修改密码失败',
     'Change password successful'            => '修改密码成功',
     'Reset password successful'             => '重置密码成功',
+    '修改成功'                              => '修改成功',
 ];

+ 48 - 26
application/index/controller/User.php

@@ -156,7 +156,7 @@ class User extends Frontend
     {
         $url = $this->request->request('url', '', 'url_clean');
         if ($this->auth->id) {
-            $this->success(__('You\'ve logged in, do not login again'), $url ?: url('user/index'));
+            $this->success(__('You\'ve logged in, do not login again'), $url ?: url('user/template'));
         }
         if ($this->request->isPost()) {
             $account = $this->request->post('account');
@@ -186,7 +186,7 @@ class User extends Frontend
                 $this->error(__($validate->getError()), null, ['token' => $this->request->token()]);
             }
             if ($this->auth->login($account, $password)) {
-                $this->success(__('Logged in successful'), $url ? $url : url('user/index'));
+                $this->success(__('Logged in successful'), $url ? $url : url('user/template'));
             } else {
                 $this->error($this->auth->getError(), null, ['token' => $this->request->token()]);
             }
@@ -358,7 +358,24 @@ class User extends Frontend
         }
 
         // 查询模版表
-        $products = Db::name('product_template')
+        $products = Db::name('product_template')->alias('a')
+            ->field('
+                a.chinese_description,
+                a.template_image_url,
+                a.template_name,
+                a.template_name,
+                a.style,
+                a.size,
+                a.type,
+                a.video_id,
+                a.seconds,
+                a.user_id,
+                a.toexamine,
+                b.id,
+                b.avatar,
+                b.nickname
+            ')
+            ->join('user b', 'a.user_id = b.id', 'left')
             ->where($where)->order('id desc')
             ->where('mod_rq', null)
             ->where('toexamine', '审核通过')
@@ -391,34 +408,14 @@ class User extends Frontend
     }
 
     public function text_to_image(){
+        $user = $this->auth->getUserinfo();
+        $this->view->assign('user', $user);
         return $this->view->fetch();
     }
 
     public function text_to_video(){
-        return $this->view->fetch();
-    }
-
-    public function diagrams_list(){
-        // 获取作品ID
-        $id = input('param.id', 0, 'intval');
-
-        if (empty($id)) {
-            $this->error(__('Invalid parameter'));
-        }
-        //获取用户信息
         $user = $this->auth->getUserinfo();
-        $user_info = Db::name('user')->where('id',$user['id'])->find();
-
-        // 根据ID查询作品信息,允许查询已删除的作品(mod_rq不为null)
-        $product = Db::name('product_template')->where('id', $id)->find();
-
-        if (empty($product)) {
-            $this->error(__('Product not found'));
-        }
-
-        // 将作品信息传递给视图
-        $this->view->assign('user_info', $user_info);
-        $this->view->assign('product', $product);
+        $this->view->assign('user', $user);
         return $this->view->fetch();
     }
 
@@ -445,6 +442,31 @@ class User extends Frontend
         return $this->view->fetch();
     }
 
+    public function diagrams_list(){
+        // 获取作品ID
+        $id = input('param.id', 0, 'intval');
+
+        if (empty($id)) {
+            $this->error(__('Invalid parameter'));
+        }
+
+        // 根据ID查询作品信息,允许查询已删除的作品(mod_rq不为null)
+        $product = Db::name('product_template')
+        ->where('id', $id)
+        ->where('mod_rq', null)
+        ->find();
+        $user_info = Db::name('user')->where('id',$product['user_id'])->find();
+
+        if (empty($product)) {
+            $this->error(__('Product not found'));
+        }
+
+        // 将作品信息传递给视图
+        $this->view->assign('user_info', $user_info);
+        $this->view->assign('product', $product);
+        return $this->view->fetch();
+    }
+
     /**
      * 软删除 保留数据
      * 只修改 mod_rq

+ 2 - 2
application/index/view/user/diagrams.html

@@ -243,7 +243,7 @@
         <div class="sidebar">
             <ul class="menu">
                 <li class="menu-item active">
-                    <a href="{:url('user/diagrams')}">我的作品</a>
+                    <a href="{:url('user/diagrams')}">我的模版</a>
                 </li>
                 <li class="menu-item">
                     <a href="{:url('user/recycle')}">收回站</a>
@@ -255,7 +255,7 @@
         <div class="diagrams-content">
             <!-- 标签页 -->
             <div class="tabs">
-                <div class="tab-item active">全部作品</div>
+                <div class="tab-item active">全部模版</div>
             </div>
 
             <!-- 内容区域 -->

+ 2 - 2
application/index/view/user/diagrams_list.html

@@ -215,7 +215,7 @@
         <div class="sidebar">
             <ul class="menu">
                 <li class="menu-item">
-                    <a href="{:url('user/diagrams')}">我的作品</a>
+                    <a href="{:url('user/diagrams')}">我的模版</a>
                 </li>
                 <li class="menu-item">
                     <a href="{:url('user/recycle')}">收回站</a>
@@ -252,7 +252,7 @@
                     </div>
                     <div class="info-item">
                         <span class="info-label">创建时间</span>
-                        <span class="info-value">{$product.create_time}</span>
+                        <span class="info-value">{$product.sys_rq}</span>
                     </div>
                     <div class="info-item">
                         <span class="info-label">审核状态</span>

+ 22 - 22
application/index/view/user/profile.html

@@ -65,30 +65,30 @@
                                 <input id="c-bio" data-rule="" data-tip="一句话介绍一下你自己" class="form-control" name="bio" type="text" value="{$user.bio|htmlentities}">
                             </div>
                         </div>
-                        <div class="form-group">
-                            <label for="c-email" class="control-label col-xs-12 col-sm-2">{:__('Email')}:</label>
-                            <div class="col-xs-12 col-sm-4">
-                                <div class="input-group">
-                                    <input type="text" class="form-control" id="c-email" name="email" value="{$user.email|htmlentities}" disabled placeholder="">
-                                    <span class="input-group-btn" style="padding:0;border:none;">
-                                        <a href="javascript:;" class="btn btn-info btn-change" data-type="email">{:__('Change')}</a>
-                                    </span>
-                                </div>
+<!--                        <div class="form-group">-->
+<!--                            <label for="c-email" class="control-label col-xs-12 col-sm-2">{:__('Email')}:</label>-->
+<!--                            <div class="col-xs-12 col-sm-4">-->
+<!--                                <div class="input-group">-->
+<!--                                    <input type="text" class="form-control" id="c-email" name="email" value="{$user.email|htmlentities}" disabled placeholder="">-->
+<!--                                    <span class="input-group-btn" style="padding:0;border:none;">-->
+<!--                                        <a href="javascript:;" class="btn btn-info btn-change" data-type="email">{:__('Change')}</a>-->
+<!--                                    </span>-->
+<!--                                </div>-->
 
-                            </div>
-                        </div>
-                        <div class="form-group">
-                            <label for="c-mobile" class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label>
-                            <div class="col-xs-12 col-sm-4">
-                                <div class="input-group">
-                                    <input type="text" class="form-control" id="c-mobile" name="mobile" value="{$user.mobile|htmlentities}" disabled placeholder="">
-                                    <span class="input-group-btn" style="padding:0;border:none;">
-                                        <a href="javascript:;" class="btn btn-info btn-change" data-type="mobile">{:__('Change')}</a>
-                                    </span>
-                                </div>
+<!--                            </div>-->
+<!--                        </div>-->
+<!--                        <div class="form-group">-->
+<!--                            <label for="c-mobile" class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label>-->
+<!--                            <div class="col-xs-12 col-sm-4">-->
+<!--                                <div class="input-group">-->
+<!--                                    <input type="text" class="form-control" id="c-mobile" name="mobile" value="{$user.mobile|htmlentities}" disabled placeholder="">-->
+<!--                                    <span class="input-group-btn" style="padding:0;border:none;">-->
+<!--                                        <a href="javascript:;" class="btn btn-info btn-change" data-type="mobile">{:__('Change')}</a>-->
+<!--                                    </span>-->
+<!--                                </div>-->
 
-                            </div>
-                        </div>
+<!--                            </div>-->
+<!--                        </div>-->
                         <div class="form-group normal-footer">
                             <label class="control-label col-xs-12 col-sm-2"></label>
                             <div class="col-xs-12 col-sm-8">

+ 35 - 31
application/index/view/user/template.html

@@ -40,7 +40,7 @@
             font-size: 16px;
             color: #666;
         }
-       
+
         /* 模板区域样式 */
         .template-section {
             max-width: 1200px;
@@ -158,7 +158,7 @@
             font-size: 12px;
             color: #999;
         }
-        
+
         /* 图片放大样式 */
         .template-thumbnail {
             position: relative;
@@ -213,7 +213,7 @@
                 <button id="searchBtn" type="button">查询</button>
             </div>
         </div>
-        
+
         <div class="template-header">
             <h2 class="template-title">全部模板</h2>
             <div class="filter-options">
@@ -233,22 +233,26 @@
                 </div>
             </div>
         </div>
-        
+
         <div class="template-grid" id="templateGrid">
             <!-- 使用volist标签循环显示模板 -->
             {volist name="products" id="template"}
             <div class="template-card">
                 <div class="template-thumbnail">
                     {if condition="$template.type eq '文生图'"}
-                        <img src="{$template.template_image_url}" alt="{$template.template_name}" onclick="showMedia('{$template.template_image_url}', '{$template.type}')" onerror="this.src=''; this.alt='图片加载失败';">
+                        <a href="{:url('user/diagrams_list', ['id' => $template.id])}">
+                            <img src="{$template.template_image_url}" alt="{$template.template_name}" onerror="this.src=''; this.alt='图片加载失败';">
+                        </a>
                     {elseif condition="$template.type eq '文生视频'"}
-                        <video src="{$template.template_image_url}" alt="{$template.template_name}" controls muted onclick="showMedia('{$template.template_image_url}', '{$template.type}')"></video>
+                        <a href="{:url('user/diagrams_list', ['id' => $template.id])}">
+                            <video src="{$template.template_image_url}" alt="{$template.template_name}" controls muted></video>
+                        </a>
                     {/if}
                 </div>
                 <div class="template-info">
                     <div class="template-name">{$template.template_name}</div>
                     <div class="template-meta">
-                        <span>{if condition="$template.type eq '文生图'"}图片{else}视频{/if}</span>
+                        <span style="color: black">{$template.nickname}</span>
                         <span>免费</span>
                     </div>
                 </div>
@@ -256,33 +260,33 @@
             {/volist}
         </div>
     </section>
-    
+
     <!-- 大图查看容器 -->
     <div id="largeViewContainer">
         <div id="largeMediaContent"></div>
     </div>
-    
+
     <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
     <script>
         // 初始化变量
         let currentKeyword = '{$keyword|default=\'\'}';
         let currentType = '{$type|default=\'\'}';
-        
+
         // 搜索函数
         function searchTemplates() {
             // 获取当前的关键词和类型
             const keyword = $('#keywordInput').val().trim();
             const type = $('#typeFilter').val();
-            
+
             // 如果参数没有变化,不发送请求
             if (keyword === currentKeyword && type === currentType) {
                 return;
             }
-            
+
             // 更新当前参数
             currentKeyword = keyword;
             currentType = type;
-            
+
             // 发送AJAX请求
             $.ajax({
                 url: '{:url("index/user/template")}',
@@ -305,18 +309,18 @@
                 }
             });
         }
-        
+
         // 更新模板网格
         function updateTemplateGrid(templates) {
             const templateGrid = $('#templateGrid');
             templateGrid.empty(); // 清空现有内容
-            
+
             // 如果没有模板,显示提示
             if (templates.length === 0) {
                 templateGrid.append('<div style="grid-column: 1 / -1; text-align: center; padding: 50px; color: #666;">暂无匹配的模板</div>');
                 return;
             }
-            
+
             // 循环生成模板卡片
             $.each(templates, function(index, template) {
                 let mediaElement;
@@ -326,7 +330,7 @@
                 } else if (template.type === '文生视频') {
                     mediaElement = `<video src="${template.template_image_url}" alt="${template.template_name}" controls muted onclick="showMedia('${template.template_image_url}', '${template.type}')"></video>`;
                 }
-                
+
                 // 创建模板卡片
                 const templateCard = `
                     <div class="template-card">
@@ -342,16 +346,16 @@
                         </div>
                     </div>
                 `;
-                
+
                 templateGrid.append(templateCard);
             });
         }
-        
+
         // 类型筛选函数
         function filterByType(type) {
             // 更新类型筛选器的值
             $('#typeFilter').val(type);
-            
+
             // 更新类型筛选按钮的样式
             $('#typeAll, #typeImage, #typeVideo').css({'background-color': '', 'color': '#333'});
             if (type === '') {
@@ -361,23 +365,23 @@
             } else if (type === '文生视频') {
                 $('#typeVideo').css({'background-color': '#e9ecef', 'color': '#007bff'});
             }
-            
+
             // 执行搜索
             searchTemplates();
         }
-        
+
         // 搜索按钮点击事件
         $('#searchBtn').click(function() {
             searchTemplates();
         });
-        
+
         // 搜索框回车事件
         $('#keywordInput').keypress(function(e) {
             if (e.key === 'Enter') {
                 searchTemplates();
             }
         });
-        
+
         // 搜索框输入事件(可选:实现实时搜索)
         let searchTimer;
         $('#keywordInput').on('input', function() {
@@ -385,15 +389,15 @@
             // 延迟300ms执行搜索,避免频繁请求
             searchTimer = setTimeout(searchTemplates, 300);
         });
-        
+
         // 图片/视频放大查看功能
         function showMedia(url, type) {
             const container = document.getElementById('largeViewContainer');
             const content = document.getElementById('largeMediaContent');
-            
+
             // 清空容器
             content.innerHTML = '';
-            
+
             // 创建媒体元素
             if (type === '文生图') {
                 const img = document.createElement('img');
@@ -406,16 +410,16 @@
                 video.controls = true;
                 content.appendChild(video);
             }
-            
+
             // 显示大图查看容器
             container.style.display = 'flex';
         }
-        
+
         // 关闭大图查看
         function closeLargeView() {
             document.getElementById('largeViewContainer').style.display = 'none';
         }
-        
+
         // 点击大图容器关闭
         document.getElementById('largeViewContainer').addEventListener('click', function(event) {
             // 只有点击容器本身才关闭,避免点击媒体元素也关闭
@@ -423,7 +427,7 @@
                 closeLargeView();
             }
         });
-        
+
         // 按ESC键关闭大图查看
         document.addEventListener('keydown', function(event) {
             if (event.key === 'Escape') {

+ 5 - 54
application/index/view/user/text_to_image.html

@@ -6,59 +6,15 @@
     <meta http-equiv="X-UA-Compatible" content="ie=edge">
     <title>生成模板 - 文生图</title>
     <!-- 引入Font Awesome图标 -->
-    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
+   <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
     <!-- 引入自定义CSS -->
     <link rel="shortcut icon" href="__CDN__/assets/img/favicon.ico"/>
     <style>
-        /* 自定义提示框样式 */
-        .custom-alert {
-            position: fixed;
-            top: 10%;
-            left: 50%;
-            transform: translate(-50%, -50%);
-            padding: 15px 25px;
-            border-radius: 8px;
-            color: white;
-            font-size: 14px;
-            font-weight: 500;
-            z-index: 10000;
-            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
-            opacity: 0;
-            visibility: hidden;
-            transition: all 0.3s ease;
-            max-width: 80%;
-            text-align: center;
-        }
-        .custom-alert.show {
-            opacity: 1;
-            visibility: visible;
-        }
-        .custom-alert.error {
-            background-color: #e74c3c;
-        }
-        .custom-alert.success {
-            background-color: #28a745;
-        }
-        .custom-alert.warning {
-            background-color: #ffc107;
-            color: #333;
-        }
-        .custom-alert.info {
-            background-color: #17a2b8;
-        }
-
         * {
             margin: 0;
             padding: 0;
             box-sizing: border-box;
         }
-        /* 标题样式 */
-        .page-title {
-            font-size: 24px;
-            font-weight: bold;
-            margin-bottom: 25px;
-            color: #333;
-        }
         /* 内容区域 */
         .content-area {
             display: grid;
@@ -221,15 +177,7 @@
             font-size: 14px;
             margin-bottom: 10px;
         }
-        /* 响应式设计 */
-        @media (max-width: 768px) {
-            .content-area {
-                grid-template-columns: 1fr;
-            }
-            .clear-btn, .optimize-btn, .arrow-btn {
-                flex: 1;
-            }
-        }
+
         .optimize-btn {
             background-color: #ffffff;
             color: #4b5563;
@@ -348,6 +296,7 @@
         <!-- 左侧输入区域 -->
         <div class="input-section">
             <h3 style="font-size: 18px; font-weight: bold; margin-bottom: 15px; color: #333;">文生图生成参数设置</h3>
+            <input type="text" value="{$user.id}" id="user_id" disabled style="display: none">
 
             <!-- 提示词示例 -->
             <div class="prompt-examples">
@@ -677,6 +626,7 @@
         const style = document.getElementById('style').value;
         const imageSize = document.getElementById('imageSize').value;
         const previewImage = document.getElementById('previewImage');
+        const user_id = document.getElementById('user_id');
 
         // 验证必填项
         if (!templateName.trim()) {
@@ -710,6 +660,7 @@
             template_name: templateName,
             style: style,
             size: imageSize,
+            user_id:user_id,
             type: '文生图' // 固定为文生图类型
         };
 

+ 32 - 28
application/index/view/user/text_to_video.html

@@ -330,7 +330,7 @@
     <!-- 菜单功能区 -->
     <div class="menu-container">
         <div class="menu-item">
-            <a href="{:url('user/index')}">
+            <a href="{:url('user/text_to_image')}">
                 <i class="fas fa-image"></i>
                 文生图
             </a>
@@ -348,6 +348,7 @@
         <!-- 左侧输入区域 -->
         <div class="input-section">
             <h3 style="font-size: 18px; font-weight: bold; margin-bottom: 15px; color: #333;">文生视频生成参数设置</h3>
+            <input type="text" value="{$user.id}" id="user_id" disabled style="display: none">
 
             <!-- 提示词示例 -->
             <div class="prompt-examples">
@@ -461,6 +462,7 @@
         const videoSize = document.getElementById('videoSize').value;
         const videoResultDiv = document.getElementById('videoResult');
 
+
         // 检查是否有提示词
         if (!promptText) {
             alert('请先输入视频描述');
@@ -506,12 +508,12 @@
                 if (response.code === 0 && response.data && response.data.web_url) {
                     // 视频生成完成
                     let videoUrl = response.data.web_url;
-                    
+
                     // 确保web_url格式正确,添加根路径前缀
                     if (videoUrl && !videoUrl.startsWith('/')) {
                         videoUrl = '/' + videoUrl;
                     }
-                    
+
                     // 显示生成的视频
                     videoResultDiv.innerHTML = `
                             <div class="video-container">
@@ -529,7 +531,7 @@
                         web_url: videoUrl,
                         video_id: response.data.video_id || response.data.id || ''
                     };
-                    
+
                     // 启用下载按钮和保存模板按钮
                     document.getElementById('downloadBtn').disabled = false;
                     document.getElementById('saveBtn').disabled = false;
@@ -605,7 +607,7 @@
                     const videoId = response.data.video_id;
                     const status = response.data.status;
                     const progress = response.data.progress || 0;
-                    
+
                     // 显示接口返回的message信息
                     const message = response.msg || response.data.message || '';
                     // <p style="font-size: 12px; margin-top: 10px; color: #999;">视频ID: ${videoId}</p>
@@ -621,7 +623,7 @@
                                 <p style="font-size: 12px; margin-top: 5px; color: #999;">系统正在自动检查视频生成状态...</p>
                             </div>
                         `;
-                    
+
                     // 开始轮询检查视频状态
                     startVideoPolling(videoId, videoStyle, videoDuration, videoSize);
                 } else {
@@ -658,7 +660,7 @@
         $('.clear-btn').click(clearPrompt);
         // 绑定一键优化按钮点击事件
         $('.optimize-btn').click(optimizePrompt);
-        
+
         // 键盘ESC键关闭模态框事件
         document.addEventListener('keydown', function(event) {
             if (event.key === 'Escape') {
@@ -742,7 +744,7 @@
         let pollingCount = 0;
         const maxPollingCount = 60; // 最大轮询次数 (30次 * 5秒 = 2.5分钟)
         const pollingInterval = 6000; // 轮询间隔 (5秒)
-        
+
         // 轮询检查视频状态
         const pollingTimer = setInterval(function() {
             $.ajax({
@@ -756,15 +758,15 @@
                     if (response.code === 0 && response.data && response.data.web_url) {
                         // 视频生成完成
                         clearInterval(pollingTimer);
-                        
+
                         const videoResultDiv = document.getElementById('videoResult');
                         let videoUrl = response.data.web_url;
-                        
+
                         // 确保web_url格式正确,添加根路径前缀
                         if (videoUrl && !videoUrl.startsWith('/')) {
                             videoUrl = '/' + videoUrl;
                         }
-                        
+
                         // 显示生成的视频
                         videoResultDiv.innerHTML = `
                                 <div class="video-container">
@@ -773,7 +775,7 @@
                                     </video>
                                 </div>
                             `;
-                        
+
                         // 更新视频信息到全局变量
                         videoInfo = {
                             style: videoStyle,
@@ -782,11 +784,11 @@
                             web_url: videoUrl,
                             video_id: response.data.video_id || videoId
                         };
-                        
+
                         // 启用下载按钮和保存模板按钮
                         document.getElementById('downloadBtn').disabled = false;
                         document.getElementById('saveBtn').disabled = false;
-                        
+
                         // 添加视频放大模态框(如果还不存在)
                         if (!document.getElementById('videoModal')) {
                             const modal = document.createElement('div');
@@ -857,11 +859,11 @@
                         // 视频仍在生成中,更新状态信息
                         const status = response.data.status;
                         const progress = response.data.progress || 0;
-                        
+
                         const progressBar = videoResultDiv.querySelector('.progress-bar');
                         const statusText = videoResultDiv.querySelector('.video-processing p:nth-child(3)');
                         const progressText = videoResultDiv.querySelector('.video-processing p:nth-child(4)');
-                        
+
                         if (progressBar) {
                             progressBar.style.width = `${progress}%`;
                         }
@@ -901,7 +903,7 @@
                         `;
                 }
             });
-            
+
             // 检查是否达到最大轮询次数
             pollingCount++;
             if (pollingCount >= maxPollingCount) {
@@ -919,7 +921,7 @@
             }
         }, pollingInterval);
     }
-    
+
     // 手动检查视频状态函数
     function checkVideoStatus(videoId) {
         $.ajax({
@@ -934,12 +936,12 @@
                     // 视频生成完成,直接显示结果
                     const videoResultDiv = document.getElementById('videoResult');
                     let videoUrl = response.data.web_url;
-                    
+
                     // 确保web_url格式正确,添加根路径前缀
                     if (videoUrl && !videoUrl.startsWith('/')) {
                         videoUrl = '/' + videoUrl;
                     }
-                    
+
                     // 显示生成的视频
                     videoResultDiv.innerHTML = `
                             <div class="video-container">
@@ -948,17 +950,17 @@
                                 </video>
                             </div>
                         `;
-                    
+
                     // 更新视频信息到全局变量
                     videoInfo = {
                         video_id: response.data.video_id || videoId,
                         web_url: videoUrl
                     };
-                    
+
                     // 启用下载按钮和保存模板按钮
                     document.getElementById('downloadBtn').disabled = false;
                     document.getElementById('saveBtn').disabled = false;
-                    
+
                     // 添加视频放大模态框(如果还不存在)
                     if (!document.getElementById('videoModal')) {
                         const modal = document.createElement('div');
@@ -1066,24 +1068,26 @@
             }
         });
     }
-    
+
     // 保存模板函数
     function saveTemplate() {
         // 获取模板名称
         const templateName = document.getElementById('templateName').value.trim();
         const textarea = document.getElementById('prompt');
+        const user_id = document.getElementById('user_id');
+
         // 验证模板名称
         if (!templateName) {
             showAlert('模板名称不能为空');
             return;
         }
-        
+
         // 检查是否有视频信息
         if (!videoInfo || !videoInfo.web_url) {
             showAlert('请先生成视频');
             return;
         }
-        
+
         // 构建请求参数
         const params = {
             chinese_description: textarea.value.trim(),
@@ -1092,11 +1096,11 @@
             size: videoInfo.size,
             style: videoInfo.style,
             type: "文生视频",
-            sys_id:"管理员",
+            user_id:user_id,
             seconds: videoInfo.duration,
             video_id: videoInfo.video_id
         };
-        
+
         // 发送请求保存模板
         $.ajax({
             url: '/index.php/api/work_order/Add_Product_Template',

+ 9 - 0
public/assets/css/user.css

@@ -70,4 +70,13 @@ body.sidebar-open .sidenav {
 body.sidebar-open .sidebar-toggle i:before {
   content: "\f00d";
 }
+.navbar-brand {
+  color: #333 !important;
+}
+
+.navbar-brand.active {
+  color: #1890ff !important;
+  font-weight: bold;
+}
+
 /*# sourceMappingURL=user.css.map */