44
55<script >
66import store from " @/store" ;
7- import { Message } from ' element-ui'
7+ import { Message } from " element-ui" ;
88import { mapGetters } from " vuex" ;
99
10- // const _ = require("lodash");
10+ // const _ = require("lodash");
1111/**
1212 * @description amis配置参数
1313 */
1414// https://baidu.gitee.io/amis/zh-CN/docs/start/getting-started#props
1515// eslint-disable
16- import { alert , confirm , render as renderSchema , toast } from ' amis'
17- import ReactDOM from ' react-dom'
16+ import { alert , confirm , render as renderSchema , toast } from " amis" ;
17+ import ReactDOM from " react-dom" ;
1818
1919// import element from 'element-ui/lib/theme-chalk/index.css'
20- import qs from ' qs '
21- import axios from ' axios'
20+ import qs from " qs " ;
21+ import axios from " axios" ;
2222import copy from " copy-to-clipboard" ;
2323export default {
2424 name: " AmisRender" ,
@@ -52,18 +52,18 @@ export default {
5252 ... mapGetters ([" token" , " departmentToken" ]),
5353 },
5454 mounted () {
55- this .initEnv ()
56- ReactDOM .render (
57- renderSchema (
58- this .schema ,
59- {
60- onAction: this .onAction || this .handleAction ,
61- theme: this .theme
62- },
63- this .env
64- ),
65- this .$refs .renderBox
66- )
55+ this .initEnv ();
56+ ReactDOM .render (
57+ renderSchema (
58+ this .schema ,
59+ {
60+ onAction: this .onAction || this .handleAction ,
61+ theme: this .theme ,
62+ },
63+ this .env
64+ ),
65+ this .$refs .renderBox
66+ );
6767 // ReactDOM.render(
6868 // renderAmis(
6969 // this.schema,
@@ -89,7 +89,7 @@ export default {
8989 // console.log('link',link);
9090 let search = " " ;
9191 const idx = link .indexOf (" ?" );
92- if (idx != - 1 ) {
92+ if (idx != - 1 ) {
9393 pathname = link .substring (0 , idx);
9494 search = link .substring (idx);
9595 }
@@ -125,7 +125,7 @@ export default {
125125 _ .merge (config .headers , {
126126 platform: " amis" ,
127127 departmentToken: this .departmentToken ,
128- sessionToken: this . token ,
128+ sessionToken: localStorage . getItem ( " sessionToken " ) || ' ' ,
129129 author: " xxb" ,
130130 email: " 258650676@qq.com" ,
131131 });
@@ -227,13 +227,13 @@ export default {
227227 const { path } = this .$route ;
228228 // 解决设计界面弹出提示问题
229229 console .log (path .indexOf (" design" ), path);
230- if (! path .indexOf (' design' )) {
231- Message ({
232- type: type,
233- message: msg,
234- duration: 2000 ,
235- showClose: true ,
236- });
230+ if (! path .indexOf (" design" )) {
231+ Message ({
232+ type: type,
233+ message: msg,
234+ duration: 2000 ,
235+ showClose: true ,
236+ });
237237 }
238238 },
239239 confirm,
0 commit comments