diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0ca761a..e537811 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,11 +1,38 @@ name: "publish" on: push: - branches: - - release + tags: + - 'v*' # 推送事件匹配 v*, 例如 v1.0,v20.15.10 等来触发工作流 jobs: + # 任务:创建 release 版本 + create-release: + runs-on: ubuntu-latest + outputs: + RELEASE_UPLOAD_ID: ${{ steps.create_release.outputs.id }} + + steps: + - uses: actions/checkout@v2 + # 查询版本号(tag) + - name: Query version number + id: get_version + shell: bash + run: | + echo "using version tag ${GITHUB_REF:10}" + echo ::set-output name=version::"${GITHUB_REF:10}" + + # 根据查询到的版本号创建 release + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: '${{ steps.get_version.outputs.VERSION }}' + release_name: '唐僧叨叨 ${{ steps.get_version.outputs.VERSION }}' + body: 'See the assets to download this version and install.' publish-tauri: + needs: create-release strategy: fail-fast: false matrix: @@ -29,14 +56,15 @@ jobs: sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf - name: install app dependencies and build it run: yarn && yarn build - - uses: tauri-apps/tauri-action@v0 + - uses: tauri-apps/tauri-action@v0.4 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} # 密钥,需要提前配置在 Github Secrets中 - TAURI_KEY_PASSWORD: ${{ secrets.TAURI_PRIVATE_KEY_PASSWORD }} # 密钥的加密文本,与ssh-keygen时输入的密码一致即可。 需要提前配置在 Github Secrets中 + TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} # 密钥的加密文本,与ssh-keygen时输入的密码一致即可。 需要提前配置在 Github Secrets中 with: - tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version - releaseName: "v__VERSION__" - releaseBody: "See the assets to download this version and install." - releaseDraft: true # 不需要 draft 的可以改成 false - prerelease: false + releaseId: ${{ needs.create-release.outputs.RELEASE_UPLOAD_ID }} + # tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version + # releaseName: "v__VERSION__" + # releaseBody: "See the assets to download this version and install." + # releaseDraft: true # 不需要 draft 的可以改成 false + # prerelease: false diff --git a/Makefile b/Makefile index 8c57185..7c852b7 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ build: - docker build -t tsdaodaoweb . + docker build -t tangsengdaodaoweb . deploy: - docker build -t tsdaodaoweb . - docker tag tsdaodaoweb registry.cn-shanghai.aliyuncs.com/wukongim/tsdaodaoweb:latest - docker push registry.cn-shanghai.aliyuncs.com/wukongim/tsdaodaoweb:latest \ No newline at end of file + docker build -t tangsengdaodaoweb . + docker tag tangsengdaodaoweb registry.cn-shanghai.aliyuncs.com/wukongim/tangsengdaodaoweb:latest + docker push registry.cn-shanghai.aliyuncs.com/wukongim/tangsengdaodaoweb:latest \ No newline at end of file diff --git a/README.md b/README.md index 1be6a5a..6a87ab4 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ + + ## 运行 1. yarn install @@ -37,7 +39,7 @@ yarn tauri build --target universal-apple-darwin (通用架构,生成可在 Ap icon生成 ``` - npx @tauri-apps/tauricon [ICON-PATH] +tauri icon [ICON-PATH] ``` 准备一张1024x1024的icon 执行上面命令 即可生成各种尺寸的icon @@ -65,7 +67,7 @@ tauri signer generate -w ~/.tauri/tsdaodao.key 上面 的命令会自动生成一个公钥、私钥对。公钥可以公开分享,私钥必须严密保存。 -在Github Secrets中 配置 TAURI_PRIVATE_KEY 和 TAURI_PRIVATE_KEY_PASSWORD +在Github Secrets中 配置 TAURI_PRIVATE_KEY 和 TAURI_KEY_PASSWORD (参考:https://www.banyudu.com/posts/tauri-version-release-and-update-guide) diff --git a/apps/web/public/favicon.ico b/apps/web/public/favicon.ico index 85bc7f6..bb262b5 100644 Binary files a/apps/web/public/favicon.ico and b/apps/web/public/favicon.ico differ diff --git a/apps/web/public/icon.ico b/apps/web/public/icon.ico deleted file mode 100644 index 85bc7f6..0000000 Binary files a/apps/web/public/icon.ico and /dev/null differ diff --git a/apps/web/public/logo.png b/apps/web/public/logo.png index a622268..364db23 100644 Binary files a/apps/web/public/logo.png and b/apps/web/public/logo.png differ diff --git a/apps/web/src-tauri/icons/128x128.png b/apps/web/src-tauri/icons/128x128.png index c958e04..a4ef954 100644 Binary files a/apps/web/src-tauri/icons/128x128.png and b/apps/web/src-tauri/icons/128x128.png differ diff --git a/apps/web/src-tauri/icons/128x128@2x.png b/apps/web/src-tauri/icons/128x128@2x.png index 4f8fc64..8bbb7e8 100644 Binary files a/apps/web/src-tauri/icons/128x128@2x.png and b/apps/web/src-tauri/icons/128x128@2x.png differ diff --git a/apps/web/src-tauri/icons/32x32.png b/apps/web/src-tauri/icons/32x32.png index fce8c8f..38d6647 100644 Binary files a/apps/web/src-tauri/icons/32x32.png and b/apps/web/src-tauri/icons/32x32.png differ diff --git a/apps/web/src-tauri/icons/Square107x107Logo.png b/apps/web/src-tauri/icons/Square107x107Logo.png index 1a1a487..155999a 100644 Binary files a/apps/web/src-tauri/icons/Square107x107Logo.png and b/apps/web/src-tauri/icons/Square107x107Logo.png differ diff --git a/apps/web/src-tauri/icons/Square142x142Logo.png b/apps/web/src-tauri/icons/Square142x142Logo.png index fa7efb3..afca897 100644 Binary files a/apps/web/src-tauri/icons/Square142x142Logo.png and b/apps/web/src-tauri/icons/Square142x142Logo.png differ diff --git a/apps/web/src-tauri/icons/Square150x150Logo.png b/apps/web/src-tauri/icons/Square150x150Logo.png index a622268..364db23 100644 Binary files a/apps/web/src-tauri/icons/Square150x150Logo.png and b/apps/web/src-tauri/icons/Square150x150Logo.png differ diff --git a/apps/web/src-tauri/icons/Square284x284Logo.png b/apps/web/src-tauri/icons/Square284x284Logo.png index a10f055..7e9489f 100644 Binary files a/apps/web/src-tauri/icons/Square284x284Logo.png and b/apps/web/src-tauri/icons/Square284x284Logo.png differ diff --git a/apps/web/src-tauri/icons/Square30x30Logo.png b/apps/web/src-tauri/icons/Square30x30Logo.png index 88beec7..e609af7 100644 Binary files a/apps/web/src-tauri/icons/Square30x30Logo.png and b/apps/web/src-tauri/icons/Square30x30Logo.png differ diff --git a/apps/web/src-tauri/icons/Square310x310Logo.png b/apps/web/src-tauri/icons/Square310x310Logo.png index 4de68f9..46d81b7 100644 Binary files a/apps/web/src-tauri/icons/Square310x310Logo.png and b/apps/web/src-tauri/icons/Square310x310Logo.png differ diff --git a/apps/web/src-tauri/icons/Square44x44Logo.png b/apps/web/src-tauri/icons/Square44x44Logo.png index 1770aee..9da44a8 100644 Binary files a/apps/web/src-tauri/icons/Square44x44Logo.png and b/apps/web/src-tauri/icons/Square44x44Logo.png differ diff --git a/apps/web/src-tauri/icons/Square71x71Logo.png b/apps/web/src-tauri/icons/Square71x71Logo.png index 9cdb992..5ed4f17 100644 Binary files a/apps/web/src-tauri/icons/Square71x71Logo.png and b/apps/web/src-tauri/icons/Square71x71Logo.png differ diff --git a/apps/web/src-tauri/icons/Square89x89Logo.png b/apps/web/src-tauri/icons/Square89x89Logo.png index a730c69..558a8ab 100644 Binary files a/apps/web/src-tauri/icons/Square89x89Logo.png and b/apps/web/src-tauri/icons/Square89x89Logo.png differ diff --git a/apps/web/src-tauri/icons/StoreLogo.png b/apps/web/src-tauri/icons/StoreLogo.png index c1a52a8..84a896a 100644 Binary files a/apps/web/src-tauri/icons/StoreLogo.png and b/apps/web/src-tauri/icons/StoreLogo.png differ diff --git a/apps/web/src-tauri/icons/icon.icns b/apps/web/src-tauri/icons/icon.icns index 31e8e89..21815e1 100644 Binary files a/apps/web/src-tauri/icons/icon.icns and b/apps/web/src-tauri/icons/icon.icns differ diff --git a/apps/web/src-tauri/icons/icon.ico b/apps/web/src-tauri/icons/icon.ico index 85bc7f6..bb262b5 100644 Binary files a/apps/web/src-tauri/icons/icon.ico and b/apps/web/src-tauri/icons/icon.ico differ diff --git a/apps/web/src-tauri/icons/icon.png b/apps/web/src-tauri/icons/icon.png index 6231548..bb444a2 100644 Binary files a/apps/web/src-tauri/icons/icon.png and b/apps/web/src-tauri/icons/icon.png differ diff --git a/apps/web/src-tauri/src/main.rs b/apps/web/src-tauri/src/main.rs index 01d2a98..6dfa54a 100644 --- a/apps/web/src-tauri/src/main.rs +++ b/apps/web/src-tauri/src/main.rs @@ -6,7 +6,6 @@ mod menu; - fn main() { let context = tauri::generate_context!(); tauri::Builder::default() diff --git a/apps/web/src-tauri/tauri.conf.json b/apps/web/src-tauri/tauri.conf.json index 5f1880e..b30f51e 100644 --- a/apps/web/src-tauri/tauri.conf.json +++ b/apps/web/src-tauri/tauri.conf.json @@ -7,7 +7,7 @@ "distDir": "../build" }, "package": { - "productName": "唐僧叨叨", + "productName": "tangsegndaodao", "version": "../package.json" }, "tauri": { @@ -68,7 +68,7 @@ "https://api.githubim.com/v1/common/updater/{{target}}/{{current_version}}" ], "dialog": false, - "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEVGMTY1NjkzNzE1ODk0RTQKUldUa2xGaHhrMVlXN3lpSUNSazBqcVNTWFRnUWFrVHZKOHN2SUdKaWgzRXBYRGtvQVlkcWdzN3oK" + "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEQyOTBCMTNGNDczQTEzREIKUldUYkV6cEhQN0dRMGd2MWkzdUNMTmlhRXVWbXluamlDSUlVajFWK0p5YXAwanJDREhyajJNclIK" } } diff --git a/apps/web/src/App/assets/ContactsTab.png b/apps/web/src/App/assets/ContactsTab.png deleted file mode 100644 index 93e9fca..0000000 Binary files a/apps/web/src/App/assets/ContactsTab.png and /dev/null differ diff --git a/apps/web/src/App/assets/ContactsTab.svg b/apps/web/src/App/assets/ContactsTab.svg new file mode 100644 index 0000000..8afb214 --- /dev/null +++ b/apps/web/src/App/assets/ContactsTab.svg @@ -0,0 +1,13 @@ + + + address book_02 + + + + + + + + + + \ No newline at end of file diff --git a/apps/web/src/App/assets/ContactsTabSelected.png b/apps/web/src/App/assets/ContactsTabSelected.png deleted file mode 100644 index fba1f93..0000000 Binary files a/apps/web/src/App/assets/ContactsTabSelected.png and /dev/null differ diff --git a/apps/web/src/App/assets/ContactsTabSelected.svg b/apps/web/src/App/assets/ContactsTabSelected.svg new file mode 100644 index 0000000..e5aa7c4 --- /dev/null +++ b/apps/web/src/App/assets/ContactsTabSelected.svg @@ -0,0 +1,19 @@ + + + address book_01 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/apps/web/src/App/assets/HomeTab.png b/apps/web/src/App/assets/HomeTab.png deleted file mode 100644 index 3a38625..0000000 Binary files a/apps/web/src/App/assets/HomeTab.png and /dev/null differ diff --git a/apps/web/src/App/assets/HomeTab.svg b/apps/web/src/App/assets/HomeTab.svg new file mode 100644 index 0000000..1934f23 --- /dev/null +++ b/apps/web/src/App/assets/HomeTab.svg @@ -0,0 +1,12 @@ + + + home_02 + + + + + + + + + \ No newline at end of file diff --git a/apps/web/src/App/assets/HomeTabSelected.png b/apps/web/src/App/assets/HomeTabSelected.png deleted file mode 100644 index f264227..0000000 Binary files a/apps/web/src/App/assets/HomeTabSelected.png and /dev/null differ diff --git a/apps/web/src/App/assets/HomeTabSelected.svg b/apps/web/src/App/assets/HomeTabSelected.svg new file mode 100644 index 0000000..a9d0575 --- /dev/null +++ b/apps/web/src/App/assets/HomeTabSelected.svg @@ -0,0 +1,19 @@ + + + home_01 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/apps/web/src/App/index.tsx b/apps/web/src/App/index.tsx index 6127339..5780129 100644 --- a/apps/web/src/App/index.tsx +++ b/apps/web/src/App/index.tsx @@ -25,8 +25,8 @@ function registerMenus() { WKApp.menus.register("chat", (context) => { const m = new Menus("chat", "/", "会话", - 会话, - 会话) + 会话, + 会话) let badge = 0 for (const conversation of WKSDK.shared().conversationManager.conversations) { if (!conversation.channelInfo?.mute) { @@ -39,8 +39,8 @@ function registerMenus() { WKApp.menus.register("contacts", (param) => { const m = new Menus("contacts", "/contacts", "通讯录", - 通讯录, - 通讯录) + 通讯录, + 通讯录) m.badge = WKApp.shared.getFriendApplysUnreadCount() return m diff --git a/apps/web/src/Pages/Main/index.tsx b/apps/web/src/Pages/Main/index.tsx index a8a85a5..f18739e 100644 --- a/apps/web/src/Pages/Main/index.tsx +++ b/apps/web/src/Pages/Main/index.tsx @@ -79,53 +79,4 @@ export class MainPage extends Component { } - - // render() { - // return { - // return new MainVM() - // }} render={(vm: MainVM) => { - // return
- //
- //
    - //
  • - // - //
  • - // { - // vm.menusList.map((menus: Menus) => { - // return
  • { - // vm.currentMenus = menus - // if(menus.onPress) { - // menus.onPress() - // }else{ - // WKApp.route.push(menus.routePath) - // } - - // }}> - // { - // menus.id === vm.currentMenus?.id ? menus.selectedIcon : menus.icon - // } - //
  • - // }) - // } - //
  • { - // vm.settingSelected = !vm.settingSelected - // }}> - // - // - // - //
  • - //
- //
    - //
  • 检查版本更新
  • - //
  • 关闭桌面通知
  • - //
  • 退出登录
  • - //
- //
- //
- // {WKApp.shared.content||""} - //
- //
- // }}>
- // } - } \ No newline at end of file diff --git a/apps/web/src/Pages/Main/tab_normal_screen.css b/apps/web/src/Pages/Main/tab_normal_screen.css index 26c90ae..c543afb 100644 --- a/apps/web/src/Pages/Main/tab_normal_screen.css +++ b/apps/web/src/Pages/Main/tab_normal_screen.css @@ -17,7 +17,7 @@ } .wk-main-sider-avatar { - margin-top: 50px; + margin-top: 10px; width: 50px; height: 50px; display: flex; @@ -29,7 +29,7 @@ .wk-main-sider-avatar img{ width: 50px; height: 50px; - border-radius: 50%; + border-radius: 40%; } .wk-main-sider-item { diff --git a/apps/web/src/index.css b/apps/web/src/index.css index 632467e..e69de29 100644 --- a/apps/web/src/index.css +++ b/apps/web/src/index.css @@ -1,22 +0,0 @@ - -.titlebar { - height: 30px; - background: #329ea3; - user-select: none; - display: flex; - justify-content: flex-end; - position: fixed; - top: 0; - left: 0; - right: 0; - } - .titlebar-button { - display: inline-flex; - justify-content: center; - align-items: center; - width: 30px; - height: 30px; - } - .titlebar-button:hover { - background: #5bbec3; - } \ No newline at end of file diff --git a/apps/web/src/index.tsx b/apps/web/src/index.tsx index b8205f0..a3c0a47 100644 --- a/apps/web/src/index.tsx +++ b/apps/web/src/index.tsx @@ -9,7 +9,7 @@ import { DataSourceModule } from '@tsdaodao/datasource'; import {ContactsModule} from '@tsdaodao/contacts'; -WKApp.apiClient.config.apiURL = "https://chatapi.githubim.com/v1/" +WKApp.apiClient.config.apiURL = "https://api.botgate.cn/v1/" // WKApp.apiClient.config.apiURL = "/api/v1/" // 正式环境地址 (通用打包镜像,用此相对地址) WKApp.apiClient.config.tokenCallback = ()=> { return WKApp.loginInfo.token diff --git a/nginx.conf.template b/nginx.conf.template index 6526788..81a9d38 100644 --- a/nginx.conf.template +++ b/nginx.conf.template @@ -8,6 +8,7 @@ gzip_buffers 16 8k; gzip_http_version 1.1; gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; + server { listen 80; server_name localhost; diff --git a/packages/tsdaodaobase/src/App.tsx b/packages/tsdaodaobase/src/App.tsx index f5abefe..06e75e6 100644 --- a/packages/tsdaodaobase/src/App.tsx +++ b/packages/tsdaodaobase/src/App.tsx @@ -27,30 +27,30 @@ export enum ThemeMode { } export class WKConfig { appName: string = "唐僧叨叨" - appVersion:string = "0.0.0" // app版本 + appVersion: string = "0.0.0" // app版本 themeColor: string = "#E46342" // 主题颜色 secondColor: string = "rgba(232, 234, 237)" pageSize: number = 15 // 数据页大小 pageSizeOfMessage: number = 30 // 每次请求消息数量 fileHelperUID: string = "fileHelper" // 文件助手UID systemUID: string = "u_10000" // 系统uid - + private _themeMode: ThemeMode = ThemeMode.light // 主题模式 set themeMode(v: ThemeMode) { this._themeMode = v const body = document.body; - if(v === ThemeMode.dark) { + if (v === ThemeMode.dark) { if (body.hasAttribute('theme-mode')) { body.removeAttribute('theme-mode'); body.setAttribute('theme-mode', 'dark'); } else { body.setAttribute('theme-mode', 'dark'); } - }else { + } else { body.removeAttribute('theme-mode'); } - StorageService.shared.setItem("theme-mode",`${v}`) + StorageService.shared.setItem("theme-mode", `${v}`) WKApp.shared.notifyListener() } @@ -61,13 +61,13 @@ export class WKConfig { } export class WKRemoteConfig { - revokeSecond:number = 2 * 60 // 撤回时间 - requestSuccess:boolean = false + revokeSecond: number = 2 * 60 // 撤回时间 + requestSuccess: boolean = false async startRequestConfig() { await this.requestConfig() - if(!this.requestSuccess) { + if (!this.requestSuccess) { setTimeout(() => { this.startRequestConfig() }, 3000); @@ -75,7 +75,7 @@ export class WKRemoteConfig { } requestConfig() { - return WKApp.apiClient.get("common/appconfig").then((result)=>{ + return WKApp.apiClient.get("common/appconfig").then((result) => { this.requestSuccess = true this.revokeSecond = result["revoke_second"] }) @@ -92,7 +92,7 @@ export class LoginInfo { name: string | undefined role!: string isWork!: boolean - sex!:number + sex!: number /** * save 保存登录信息 @@ -106,7 +106,7 @@ export class LoginInfo { this.setStorageItemForSID("name", this.name ?? ""); this.setStorageItemForSID("role", this.role ?? "") this.setStorageItemForSID("is_work", this.isWork ? "1" : "0") - this.setStorageItemForSID("sex", this.sex==1?"1":"0") + this.setStorageItemForSID("sex", this.sex == 1 ? "1" : "0") } // 获取查询参数 @@ -142,10 +142,10 @@ export class LoginInfo { } public setStorageItem(key: string, value: string) { - StorageService.shared.setItem(key,value) + StorageService.shared.setItem(key, value) } public getStorageItem(key: string): string | null { - return StorageService.shared.getItem(key) + return StorageService.shared.getItem(key) } public removeStorageItem(key: string) { StorageService.shared.removeItem(key) @@ -170,9 +170,9 @@ export class LoginInfo { } const sexStr = this.getStorageItemForSID("sex") - if(sexStr === "1") { + if (sexStr === "1") { this.sex = 1 - }else { + } else { this.sex = 0 } } @@ -206,7 +206,7 @@ export default class WKApp extends ProviderListener { static menus = MenusManager.shared // 菜单 static apiClient = APIClient.shared // api客户端 static config: WKConfig = new WKConfig() // app配置 - static remoteConfig:WKRemoteConfig = new WKRemoteConfig() // 远程配置 + static remoteConfig: WKRemoteConfig = new WKRemoteConfig() // 远程配置 static loginInfo: LoginInfo = new LoginInfo() // 登录信息 static endpoints: EndpointCommon = new EndpointCommon() // 常用端点 static conversationProvider: IConversationProvider // 最近会话相关数据源 @@ -224,17 +224,17 @@ export default class WKApp extends ProviderListener { openChannel?: Channel // 当前打开的会话频道 content?: JSX.Element - baseContext!:WKBaseContext // 唐僧叨叨基础上下文 - + baseContext!: WKBaseContext // 唐僧叨叨基础上下文 - private _notificationIsClose:boolean = false // 通知是否关闭 + + private _notificationIsClose: boolean = false // 通知是否关闭 private wsaddrs = new Array() // ws的连接地址 private addrUsed = false // 地址是否被使用 - set notificationIsClose(v:boolean) { + set notificationIsClose(v: boolean) { this._notificationIsClose = v - StorageService.shared.setItem("NotificationIsClose",v?"1":"") + StorageService.shared.setItem("NotificationIsClose", v ? "1" : "") } get notificationIsClose() { @@ -246,21 +246,21 @@ export default class WKApp extends ProviderListener { startup() { WKApp.loginInfo.load() // 加载登录信息 - const themeMode = StorageService.shared.getItem("theme-mode") - if(themeMode === "1") { - WKApp.config.themeMode = ThemeMode.dark - } + const themeMode = StorageService.shared.getItem("theme-mode") + if (themeMode === "1") { + WKApp.config.themeMode = ThemeMode.dark + } WKSDK.shared().config.provider.connectAddrCallback = async (callback: ConnectAddrCallback) => { - if(!this.wsaddrs || this.wsaddrs.length == 0) { - this.wsaddrs = await WKApp.dataSource.commonDataSource.imConnectAddrs() + if (!this.wsaddrs || this.wsaddrs.length == 0) { + this.wsaddrs = await WKApp.dataSource.commonDataSource.imConnectAddrs() } - if(this.wsaddrs.length>0) { - console.log("connectAddrs--->",this.wsaddrs) + if (this.wsaddrs.length > 0) { + console.log("connectAddrs--->", this.wsaddrs) this.addrUsed = true callback(this.wsaddrs[0]) } - + } WKApp.endpoints.addOnLogin(() => { @@ -273,28 +273,28 @@ export default class WKApp extends ProviderListener { WKSDK.shared().connectManager.addConnectStatusListener((status: ConnectStatus, reasonCode?: number) => { if (status === ConnectStatus.ConnectKick) { - console.log("被踢--->",reasonCode) + console.log("被踢--->", reasonCode) WKApp.shared.logout() - }else if(reasonCode == 2) { // 认证失败! + } else if (reasonCode == 2) { // 认证失败! WKApp.shared.logout() - }else if(status === ConnectStatus.Disconnect) { - if(this.addrUsed && this.wsaddrs.length>1) { + } else if (status === ConnectStatus.Disconnect) { + if (this.addrUsed && this.wsaddrs.length > 1) { const oldwsAddr = this.wsaddrs[0] - this.wsaddrs.splice(0,1) + this.wsaddrs.splice(0, 1) this.wsaddrs.push(oldwsAddr) this.addrUsed = false - console.log("连接失败!切换地址->",this.wsaddrs) + console.log("连接失败!切换地址->", this.wsaddrs) } - + } }) // 通知设置 const notificationIsClose = StorageService.shared.getItem("NotificationIsClose") - if(notificationIsClose === "1") { + if (notificationIsClose === "1") { this._notificationIsClose = true - }else{ + } else { this._notificationIsClose = false } @@ -322,7 +322,7 @@ export default class WKApp extends ProviderListener { this.notifyListener() } - + // 是否登录 isLogined() { @@ -339,23 +339,23 @@ export default class WKApp extends ProviderListener { return "" } let avatarTag = this.getChannelAvatarTag() - if(!avatarTag) { + if (!avatarTag) { avatarTag = "0" } const channelInfo = WKSDK.shared().channelManager.getChannelInfo(channel) - if(channelInfo && channelInfo.logo && channelInfo.logo !== "") { + if (channelInfo && channelInfo.logo && channelInfo.logo !== "") { let logo = channelInfo.logo; - if(logo.indexOf("?")!=-1) { - logo += "&v="+avatarTag - }else { - logo += "?v="+avatarTag + if (logo.indexOf("?") != -1) { + logo += "&v=" + avatarTag + } else { + logo += "?v=" + avatarTag } return WKApp.dataSource.commonDataSource.getImageURL(logo) } const baseURl = WKApp.apiClient.config.apiURL if (channel.channelType === ChannelTypePerson) { return `${baseURl}users/${channel.channelID}/avatar?v=${avatarTag}` - }else if(channel.channelType == ChannelTypeGroup) { + } else if (channel.channelType == ChannelTypeGroup) { return `${baseURl}groups/${channel.channelID}/avatar?v=${avatarTag}` } return "" @@ -368,16 +368,20 @@ export default class WKApp extends ProviderListener { // 我的用户头像发送改变 myUserAvatarChange() { - this.changeChannelAvatarTag() + this.changeChannelAvatarTag() } changeChannelAvatarTag() { let myAvatarTag = "channelAvatarTag" - WKApp.loginInfo.setStorageItem(myAvatarTag,new Date().getTime()+"") + WKApp.loginInfo.setStorageItem(myAvatarTag, new Date().getTime() + "") } getChannelAvatarTag() { let myAvatarTag = "channelAvatarTag" - return WKApp.loginInfo.getStorageItem(myAvatarTag) + const tag = WKApp.loginInfo.getStorageItem(myAvatarTag) + if (!tag) { + return "" + } + return tag } avatarGroup(groupNo: string) { @@ -386,8 +390,8 @@ export default class WKApp extends ProviderListener { } // 注册频道设置 - channelSettingRegister(sectionID: string, sectionFnc: (context: RouteContext) => Section | undefined,sort?:number) { - WKApp.sectionManager.register(EndpointCategory.channelSetting, sectionID, sectionFnc,sort) + channelSettingRegister(sectionID: string, sectionFnc: (context: RouteContext) => Section | undefined, sort?: number) { + WKApp.sectionManager.register(EndpointCategory.channelSetting, sectionID, sectionFnc, sort) } // 获取频道设置 @@ -405,7 +409,7 @@ export default class WKApp extends ProviderListener { return WKApp.sectionManager.sections(EndpointCategory.channelManage, context) } - chatMenusRegister(sid: string, f: (param:any) => ChatMenus, sort?: number) { + chatMenusRegister(sid: string, f: (param: any) => ChatMenus, sort?: number) { WKApp.endpointManager.setMethod(sid, (param) => { return f(param) }, { @@ -428,7 +432,7 @@ export default class WKApp extends ProviderListener { } // 注册用户信息 - userInfoRegister(sectionID: string, sectionFnc: (context: RouteContext) => Section | undefined,sort?:number) { + userInfoRegister(sectionID: string, sectionFnc: (context: RouteContext) => Section | undefined, sort?: number) { WKApp.sectionManager.register(EndpointCategory.userInfo, sectionID, sectionFnc) } diff --git a/packages/tsdaodaobase/src/Components/Subscribers/index.css b/packages/tsdaodaobase/src/Components/Subscribers/index.css index d3f1f7b..ca13b89 100644 --- a/packages/tsdaodaobase/src/Components/Subscribers/index.css +++ b/packages/tsdaodaobase/src/Components/Subscribers/index.css @@ -26,7 +26,7 @@ .wk-subscribers-item img { width: 50px; height: 50px; - border-radius: 50%; + border-radius: 40%; } .wk-subscribers-item-name { diff --git a/packages/tsdaodaobase/src/Components/UserInfo/index.css b/packages/tsdaodaobase/src/Components/UserInfo/index.css index 040e258..c6ba7e8 100644 --- a/packages/tsdaodaobase/src/Components/UserInfo/index.css +++ b/packages/tsdaodaobase/src/Components/UserInfo/index.css @@ -42,7 +42,7 @@ body[theme-mode=dark] .wk-userInfo-footer { .wk-userinfo-user-avatar { margin-left: 20px; - border-radius: 50%; + border-radius: 40%; background-color: var(--wk-color-item); width: 54px; height: 54px; @@ -54,7 +54,7 @@ body[theme-mode=dark] .wk-userInfo-footer { .wk-userinfo-user-avatar img{ width: 50px; height: 50px; - border-radius: 50%; + border-radius: 40%; } .wk-userinfo-user-info-name { diff --git a/packages/tsdaodaobase/src/Messages/Base/index.css b/packages/tsdaodaobase/src/Messages/Base/index.css index b453e69..debab34 100644 --- a/packages/tsdaodaobase/src/Messages/Base/index.css +++ b/packages/tsdaodaobase/src/Messages/Base/index.css @@ -55,7 +55,7 @@ .senderAvatar img { width: 34px; height: 34px; - border-radius: 34px; + border-radius: 40%; } .wk-message-base-box { diff --git a/packages/tsdaodaobase/src/Pages/Chat/index.css b/packages/tsdaodaobase/src/Pages/Chat/index.css index dcfc0b5..6177bb5 100644 --- a/packages/tsdaodaobase/src/Pages/Chat/index.css +++ b/packages/tsdaodaobase/src/Pages/Chat/index.css @@ -180,7 +180,7 @@ body[theme-mode=dark] .wk-chat-conversation-header { .wk-chat-conversation-header-channel-avatar img { width: 40px; height: 40px; - border-radius: 50%; + border-radius: 40%; } .wk-chat-conversation-header-channel-info { diff --git a/packages/tsdaodaobase/src/assets/toolbars/func_face_normal.png b/packages/tsdaodaobase/src/assets/toolbars/func_face_normal.png deleted file mode 100644 index 5d91c17..0000000 Binary files a/packages/tsdaodaobase/src/assets/toolbars/func_face_normal.png and /dev/null differ diff --git a/packages/tsdaodaobase/src/assets/toolbars/func_face_normal.svg b/packages/tsdaodaobase/src/assets/toolbars/func_face_normal.svg new file mode 100644 index 0000000..0d9578e --- /dev/null +++ b/packages/tsdaodaobase/src/assets/toolbars/func_face_normal.svg @@ -0,0 +1,18 @@ + + + pc_expression + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/tsdaodaobase/src/assets/toolbars/func_mention_normal.png b/packages/tsdaodaobase/src/assets/toolbars/func_mention_normal.png deleted file mode 100644 index 4a2512c..0000000 Binary files a/packages/tsdaodaobase/src/assets/toolbars/func_mention_normal.png and /dev/null differ diff --git a/packages/tsdaodaobase/src/assets/toolbars/func_mention_normal.svg b/packages/tsdaodaobase/src/assets/toolbars/func_mention_normal.svg new file mode 100644 index 0000000..f53159a --- /dev/null +++ b/packages/tsdaodaobase/src/assets/toolbars/func_mention_normal.svg @@ -0,0 +1,18 @@ + + + pc_@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/tsdaodaobase/src/assets/toolbars/func_screenshot.png b/packages/tsdaodaobase/src/assets/toolbars/func_screenshot.png deleted file mode 100644 index 7fb7398..0000000 Binary files a/packages/tsdaodaobase/src/assets/toolbars/func_screenshot.png and /dev/null differ diff --git a/packages/tsdaodaobase/src/assets/toolbars/func_screenshot.svg b/packages/tsdaodaobase/src/assets/toolbars/func_screenshot.svg new file mode 100644 index 0000000..7515230 --- /dev/null +++ b/packages/tsdaodaobase/src/assets/toolbars/func_screenshot.svg @@ -0,0 +1,20 @@ + + + pc_screenshot + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/tsdaodaobase/src/module.tsx b/packages/tsdaodaobase/src/module.tsx index 91e56b8..a04d7cc 100644 --- a/packages/tsdaodaobase/src/module.tsx +++ b/packages/tsdaodaobase/src/module.tsx @@ -315,7 +315,7 @@ export default class BaseModule implements IModule { registerChatToolbars() { WKApp.endpoints.registerChatToolbar("chattoolbar.emoji", (ctx) => { - return + return }) WKApp.endpoints.registerChatToolbar("chattoolbar.mention", (ctx) => { @@ -323,14 +323,14 @@ export default class BaseModule implements IModule { if (channel.channelType === ChannelTypePerson) { return undefined } - return { + return { ctx.messageInputContext().insertText("@") }}> }) WKApp.endpoints.registerChatToolbar("chattoolbar.screenshot", (ctx) => { - return { + return { window.open("https://jietu.qq.com") }}> }) diff --git a/packages/tsdaodaodatasource/src/datasource.ts b/packages/tsdaodaodatasource/src/datasource.ts index 69fefa4..52cd451 100644 --- a/packages/tsdaodaodatasource/src/datasource.ts +++ b/packages/tsdaodaodatasource/src/datasource.ts @@ -225,13 +225,20 @@ export class CommonDataSource implements ICommonDataSource { } imConnectAddr(): Promise { return WKApp.apiClient.get(`users/${WKApp.loginInfo.uid}/im`).then((resp) => { - - return resp.resp.ws_addr + let addr = resp.wss_addr + if(!addr || addr==='') { + addr = resp.ws_addr + } + return addr }); } imConnectAddrs(): Promise { return WKApp.apiClient.get(`users/${WKApp.loginInfo.uid}/im`).then((resp) => { - return [resp.ws_addr] + let addr = resp.wss_addr + if(!addr || addr==='') { + addr = resp.ws_addr + } + return [addr] }); }