From 73a5e692e3401695dea8d602cca3cadbc2934db9 Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期四, 05 九月 2024 15:38:08 +0800 Subject: [PATCH] 集成 amis编辑 --- src/api/login/UserMenuData.ts | 2 src/components/amis/AMISRenderer.vue | 60 +++++++++++++++--------------- src/utils/request.ts | 3 + 3 files changed, 33 insertions(+), 32 deletions(-) diff --git a/src/api/login/UserMenuData.ts b/src/api/login/UserMenuData.ts index 7448310..624da25 100644 --- a/src/api/login/UserMenuData.ts +++ b/src/api/login/UserMenuData.ts @@ -24,7 +24,7 @@ Permission: '', Icon: 'ywifont ywicon-a-appround15', IsIframe: true, - OutLink: '/amis-editor/index.html', + OutLink: '/amis-editor/index.html?session={token}', IsHide: false, Weight: 0, SortCode: 2, diff --git a/src/components/amis/AMISRenderer.vue b/src/components/amis/AMISRenderer.vue index 6415c2a..edc1dd5 100644 --- a/src/components/amis/AMISRenderer.vue +++ b/src/components/amis/AMISRenderer.vue @@ -151,36 +151,36 @@ // 鍏ㄥ眬 api 閫傞厤鍣ㄣ�� // 鍙﹀鍦� amis 閰嶇疆椤逛腑鐨� api 涔熷彲浠ラ厤缃�傞厤鍣紝閽堝鏌愪釜鐗瑰畾鎺ュ彛鍗曠嫭澶勭悊銆� responseAdaptor(api, payload, query, request, response) { -// { -// "json_ok": true, -// "sections": [ -// { -// "section_id": "knowledge_base", -// "section_name": "姘村姟鐭ヨ瘑搴�", -// "section_title": "鎷ユ湁姘村姟琛屼笟鐩稿叧鐨勯�氱敤鐭ヨ瘑锛屽寘鎷細娉曞緥娉曡銆佽璁¤鑼冦�佺粰鎺掓按鐩稿叧鐭ヨ瘑绛夌瓑" -// }, -// { -// "section_id": "office_assistant", -// "section_name": "鍔炲叕鍔╂墜", -// "section_title": "鍔炲叕鍔╂墜鑳藉杈呭姪鍐欎細璁�氱煡銆佽鍋囨潯銆佸伐浣滄�荤粨銆丳PT绛夊伐浣溿��" -// }, -// { -// "section_id": "customer_service", -// "section_name": "瀹㈡埛鏈嶅姟", -// "section_title": "閽堝姘村姟浼佷笟瀵瑰瀹㈡埛鏈嶅姟鐩稿叧鐨勫唴瀹癸紝鍖呮嫭锛氭妱琛ㄣ�佸紑璐︺�佹敹璐癸紝浠ュ強鐑嚎鐩稿叧" -// }, -// { -// "section_id": "network_operation", -// "section_name": "绠$綉杩愯", -// "section_title": "閽堝姘村姟浼佷笟绠$綉杩愯涓庣淮鎶ょ鐞嗐�佹按璐ㄧ鐞嗙瓑鐩稿叧" -// }, -// { -// "section_id": "waterworks_operation", -// "section_name": "姘村巶杩愯", -// "section_title": "閽堝姘村姟浼佷笟姘村巶杩愭棩甯歌繍钀ョ鐞嗘湇鍔★紝鍖呮嫭锛氭按鍘傚伐鑹烘祦绋嬨�佹按娉佃繍琛岃皟搴�" -// } -// ] -// } + // { + // "json_ok": true, + // "sections": [ + // { + // "section_id": "knowledge_base", + // "section_name": "姘村姟鐭ヨ瘑搴�", + // "section_title": "鎷ユ湁姘村姟琛屼笟鐩稿叧鐨勯�氱敤鐭ヨ瘑锛屽寘鎷細娉曞緥娉曡銆佽璁¤鑼冦�佺粰鎺掓按鐩稿叧鐭ヨ瘑绛夌瓑" + // }, + // { + // "section_id": "office_assistant", + // "section_name": "鍔炲叕鍔╂墜", + // "section_title": "鍔炲叕鍔╂墜鑳藉杈呭姪鍐欎細璁�氱煡銆佽鍋囨潯銆佸伐浣滄�荤粨銆丳PT绛夊伐浣溿��" + // }, + // { + // "section_id": "customer_service", + // "section_name": "瀹㈡埛鏈嶅姟", + // "section_title": "閽堝姘村姟浼佷笟瀵瑰瀹㈡埛鏈嶅姟鐩稿叧鐨勫唴瀹癸紝鍖呮嫭锛氭妱琛ㄣ�佸紑璐︺�佹敹璐癸紝浠ュ強鐑嚎鐩稿叧" + // }, + // { + // "section_id": "network_operation", + // "section_name": "绠$綉杩愯", + // "section_title": "閽堝姘村姟浼佷笟绠$綉杩愯涓庣淮鎶ょ鐞嗐�佹按璐ㄧ鐞嗙瓑鐩稿叧" + // }, + // { + // "section_id": "waterworks_operation", + // "section_name": "姘村巶杩愯", + // "section_title": "閽堝姘村姟浼佷笟姘村巶杩愭棩甯歌繍钀ョ鐞嗘湇鍔★紝鍖呮嫭锛氭按鍘傚伐鑹烘祦绋嬨�佹按娉佃繍琛岃皟搴�" + // } + // ] + // } return payload; }, // 瑕嗙洊 amis env diff --git a/src/utils/request.ts b/src/utils/request.ts index 11258fd..8077272 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -37,11 +37,12 @@ clearAccessTokens(); window.location.reload(); }); +window.handleNoAuth = handleNoAuth; let requestNum = 0; let loadingInstance: ReturnType<typeof ElLoadingService>; const addLoading = () => { - // 澧炲姞loading 濡傛灉pending璇锋眰鏁伴噺绛変簬1锛屽脊鍑簂oading, 闃叉閲嶅寮瑰嚭 + // 澧炲姞loading 濡傛灉pending璇锋眰鏁伴噺绛変簬1锛屽脊鍑簂oading, 闃叉閲嶅寮瑰嚭F requestNum++; if (requestNum == 1) { loadingInstance = ElLoadingService({ -- Gitblit v1.9.3