@@ -160,17 +160,44 @@ EventsOn("newChatStream",async (msg) => {
160160})
161161
162162EventsOn (" updateVersion" ,async (msg ) => {
163+ const githubTimeStr = msg .published_at ;
164+ // 创建一个 Date 对象
165+ const utcDate = new Date (githubTimeStr);
166+
167+ // 获取本地时间
168+ const date = new Date (utcDate .getTime () + utcDate .getTimezoneOffset () * 60 * 1000 );
169+
170+ const year = date .getFullYear ();
171+ // getMonth 返回值是 0 - 11,所以要加 1
172+ const month = String (date .getMonth () + 1 ).padStart (2 , ' 0' );
173+ const day = String (date .getDate ()).padStart (2 , ' 0' );
174+ const hours = String (date .getHours ()).padStart (2 , ' 0' );
175+ const minutes = String (date .getMinutes ()).padStart (2 , ' 0' );
176+ const seconds = String (date .getSeconds ()).padStart (2 , ' 0' );
177+
178+ const formattedDate = ` ${ year} -${ month} -${ day} ${ hours} :${ minutes} :${ seconds} ` ;
179+
180+ console .log (" GitHub UTC 时间:" , utcDate);
181+ console .log (" 转换后的本地时间:" , formattedDate);
163182 notify .info ({
164183 avatar : () =>
165184 h (NAvatar, {
166185 size: ' small' ,
167186 round: false ,
168187 src: ' https://github.com/ArvinLovegood/go-stock/raw/master/build/appicon.png'
169188 }),
170- title: ' 发现新版本' ,
171- content: ' 请前往发布页下载更新' ,
189+ title: ' 发现新版本: ' + msg .tag_name ,
190+ content : () => {
191+ // return h(MdPreview, {theme:'dark',modelValue:msg.commit?.message}, null)
192+ return h (' div' , {
193+ style: {
194+ ' text-align' : ' left' ,
195+ ' font-size' : ' 14px' ,
196+ }
197+ }, { default : () => msg .commit ? .message })
198+ },
172199 duration: 0 ,
173- meta: msg . name ,
200+ meta: " 发布时间: " + formattedDate ,
174201 action : () => {
175202 return h (NButton, {
176203 type: ' primary' ,
@@ -460,8 +487,8 @@ function getHeight() {
460487
461488< template>
462489 < n- grid : x- gap= " 8" : cols= " 3" : y- gap= " 8" >
463- <n-gi v-for =" result in sortedResults" >
464- <n-card :data-code =" result['股票代码']" :bordered =" false" :title =" result['股票名称']" :closable =" false" @close =" removeMonitor(result['股票代码'],result['股票名称'],result.key)" >
490+ < n- gi v- for = " result in sortedResults" style = " margin-left: 2px " onmouseover = " this.style.border='1px solid #3498db' " onmouseout = " this.style.border='0px' " >
491+ < n- card : data- code= " result['股票代码']" : bordered= " false" : title= " result['股票名称']" : closable= " false" @close= " removeMonitor(result['股票代码'],result['股票名称'],result.key)" >
465492 < n- grid : cols= " 1" : y- gap= " 6" >
466493 < n- gi>
467494 < n- text : type= " result.type" >
0 commit comments