File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
apps/miniprogram-agent-ui/miniprogram/components/agent-ui Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 11export const checkConfig = ( chatMode , agentConfig , modelConfig ) => {
22 const { botId } = agentConfig || { }
33 const { modelProvider, quickResponseModel, deepReasoningModel } = modelConfig || { }
4+ // 检测不在微信环境,提示用户
5+ try {
6+ const systemInfo = wx . getSystemInfoSync ( )
7+ console . log ( 'systemInfo' , systemInfo )
8+ if ( systemInfo . environment === 'wxwork' ) {
9+ return [ false , '请前往微信客户端扫码打开小程序' ]
10+ }
11+ } catch ( e ) {
12+ console . log ( 'getSystemInfoSync 接口废弃' )
13+ // 使用 getAppBaseInfo 兜底
14+ const appBaseInfo = wx . getAppBaseInfo ( ) ;
15+ console . log ( 'appBaseInfo' , appBaseInfo )
16+ if ( appBaseInfo . host . env === 'SDK' ) {
17+ return [ false , '请前往微信客户端扫码打开小程序' ]
18+ }
19+ }
20+
421 // 检测AI能力,不存在提示用户
522 if ( ! wx . cloud . extend || ! wx . cloud . extend . AI ) {
623 return [ false , '使用AI能力需基础库为3.7.7及以上,请升级基础库版本或微信客户端' ]
You can’t perform that action at this time.
0 commit comments