panhui 2 лет назад
Родитель
Сommit
5fcc748773

+ 28 - 1
public/favicon.svg

@@ -1 +1,28 @@
-<svg id="openai-symbol" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M29.71,13.09A8.09,8.09,0,0,0,20.34,2.68a8.08,8.08,0,0,0-13.7,2.9A8.08,8.08,0,0,0,2.3,18.9,8,8,0,0,0,3,25.45a8.08,8.08,0,0,0,8.69,3.87,8,8,0,0,0,6,2.68,8.09,8.09,0,0,0,7.7-5.61,8,8,0,0,0,5.33-3.86A8.09,8.09,0,0,0,29.71,13.09Zm-12,16.82a6,6,0,0,1-3.84-1.39l.19-.11,6.37-3.68a1,1,0,0,0,.53-.91v-9l2.69,1.56a.08.08,0,0,1,.05.07v7.44A6,6,0,0,1,17.68,29.91ZM4.8,24.41a6,6,0,0,1-.71-4l.19.11,6.37,3.68a1,1,0,0,0,1,0l7.79-4.49V22.8a.09.09,0,0,1,0,.08L13,26.6A6,6,0,0,1,4.8,24.41ZM3.12,10.53A6,6,0,0,1,6.28,7.9v7.57a1,1,0,0,0,.51.9l7.75,4.47L11.85,22.4a.14.14,0,0,1-.09,0L5.32,18.68a6,6,0,0,1-2.2-8.18Zm22.13,5.14-7.78-4.52L20.16,9.6a.08.08,0,0,1,.09,0l6.44,3.72a6,6,0,0,1-.9,10.81V16.56A1.06,1.06,0,0,0,25.25,15.67Zm2.68-4-.19-.12-6.36-3.7a1,1,0,0,0-1.05,0l-7.78,4.49V9.2a.09.09,0,0,1,0-.09L19,5.4a6,6,0,0,1,8.91,6.21ZM11.08,17.15,8.38,15.6a.14.14,0,0,1-.05-.08V8.1a6,6,0,0,1,9.84-4.61L18,3.6,11.61,7.28a1,1,0,0,0-.53.91ZM12.54,14,16,12l3.47,2v4L16,20l-3.47-2Z"/></svg>
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="36px" height="36px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <title>logo</title>
+    <defs>
+        <circle id="path-1" cx="18" cy="18" r="18"></circle>
+    </defs>
+    <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="聊天-白色" transform="translate(-16.000000, -239.000000)">
+            <g id="编组-2" transform="translate(16.000000, 235.000000)">
+                <g id="logo" transform="translate(0.000000, 4.000000)">
+                    <mask id="mask-2" fill="white">
+                        <use xlink:href="#path-1"></use>
+                    </mask>
+                    <g id="蒙版"></g>
+                    <g id="编组-83" mask="url(#mask-2)" fill="#000000">
+                        <g transform="translate(2.000000, 2.000000)">
+                            <path d="M16.0269989,0 C7.17553184,0 0,7.17553184 0,16.0269989 C0,24.878466 7.17553184,32.0539979 16.0269989,32.0539979 C21.7239013,32.0539979 26.9682511,29.0461624 29.8535497,24.1366974 L30,23.8369389 L27.8849642,22.6749458 L27.7554327,22.9004095 C25.3058187,27.068405 20.8597381,29.6186699 16.0269989,29.6186699 C8.52052632,29.6186699 2.43532794,23.5334715 2.43532794,16.0269989 C2.43532794,8.52052632 8.52052632,2.43532794 16.0269989,2.43532794 C20.7480789,2.43532794 25.1054468,4.86803381 27.5910732,8.88127633 L27.7432656,9.12700318 L29.8535497,7.90342159 L29.6614617,7.59896848 C26.7321422,2.8693479 21.5920983,0 16.0269989,0 Z" id="路径" fill-rule="nonzero"></path>
+                            <path d="M15.9246446,5.41473156 C9.95980796,5.41473156 5.12435245,10.2501871 5.12435245,16.2150237 C5.12435245,22.1798604 9.95980796,27.0153159 15.9246446,27.0153159 C19.7633733,27.0153159 23.2977243,24.9882869 25.2418121,21.6803345 L25.4144255,21.3218352 L23.2117996,20.0740115 L23.0301163,20.3805182 C21.5465234,22.9049181 18.8530642,24.4499464 15.9246446,24.4499464 C11.3766224,24.4499464 7.68972191,20.763046 7.68972191,16.2150237 C7.68972191,11.6670015 11.3766224,7.98010102 15.9246446,7.98010102 C18.7854402,7.98010102 21.4250881,9.45387486 22.9314234,11.8859736 L23.2117996,12.3294758 L25.4144255,11.0691176 L25.1123664,10.5351931 C23.1386437,7.34845992 19.6745298,5.41473156 15.9246446,5.41473156 Z" id="路径" fill-rule="nonzero"></path>
+                            <polygon id="矩形备份-141" fill-rule="evenodd" transform="translate(26.026202, 22.948492) rotate(28.000000) translate(-26.026202, -22.948492) " points="22.3078272 21.737421 29.7445764 21.8601052 29.7445764 24.1595631 22.3078272 24.0368789"></polygon>
+                            <path d="M16.2275317,10.0955221 C12.8478243,10.0955221 10.1080301,12.8353163 10.1080301,16.2150237 C10.1080301,19.5947312 12.8478243,22.3345254 16.2275317,22.3345254 C18.4022056,22.3345254 20.4051289,21.1858727 21.5063453,19.3121037 L21.6527956,19.0629119 L19.4824568,17.6813239 L19.2946495,18.0122874 C18.6539274,19.1025048 17.4918954,19.7691559 16.2275317,19.7691559 C14.2646387,19.7691559 12.6733995,18.1779167 12.6733995,16.2150237 C12.6733995,14.2521307 14.2646387,12.6608916 16.2275317,12.6608916 C17.4627469,12.6608916 18.6014713,13.2967525 19.2520562,14.3471738 L19.4042486,14.5929006 L21.5665889,13.3212613 L21.4329993,12.9963933 C20.3150275,11.1913385 18.3518376,10.0955221 16.2275317,10.0955221 Z" id="路径" fill-rule="nonzero"></path>
+                            <polygon id="矩形" fill-rule="evenodd" transform="translate(21.719690, 11.901893) rotate(-31.000000) translate(-21.719690, -11.901893) " points="18.3603762 10.717514 25.0790036 10.7868141 25.0790036 13.086272 18.3603762 13.0169719"></polygon>
+                        </g>
+                    </g>
+                </g>
+            </g>
+        </g>
+    </g>
+</svg>

