no message

This commit is contained in:
kuaifan 2025-05-21 11:40:38 +08:00
parent fef39b2720
commit bd8b6d0319
6 changed files with 26 additions and 17 deletions

View File

@ -15,6 +15,10 @@ class Apps
*/
public static function isInstalled(string $appId): bool
{
if ($appId === 'appstore') {
return true;
}
$key = 'app_installed_' . $appId;
if (RequestContext::has($key)) {
return RequestContext::get($key);

View File

@ -107,6 +107,7 @@ services:
- ./:/var/www
environment:
HOST_PWD: "${PWD}"
RUN_MODE: "strict"
networks:
- extnetwork
restart: unless-stopped

View File

@ -395,7 +395,7 @@ export default {
'windowOrientation',
'formOptions',
'routeLoading',
'microAppsInstalled'
'microAppsNames'
]),
...mapGetters([
'filterMicroAppsMenus',
@ -403,10 +403,10 @@ export default {
]),
applyList() {
const list = [
{value: "approve", label: "审批中心", sort: 30, show: this.microAppsInstalled.includes('approve')},
{value: "approve", label: "审批中心", sort: 30, show: this.microAppsNames.includes('approve')},
{value: "report", label: "工作报告", sort: 50},
{value: "mybot", label: "我的机器人", sort: 55},
{value: "robot", label: "AI 机器人", sort: 60, show: this.microAppsInstalled.includes('ai')},
{value: "robot", label: "AI 机器人", sort: 60, show: this.microAppsNames.includes('ai')},
{value: "signin", label: "签到打卡", sort: 70},
{value: "meeting", label: "在线会议", sort: 80},
{value: "createGroup", label: "创建群组", sort: 85},

View File

@ -2,6 +2,7 @@ import * as openpgp from 'openpgp_hi/lightweight';
import {initLanguage, languageList, languageName} from "../language";
import {$callData, $urlSafe, SSEClient} from '../utils'
import emitter from "./events";
import axios from "axios";
const dialogDraftState = { timer: {}, subTemp: null }
@ -1116,8 +1117,8 @@ export default {
'callAt',
'cacheEmojis',
'cacheDialogs',
'microAppsInstalled',
'microAppsMenus',
'microAppsNames',
],
json: [
'userInfo'
@ -4672,7 +4673,7 @@ export default {
if (!config.name) {
return
}
if (!state.microAppsInstalled.includes(config.name)) {
if (!state.microAppsNames.includes(config.name)) {
$A.modalWarning(`应用「${config.name}」未安装`);
return;
}
@ -4694,7 +4695,7 @@ export default {
resolve(false)
return
}
resolve(!!state.microAppsInstalled.includes(appName))
resolve(!!state.microAppsNames.includes(appName))
})
},
@ -4703,12 +4704,15 @@ export default {
* @param commit
* @param dispatch
*/
updateMicroAppsStatus({commit, dispatch}) {
dispatch("call", {
url: 'apps/status',
}).then(({data}) => {
commit("microApps/installed", data.installed)
commit("microApps/menu", data.menus)
async updateMicroAppsStatus({commit, state}) {
const {data: {code, data}} = await axios.get($A.mainUrl('appstore/api/v1/internal/installed'), {
headers: {
Token: state.userToken
}
})
if (code === 200) {
commit("microApps/menus", data.menus || [])
commit("microApps/names", data.names || [])
}
},
}

View File

@ -300,13 +300,13 @@ export default {
},
// 微应用管理
'microApps/menu': function(state, data) {
'microApps/menus': function(state, data) {
state.microAppsMenus = data
$A.IDBSave("microAppsMenus", state.microAppsMenus)
},
'microApps/installed': function(state, data) {
state.microAppsInstalled = data
$A.IDBSave("microAppsInstalled", state.microAppsInstalled)
'microApps/names': function(state, data) {
state.microAppsNames = [...data, 'appstore']
$A.IDBSave("microAppsNames", state.microAppsNames)
},
}

View File

@ -262,6 +262,6 @@ export default {
longpressData: {type: '', data: null, element: null},
// 微应用数据
microAppsInstalled: [],
microAppsMenus: [],
microAppsNames: ['appstore'],
};