Skip to content

Commit

Permalink
feat: client name
Browse files Browse the repository at this point in the history
  • Loading branch information
jevantang committed Oct 18, 2023
1 parent f0ed98f commit 0dd6202
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions pages/portal/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright 2021-Present 唐杰
* Licensed under the Apache-2.0 license
*/
import appConfig from '../../fresns';
import { fresnsApi } from '../../api/api';
import { fresnsConfig, fresnsLang } from '../../api/tool/function';
import { globalInfo } from '../../utils/fresnsGlobalInfo';
Expand All @@ -20,6 +21,7 @@ Page({

fresnsVersion: '2.x',
clientVersion: '1.x',
clientName: '',
appInfo: {},
},

Expand All @@ -32,11 +34,18 @@ Page({
const fresnsStatus = await fresnsApi.global.globalStatus();
const appInfo = wx.getStorageSync('appInfo');

const clientNameMap = {
5: 'iOS',
6: 'Android',
};
const clientName = clientNameMap[appConfig?.platformId] || '';

this.setData({
logo: await fresnsConfig('site_logo'),
intro: await fresnsConfig('site_intro'),
fresnsVersion: fresnsStatus.version,
clientVersion: globalInfo.clientVersion,
clientName: clientName,
appInfo: appInfo,
});
},
Expand Down
2 changes: 1 addition & 1 deletion pages/portal/about.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
</view>

<view class="client-version">
<text>客户端版本 v{{ clientVersion }}</text>
<text>客户端版本 {{ clientName }} v{{ clientVersion }}</text>
</view>

<!-- 隐私授权 -->
Expand Down

0 comments on commit 0dd6202

Please sign in to comment.