BIN
src/assets/logo.png


BIN
src/assets/logo1.png


+ 1 - 1
src/components/common/ShareModal.vue

@@ -39,7 +39,7 @@ const baseURL = import.meta.env.VITE_HTTP_BASE_URL
 
 const userStore = useUserStore()
 const shareUrl = computed(() => {
-    return resolveUrl(baseURL, '#/login?invitor=' + userStore.userInfo.id)
+    return resolveUrl('https://chillgpt.raexmeta.com/', '#/home?invitor=' + userStore.userInfo.id)
 })
 const userInfo = computed(() => {
     return userStore.userInfo

+ 1 - 1
src/hooks/useTheme.ts

@@ -46,5 +46,5 @@ export function useTheme() {
         { immediate: true }
     )
 
-    return { theme, themeOverrides }
+    return { theme, themeOverrides, isDark }
 }

+ 17 - 7
src/main.ts

@@ -5,7 +5,7 @@ import { setupAssets, setupScrollbarStyle } from './plugins'
 import { setupStore, useAuthStore } from './store'
 import { setupRouter } from './router'
 import queryString from 'query-string'
-import { fetchOpenid, fetchJsapiSign, fetchPay } from '@/api'
+import { fetchOpenid, fetchJsapiSign, fetchPay, fetchRedirectUrl } from '@/api'
 
 const query = queryString.parse(location.href.split('?')[1])
 
@@ -13,6 +13,7 @@ console.log(query)
 if (query.invitor) {
     window.sessionStorage.setItem('invitor', String(query.invitor))
 }
+const isWechat = navigator.userAgent.indexOf('MicroMessenger') !== -1
 if (query.code) {
     let openid: any = ''
     fetchOpenid(query.code as string)
@@ -28,15 +29,24 @@ if (query.code) {
             })
             wx.ready(function () {
                 // fetchPay(openid).then((params: any) => {
-                    // wx.chooseWXPay({
-                    //     ...params,
-                    //     success: function (res: any) {
-                    //         console.log(res)
-                    //     }
-                    // })
+                // wx.chooseWXPay({
+                //     ...params,
+                //     success: function (res: any) {
+                //         console.log(res)
+                //     }
+                // })
                 // })
             })
         })
