refactor(frontend):重构关于页面并添加作者信息

- 更新了 about.vue 页面布局和内容- 添加了作者信息和邮箱链接
- 移除了更新说明部分
- 调整了软件描述的样式和内容
This commit is contained in:
spark 2025-02-08 17:26:10 +08:00
parent 86183f4585
commit 9b080bbb45
6 changed files with 30 additions and 102 deletions

4
app.go
View File

@ -413,10 +413,6 @@ func (a *App) SendDingDingMessageByType(message string, stockCode string, msgTyp
return data.NewDingDingAPI().SendDingDingMessage(message)
}
func (a *App) NewChat(stock string) string {
return data.NewDeepSeekOpenAi().NewChat(stock)
}
func (a *App) NewChatStream(stock, stockCode string) {
msgs := data.NewDeepSeekOpenAi().NewChatStream(stock, stockCode)
for msg := range msgs {

View File

@ -74,60 +74,6 @@ type AiResponse struct {
SystemFingerprint string `json:"system_fingerprint"`
}
func (o OpenAi) NewChat(stock string) string {
client := resty.New()
client.SetBaseURL(o.BaseUrl)
client.SetHeader("Authorization", "Bearer "+o.ApiKey)
client.SetHeader("Content-Type", "application/json")
res := &AiResponse{}
_, err := client.R().
SetResult(res).
SetBody(map[string]interface{}{
"model": o.Model,
"max_tokens": o.MaxTokens,
"temperature": o.Temperature,
"messages": []map[string]interface{}{
{
"role": "system",
"content": "作为一位专业的A股市场分析师和投资顾问,请你根据以下信息提供详细的技术分析和投资策略建议:" +
"1. 市场背景:\n" +
"- 当前A股市场整体走势(如:牛市、熊市、震荡市)\n " +
"- 近期影响市场的主要宏观经济因素\n " +
"- 市场情绪指标(如:融资融券余额、成交量变化) " +
"2. 技术指标分析: " +
"- 当前股价水平" +
"- 所在boll区间" +
"- 上证指数的MA(移动平均线)、MACD、KDJ指标分析\n " +
"- 行业板块轮动情况\n " +
"- 近期市场热点和龙头股票的技术形态 " +
"3. 风险评估:\n " +
"- 当前市场主要风险因素\n " +
"- 如何设置止损和止盈位\n " +
"- 资金管理建议(如:仓位控制) " +
"4. 投资策略:\n " +
"- 短期(1-2周)、中期(1-3月)和长期(3-6月)的市场预期\n " +
"- 不同风险偏好投资者的策略建议\n " +
"- 值得关注的行业板块和个股推荐(请给出2-3个具体例子,包括股票代码和名称) " +
"5. 技术面和基本面结合:\n " +
"- 如何将技术分析与公司基本面分析相结合\n " +
"- 识别高质量股票的关键指标 " +
"请提供详细的分析和具体的操作建议,包括入场时机、持仓周期和退出策略。同时,请强调风险控制的重要性,并提醒投资者需要根据自身情况做出决策。 " +
"你的分析和建议应当客观、全面,并基于当前可获得的市场数据。如果某些信息无法确定,请明确指出并解释原因。",
},
{
"role": "user",
"content": "点评一下" + stock,
},
},
}).
Post("/chat/completions")
if err != nil {
return ""
}
//logger.SugaredLogger.Infof("%v", res.Choices[0].Message.Content)
return res.Choices[0].Message.Content
}
func (o OpenAi) NewChatStream(stock, stockCode string) <-chan string {
ch := make(chan string, 512)
go func() {

View File

@ -15,7 +15,7 @@ import {
SettingsOutline,
ReorderTwoOutline,
ExpandOutline,
RefreshOutline, PowerOutline, BarChartOutline, MoveOutline, WalletOutline, StarOutline,
RefreshOutline, PowerOutline, LogoGithub, MoveOutline, WalletOutline, StarOutline,
} from '@vicons/ionicons5'
const content = ref('数据来源于网络,仅供参考;投资有风险,入市需谨慎')
@ -67,6 +67,23 @@ const menuOptions = ref([
key: 'settings',
icon: renderIcon(SettingsOutline),
},
{
label: () =>
h(
RouterLink,
{
to: {
name: 'about',
params: {
id: 'zh-CN'
}
}
},
{ default: () => '关于' }
),
key: 'about',
icon: renderIcon(LogoGithub),
},
{
label: ()=> h("a", {
href: '#',
@ -102,23 +119,6 @@ const menuOptions = ref([
key: 'exit',
icon: renderIcon(PowerOutline),
},
{
label: () =>
h(
RouterLink,
{
to: {
name: 'about',
params: {
id: 'zh-CN'
}
}
},
{ default: () => '关于软件' }
),
key: 'about',
icon: renderIcon(StarOutline),
},
])
function renderIcon(icon) {
return () => h(NIcon, null, { default: () => h(icon) })

View File

@ -4,12 +4,7 @@ import { MdPreview } from 'md-editor-v3';
import 'md-editor-v3/lib/preview.css';
import {onMounted, ref} from 'vue';
import {GetVersionInfo} from "../../wailsjs/go/main/App";
const updateLog = ref(`
feat(frontend): 添加关于软件页面
- App.vue 中添加关于软件的菜单项
- router.js 中添加关于软件的路由- 新增 about.vue 组件包含软件介绍和作者信息
`)
const updateLog = ref('');
const versionInfo = ref('');
const icon = ref('https://raw.githubusercontent.com/ArvinLovegood/go-stock/master/build/appicon.png');
onMounted(() => {
@ -28,24 +23,19 @@ onMounted(() => {
<n-space vertical size="large">
<!-- 软件描述 -->
<n-card size="large">
<n-space vertical>
<n-space vertical >
<h1>关于软件</h1>
<n-image width="100" :src="icon" />
<h1>go-stock <n-tag size="small" round>{{versionInfo}}</n-tag></h1>
<p>自选股行情实时监控基于Wails和NaiveUI构建的AI赋能股票分析工具</p>
<p>
欢迎点赞GitHub<a href="https://github.com/ArvinLovegood/go-stock" target="_blank">go-stock</a>
</p>
<div style="justify-self: center;text-align: left" >
<p>自选股行情实时监控基于Wails和NaiveUI构建的AI赋能股票分析工具</p>
<p>
欢迎点赞GitHub<a href="https://github.com/ArvinLovegood/go-stock" target="_blank">go-stock</a>
</p>
<p v-if="updateLog">更新说明{{updateLog}}</p>
</div>
</n-space>
</n-card>
<!-- 更新说明 -->
<n-card size="large">
<n-flex justify="center">
<h1>更新说明</h1>
<MdPreview style="text-align: left" :modelValue="updateLog" :theme="'dark'"/>
</n-flex>
</n-card>
<!-- 关于作者 -->
<n-card size="large">
<n-space vertical>
@ -53,6 +43,8 @@ onMounted(() => {
<n-avatar width="100" src="https://avatars.githubusercontent.com/u/7401917?v=4" />
<h2><a href="https://github.com/ArvinLovegood" target="_blank">@ArvinLovegood</a></h2>
<p>一个热爱编程的小白欢迎关注我的Github</p>
<p>邮箱<a href="mailto:sparkmemory@163.com">sparkmemory@163.com</a>
</p>
</n-space>
</n-card>
</n-space>

View File

@ -17,8 +17,6 @@ export function GetVersionInfo():Promise<models.VersionInfo>;
export function Greet(arg1:string):Promise<data.StockInfo>;
export function NewChat(arg1:string):Promise<string>;
export function NewChatStream(arg1:string,arg2:string):Promise<void>;
export function SaveAIResponseResult(arg1:string,arg2:string,arg3:string):Promise<void>;

View File

@ -30,10 +30,6 @@ export function Greet(arg1) {
return window['go']['main']['App']['Greet'](arg1);
}
export function NewChat(arg1) {
return window['go']['main']['App']['NewChat'](arg1);
}
export function NewChatStream(arg1, arg2) {
return window['go']['main']['App']['NewChatStream'](arg1, arg2);
}