+} else if (isWechat) {
+    fetchRedirectUrl().then(res => {
+        const str = String(res).replace(
+            /redirect_uri=undefined/g,
+            'redirect_uri=' + encodeURIComponent('https://chillgpt.raexmeta.com/#/home')
+        )
+
+        window.location.href = str
+    })
 }
 
 if (query.state === '#/vip') {

+ 11 - 9
src/views/chat/components/Message/Avatar.vue

@@ -1,7 +1,7 @@
 <script lang="ts" setup>
 import { computed } from 'vue'
-import { NAvatar } from 'naive-ui'
-import { useUserStore } from '@/store'
+import { NAvatar, useOsTheme } from 'naive-ui'
+import { useUserStore, useAppStore } from '@/store'
 import { isString } from '@/utils/is'
 import defaultAvatar from '@/assets/avatar.png'
 
@@ -11,8 +11,14 @@ interface Props {
 defineProps<Props>()
 
 const userStore = useUserStore()
-
 const avatar = computed(() => userStore.userInfo.avatar)
+
+const OsTheme = useOsTheme()
+const appStore = useAppStore()
+const isDark = computed(() => {
+    if (appStore.theme === 'auto') return OsTheme.value === 'dark'
+    else return appStore.theme === 'dark'
+})
 </script>
 
 <template>
@@ -21,11 +27,7 @@ const avatar = computed(() => userStore.userInfo.avatar)
         <NAvatar v-else round :src="defaultAvatar" />
     </template>
     <span v-else class="text-[28px] dark:text-white">
-        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" aria-hidden="true" width="1em" height="1em">
-            <path
-                d="M29.71,13.09A8.09,8.09,0,0,0,20.34,2.68a8.08,8.08,0,0,0-13.7,2.9A8.08,8.08,0,0,0,2.3,18.9,8,8,0,0,0,3,25.45a8.08,8.08,0,0,0,8.69,3.87,8,8,0,0,0,6,2.68,8.09,8.09,0,0,0,7.7-5.61,8,8,0,0,0,5.33-3.86A8.09,8.09,0,0,0,29.71,13.09Zm-12,16.82a6,6,0,0,1-3.84-1.39l.19-.11,6.37-3.68a1,1,0,0,0,.53-.91v-9l2.69,1.56a.08.08,0,0,1,.05.07v7.44A6,6,0,0,1,17.68,29.91ZM4.8,24.41a6,6,0,0,1-.71-4l.19.11,6.37,3.68a1,1,0,0,0,1,0l7.79-4.49V22.8a.09.09,0,0,1,0,.08L13,26.6A6,6,0,0,1,4.8,24.41ZM3.12,10.53A6,6,0,0,1,6.28,7.9v7.57a1,1,0,0,0,.51.9l7.75,4.47L11.85,22.4a.14.14,0,0,1-.09,0L5.32,18.68a6,6,0,0,1-2.2-8.18Zm22.13,5.14-7.78-4.52L20.16,9.6a.08.08,0,0,1,.09,0l6.44,3.72a6,6,0,0,1-.9,10.81V16.56A1.06,1.06,0,0,0,25.25,15.67Zm2.68-4-.19-.12-6.36-3.7a1,1,0,0,0-1.05,0l-7.78,4.49V9.2a.09.09,0,0,1,0-.09L19,5.4a6,6,0,0,1,8.91,6.21ZM11.08,17.15,8.38,15.6a.14.14,0,0,1-.05-.08V8.1a6,6,0,0,1,9.84-4.61L18,3.6,11.61,7.28a1,1,0,0,0-.53.91ZM12.54,14,16,12l3.47,2v4L16,20l-3.47-2Z"
-                fill="currentColor"
-            />
-        </svg>
+        <img src="@/assets/logo.png" v-if="isDark" alt="" />
+        <img src="@/assets/logo1.png" v-else alt="" />
     </span>
 </template>