<div class="main" id="main" v-cloak>
    <div class="breadcrumb-box">
        <el-breadcrumb separator="/">
            <el-breadcrumb-item><i class="el-icon-s-home"></i><a href="javascript:void(0)" onclick="location.href=location.href">系统设置</a></el-breadcrumb-item>
        </el-breadcrumb>
    </div>
    <template>
        <el-tabs v-model="tabIndex" type="card">
            <el-tab-pane label="系统参数设置" name="0">
                <el-form ref="form" label-width="150px" label-position="left">

                    <el-form-item label="网站主域名">
                        <el-input v-model.trim="WebConfig.Domain" maxlength="50" style="width:500px;" v-on:change="NeedRestart=1" v-validate="{data:WebConfig.Domain,dataType:'*',nullMsg:'请填写网站主域名'}"></el-input>
                        <span class="help-block validate-tips-box">如：http://www.domain.net，如采用非80端口，需加上端口号</span>
                    </el-form-item>

                    <el-form-item label="AccessKeyId">
                        <el-input v-model.trim="SystemConfig.AccessKeyId" style="width:500px;" maxlength="18"></el-input>
                        <span class="help-block validate-tips-box">AccessKeyId/AccessKeySecret具有最高权限的通讯令牌，请勿对外泄漏</span>
                    </el-form-item>

                    <el-form-item label="AccessKeySecret">
                        <el-input v-model.trim="SystemConfig.AccessKeySecret" style="width:500px;" maxlength="32"></el-input>
                        <span class="help-block validate-tips-box">设置后请勿对外泄露</span>
                    </el-form-item>
                    <el-form-item label="内网API通讯地址">
                        <el-input v-model.trim="SystemConfig.IntranetAddress" style="width:500px;" maxlength="50" v-on:change="NeedRestart=1"></el-input>
                        <span class="help-block validate-tips-box">如：http://192.168.0.1，留空则默认主域名</span>
                    </el-form-item>

                    <el-form-item label="后台绑定域名">
                        <el-input v-model.trim="SystemConfig.AdminDomain" style="width:500px;" maxlength="50" v-on:change="NeedRestart=1"></el-input>
                        <span class="help-block validate-tips-box">如：http://admin.domain.com，留空则默认：主域名/{{SystemConfig.AdminPath}}</span>
                    </el-form-item>

                    <el-form-item label="会员中心绑定域名">
                        <el-input v-model.trim="SystemConfig.MemberDomain" style="width:500px;" maxlength="50" v-on:change="NeedRestart=1"></el-input>
                        <span class="help-block validate-tips-box">如：http://u.domain.com，留空则默认：主域名/member</span>
                    </el-form-item>

                    <el-form-item label="域名约束方式">
                        <el-select v-model="WebConfig.DomainConstraint" style="width:500px;" v-on:change="NeedRestart=1">
                            <el-option label="1、绑定域名和打开域名完全匹配(推荐)" value="equal"></el-option>
                            <el-option label="2、只匹配域名部分，端口不检测(适用进行端口映射的网站)" value="equal-exclude-port"></el-option>
                            <el-option label="3、绑定域名包含打开域名即可匹配" value="contain"></el-option>
                            <el-option label="4、绑定域名包含打开域名即可匹配，端口部分不检测" value="contain-exclude-port"></el-option>
                            <el-option label="5、打开域名包含绑定域名即可匹配" value="reverse-contain"></el-option>
                            <el-option label="6、打开域名包含绑定域名即可匹配，端口部分不检测" value="reverse-contain-exclude-port"></el-option>
                            <el-option label="7、无约束(只适用于单站点，不支持后台和用户中心绑定域名)" value=""></el-option>
                        </el-select>
                        <span class="help-block validate-tips-box">设置绑定域名和打开域名的匹配方式</span>
                    </el-form-item>

                    <el-form-item label="网站错误拦截">
                        <el-radio-group v-model="SystemConfig.ExceptionHandled">
                            <el-radio :label="true">开启</el-radio>
                            <el-radio :label="false">关闭</el-radio>
                        </el-radio-group>
                        <span class="help-block validate-tips-box">注：在网站调试过程中建议关闭，方便错误的追踪，开启后，错误只保存到日志中，提升安全性！</span>
                    </el-form-item>

                    <el-form-item label="数据表缓存时间">
                        <el-input-number controls-position="right" :min="0" :max="2147483647" v-model="SystemConfig.TableCacheMinutes"></el-input-number>分钟
                        <span class="help-block validate-tips-box">0为不进行缓存，正常上线后可根据实际设置</span>
                    </el-form-item>

                    <el-form-item label="自动任务执行间隔">
                        <el-input-number controls-position="right" :min="0" :max="2147483647" v-model="SystemConfig.AutoTaskInterval"></el-input-number>秒
                        <span class="help-block validate-tips-box">单位为秒，信息的自动上线，自动过期，计划任务等时间间隔，设为0表示所有自动任务不会执行</span>
                    </el-form-item>

                    <el-form-item label="日志自动清理">
                        <el-input-number controls-position="right" :min="0" :max="2147483647" v-model="SystemConfig.LogExpire"></el-input-number>天前的日志
                        <span class="help-block validate-tips-box">0为不自动清理</span>
                    </el-form-item>
                </el-form>
            </el-tab-pane>
            <el-tab-pane label="安全设置" name="1">
                <el-form ref="form" label-width="150px" label-position="left">
                    <el-form-item label="安装界面">
                        <el-radio-group v-model="WebConfig.InstallEnabled">
                            <el-radio label="false">禁止安装</el-radio>
                            <el-radio label="true">允许安装</el-radio>
                        </el-radio-group>
                        <span class="help-block validate-tips-box">如果不需要运行<a href="/Initialization/Install" target="_blank"><span class="label label-default">安装界面</span></a>，请设为禁止安装，否则会导致安全隐患</span>
                    </el-form-item>

                    <el-form-item label="后台目录">
                        <el-input v-model.trim="SystemConfig.AdminPath" style="width:500px;" maxlength="20" v-validate="{data:SystemConfig.AdminPath,dataType:'string',nullMsg:'请填写后台目录!',errorMsg:'后台目录只能由数字和字符串组成!'}" v-on:change="NeedRestart=1"></el-input>
                        <span class="help-block validate-tips-box">不建议用admin这类容易猜解的目录，如果后台绑定了域名，则此设置无效</span>
                    </el-form-item>

                    <el-form-item label="后台登陆认证码">
                        <el-input v-model.trim="SystemConfig.AdminAuthenticationCode" style="width:500px;" maxlength="10"></el-input>
                        <span class="help-block validate-tips-box">留空则表示不填写</span>
                    </el-form-item>

                    <el-form-item label="加密秘钥">
                        <el-input v-model="SystemConfig.SecretKey" readonly style="width:500px;" maxlength="50">
                            <el-button slot="append" onclick="newGuid()">随机生成</el-button>
                        </el-input>
                        <span class="help-block validate-tips-box">第一次使用务必修改，主要用于系统的对称加密秘钥</span>
                    </el-form-item>

                    <el-form-item label="密码复杂程度验证">
                        <el-input v-model="SystemConfig.PasswordRegex" style="width:500px;"></el-input>
                        <span class="help-block validate-tips-box">填写正则表达式，留空则不进行验证</span>
                    </el-form-item>

                    <el-form-item label="后台允许的IP段">
                        <el-input v-model="SystemConfig.AdminIPLimit" type="textarea" style="width:500px;" :autosize="{ minRows:3, maxRows:10}"></el-input>
                        <span class="help-block validate-tips-box">每行一个Ip段,结尾支持通配符，例如"192.168.*"可匹配192.168.0.0～192.168.255.255范围内的Ip</span>
                    </el-form-item>

                    <el-form-item label="允许跨域的域名">
                        <el-input v-model="SystemConfig.CrossDomain" type="textarea" style="width:500px;" :autosize="{ minRows:3, maxRows:10}"></el-input>
                        <span class="help-block validate-tips-box">每行一个域名，例如:http://www.pageadmin.net</span>
                    </el-form-item>

                    <el-form-item label="时间戳有效期">
                        <el-input-number controls-position="right" :min="1" :max="2147483647" v-model="SystemConfig.TimestampInterval"></el-input-number>分钟
                        <span class="help-block validate-tips-box">系统默认的Api请求都需要带有时间戳，超过有效期后请求将失效</span>
                    </el-form-item>
                    <el-form-item label="登录过期时间">
                        <el-input-number controls-position="right" :min="10" :max="2147483647" v-model="SystemConfig.LoginedExpireMinutes"></el-input-number>分钟
                        <span class="help-block validate-tips-box">用户登录后，如果不做任何操作，将会在规定时间内过期并退出</span>
                    </el-form-item>
                    <el-form-item label="登录出错保护">
                        <el-select v-model="SystemConfig.LoginProtect">
                            <el-option label="关闭" value=""></el-option>
                            <el-option label="后台登录" value="admin"></el-option>
                            <el-option label="会员登录" value="member"></el-option>
                            <el-option label="后台登录和会员登录" value="all"></el-option>
                        </el-select>
                        <span class="help-block validate-tips-box"></span>
                    </el-form-item>
                    <el-form-item label="登陆出错数上限" v-show="SystemConfig.LoginProtect!=''">
                        <el-input-number controls-position="right" :min="0" :max="2147483647" v-model="SystemConfig.LoginLockErrorTimes"></el-input-number><span>次</span>
                        <span class="help-block validate-tips-box">出错超过上限后将被锁定，0则不进行限制</span>
                    </el-form-item>
                    <el-form-item label="登陆锁定时间">
                        <el-input-number controls-position="right" :min="0" :max="2147483647" v-model="SystemConfig.LoginLockMinutes"></el-input-number>分钟
                        <span class="help-block validate-tips-box">被锁定后的自动解锁时间，0则不进行锁定</span>
                    </el-form-item>
                    <el-form-item label="同一用户同时登陆">
                        <el-select v-model="SystemConfig.MultipleLogin">
                            <el-option label="不允许（推荐）" :value="false"></el-option>
                            <el-option label="允许" :value="true"></el-option>
                        </el-select>
                        <span class="help-block validate-tips-box">选择不允许，如果多个用户同时登陆，后登陆的用户会把前面登陆的用户退出</span>
                    </el-form-item>

                    <el-form-item label="可编辑文件白名单">
                        <ui-tag v-model="FileConfig.CanReadExt"></ui-tag>
                        <span class="help-block validate-tips-box">填写文件扩展名，可以在文件管理中进行编辑的格式，建议只设置文本类型文件格式</span>
                    </el-form-item>
                    <el-form-item label="可上传文件白名单">
                        <ui-tag v-model="FileConfig.CanUploadExt"></ui-tag>
                        <span class="help-block validate-tips-box">填写文件扩展名，文件上传、新建文件、修改扩展名等操作都会对进行格式检测，涉及系统安全，请谨慎设置</span>
                    </el-form-item>
                </el-form>
            </el-tab-pane>
            <el-tab-pane label="文件上传设置" name="2">
                <!--更新或读取Thumbnail_config-->
                <el-form ref="form" label-width="150px" label-position="left">
                    <!--更新或读取WaterMark.config-->
                    <el-form-item label="水印功能">
                        <el-radio-group v-model="WaterMarkConfig.Open">
                            <el-radio :label="1">开启</el-radio>
                            <el-radio :label="0">关闭</el-radio>
                        </el-radio-group>
                        <span class="help-block validate-tips-box"></span>
                    </el-form-item>

                    <div id="waterMarkConfig">
                        <div v-show="WaterMarkConfig.Open=='1'">
                            <el-form-item label="水印图片路径">
                                <ui-picture-upload action="@Url.ActionUrl("Upload")" v-model="WaterMarkConfig.Image" return-type="string" :limit="1" :max-size="1024" list-type="picture-card"
                                                   :file-list="(WaterMarkConfig.Image==''?[]:[{name: '', url:WaterMarkConfig.Image}])" accept=".jpg,.jpeg,.gif,.png" :data="{isFileAdmin:true,savePath:'/upload/',limitName:'waterMark',fileType:'image',deleteRepeat:true,maxImageWidth:'1024'}">
                                    <i class="el-icon-plus"></i>
                                </ui-picture-upload>
                                <span class="help-block validate-tips-box">建议用透明png文件作为水印图片,注意上传之前把水印图片处理到合适的尺寸</span>
                            </el-form-item>
                            <el-form-item label="水印位置">
                                <el-select v-model="WaterMarkConfig.Position">
                                    <el-option label="左上角" :value="1"></el-option>
                                    <el-option label="顶部中间" :value="2"></el-option>
                                    <el-option label="右上角" :value="3"></el-option>
                                    <el-option label="左侧" :value="4"></el-option>
                                    <el-option label="正中" :value="5"></el-option>
                                    <el-option label="右侧" :value="6"></el-option>
                                    <el-option label="左下角" :value="7"></el-option>
                                    <el-option label="底部中间" :value="8"></el-option>
                                    <el-option label="右下角" :value="9"></el-option>
                                </el-select>
                                <span class="help-block validate-tips-box"></span>
                            </el-form-item>
                            <el-form-item label="水印图质量">
                                <el-select v-model="WaterMarkConfig.Quality">
                                    <el-option label="1" :value="10"></el-option>
                                    <el-option label="2" :value="20"></el-option>
                                    <el-option label="3" :value="30"></el-option>
                                    <el-option label="4" :value="40"></el-option>
                                    <el-option label="5" :value="50"></el-option>
                                    <el-option label="6" :value="60"></el-option>
                                    <el-option label="7" :value="70"></el-option>
                                    <el-option label="8" :value="80"></el-option>
                                    <el-option label="9" :value="90"></el-option>
                                    <el-option label="10" :value="100"></el-option>
                                </el-select>
                                <span class="help-block validate-tips-box">10为最高质量</span>
                            </el-form-item>
                            <el-form-item label="水印透明度">
                                <el-select v-model="WaterMarkConfig.Alpha">
                                    <el-option label="1" :value="1"></el-option>
                                    <el-option label="2" :value="2"></el-option>
                                    <el-option label="3" :value="3"></el-option>
                                    <el-option label="4" :value="4"></el-option>
                                    <el-option label="5" :value="5"></el-option>
                                    <el-option label="6" :value="6"></el-option>
                                    <el-option label="7" :value="7"></el-option>
                                    <el-option label="8" :value="8"></el-option>
                                    <el-option label="9" :value="9"></el-option>
                                    <el-option label="10" :value="10"></el-option>
                                </el-select>
                                <span class="help-block validate-tips-box">10为不透明，越小透明度越高</span>
                            </el-form-item>
                            <el-form-item label="增加水印条件">
                                <span>
                                    图片宽大于<el-input-number controls-position="right" :min="10" :max="1000" v-model="WaterMarkConfig.MinWidth"></el-input-number>PX
                                </span>
                                <span>
                                    图片高大于<el-input-number controls-position="right" :min="10" :max="1000" v-model="WaterMarkConfig.MinHeight"></el-input-number>PX
                                </span>
                                <span class="help-block validate-tips-box"></span>
                            </el-form-item>
                            <el-form-item label="编辑器图片加水印">
                                <el-radio-group v-model="WaterMarkConfig.UsedInEditor">
                                    <el-radio :label="1">是</el-radio>
                                    <el-radio :label="0">否</el-radio>
                                </el-radio-group>
                                <span class="help-block validate-tips-box">如果需要编辑器上传图片自动添加水印，请选择是</span>
                            </el-form-item>
                        </div>
                    </div>

                    <!--更新或读取Editor.config的image节点-->
                    <div id="editorConfig">
                        <el-form-item label="编辑器图片格式">
                            <ui-tag v-model="EditorConfig.ImageExt"></ui-tag>
                            <span class="help-block validate-tips-box">允许上传的图片格式</span>
                        </el-form-item>
                        <el-form-item label="编辑器图片最大限制">
                            <el-input-number controls-position="right" :min="10" :max="21474836479" v-model="EditorConfig.ImageMaxSize"></el-input-number>KB
                            <span class="help-block validate-tips-box">单位:KB，图片上传最大限制</span>
                        </el-form-item>
                        <el-form-item label="编辑器视频格式">
                            <ui-tag v-model="EditorConfig.MediaExt"></ui-tag>
                            <span class="help-block validate-tips-box">允许上传的视频格式</span>
                        </el-form-item>
                        <el-form-item label="编辑器视频最大限制">
                            <el-input-number controls-position="right" :min="10" :max="2147483647" v-model="EditorConfig.MediaMaxSize"></el-input-number>KB
                            <span class="help-block validate-tips-box">单位:KB，视频文件上传最大限制</span>
                        </el-form-item>
                        <el-form-item label="编辑器附件格式">
                            <ui-tag v-model="EditorConfig.FileExt"></ui-tag>
                            <span class="help-block validate-tips-box">允许上传的附件格式</span>
                        </el-form-item>
                        <el-form-item label="编辑器附件最大限制">
                            <el-input-number controls-position="right" :min="10" :max="2147483647" v-model="EditorConfig.FileMaxSize"></el-input-number>KB
                            <span class="help-block validate-tips-box">单位:KB，文件上传最大限制</span>
                        </el-form-item>
                    </div>
                </el-form>
            </el-tab-pane>
            <el-tab-pane label="邮件发送设置" name="3">
                <el-form ref="form" label-width="150px" label-position="left">
                    <el-form-item label="发件邮箱">
                        <el-input v-model="EmailConfig.UserName" style="width:500px;" maxlength="45"></el-input>
                        <span class="help-block validate-tips-box">如：demo@demo.net</span>
                    </el-form-item>
                    <el-form-item label="邮箱SMTP密码">
                        <el-input type="password" v-model="EmailConfig.PassWord" style="width:500px;" maxlength="45"></el-input>
                        <span class="help-block validate-tips-box"></span>
                    </el-form-item>
                    <el-form-item label="发件方名称">
                        <el-input v-model="EmailConfig.DisplayName" style="width:500px;" maxlength="45"></el-input>
                        <span class="help-block validate-tips-box">如:PageAdmin</span>
                    </el-form-item>
                    <el-form-item label="邮箱SMTP服务器">
                        <el-input v-model="EmailConfig.Host" style="width:500px;" maxlength="45"></el-input>
                        <span class="help-block validate-tips-box">如：smtp.exmail.qq.com</span>
                    </el-form-item>

                    <el-form-item label="是否启用SSl">
                        <el-radio-group v-model="EmailConfig.EnableSsl">
                            <el-radio label="false">否</el-radio>
                            <el-radio label="true">是</el-radio>
                        </el-radio-group>
                        <span class="help-block validate-tips-box"></span>
                    </el-form-item>

                    <el-form-item label="邮箱发送端口">
                        <el-input v-model="EmailConfig.Port" style="width:100px;" maxlength="10" onkeyup="if(isNaN(this.value) || value.Trim()=='' || value.Trim()=='0'){this.value='25'}"></el-input>
                        <span class="help-block validate-tips-box">默认：25，如果使用SSL协议，端口一般默认为：465</span>
                    </el-form-item>

                    <el-form-item label="邮件签名">
                        <el-input v-model="EmailConfig.Sign" type="textarea" :rows="3" style="width:90%;"></el-input>
                        <span class="help-block validate-tips-box"></span>
                    </el-form-item>
                    <el-form-item label="验证码邮件模板">
                        邮件标题<br />
                        <el-input v-model="EmailConfig.ValidateCodeEmailTitle" maxlength="45" style="width:90%;"></el-input>
                        <span class="help-block validate-tips-box"></span>
                        邮件内容<br />
                        <el-input v-model="EmailConfig.ValidateCodeEmailContent" type="textarea" :rows="4" style="width:90%;"></el-input>
                        <span class="help-block validate-tips-box">默认所有的邮件验证码邮件都共用此模板，内容中${code}表示验证码</span>
                    </el-form-item>
                    <el-form-item label="">
                        <el-button v-on:click="dialog({title:'邮件测试',url:'@Url.ActionUrl("EmailTest")',width:'600px',height:'400px',target:'self'})">发送测试邮件</el-button>
                        <span class="help-block validate-tips-box"></span>
                    </el-form-item>
                </el-form>
            </el-tab-pane>
            <el-tab-pane label="短信发送设置" name="4">
                <!--更新或读取Sms.config-->
                <el-form ref="form" label-width="150px" label-position="left">
                    <el-form-item label="短信AccessKeyId">
                        <el-input v-model="SmsConfig.AccessKeyId" style="width:500px;" maxlength="50"></el-input>
                        <span class="help-block validate-tips-box">短信服务提供，请勿泄露，PageAdmin的短信接口默认采用阿里云的接口，请自行申请</span>
                    </el-form-item>
                    <el-form-item label="短信AccessKeySecret">
                        <el-input v-model="SmsConfig.AccessKeySecret" style="width:500px;" maxlength="50"></el-input>
                        <span class="help-block validate-tips-box">短信服务提供，请勿泄露</span>
                    </el-form-item>
                    <el-form-item label="短信签名">
                        <el-input v-model="SmsConfig.SignName" style="width:500px;" maxlength="20"></el-input>
                        <span class="help-block validate-tips-box">必须是经过短信接口运营商审核通过的签名</span>
                    </el-form-item>
                    <el-form-item label="验证码模板编号">
                        <el-input v-model="SmsConfig.ValidateCodeTemplate" style="width:500px;" maxlength="50"></el-input>
                        <span class="help-block validate-tips-box">默认所有的验证码功能都使用此模板编号，模板中的${code}表示验证码</span>
                    </el-form-item>
                    <el-form-item label="">
                        <el-button v-on:click="dialog({title:'短信测试',url:'@Url.ActionUrl("SmsTest")',width:'600px',height:'450px',target:'self'})">发送测试验证码</el-button>
                        <span class="help-block validate-tips-box"></span>
                    </el-form-item>
                </el-form>
            </el-tab-pane>
        </el-tabs>
    </template>
    <div class="footer-submit-bar" style="padding-left:170px">
        <el-button type="primary" v-on:click="postSubmit">提交保存</el-button>
    </div>
</div>
<script src="/Templates/PageAdmin/js/jquery.min.js"></script>
<script type="text/javascript">

       var configData = {
           tabIndex: "0",
           SystemConfig: @Html.Raw(ViewBag.SystemConfig),
           WebConfig:@Html.Raw(ViewBag.WebConfig),
           FileConfig:@Html.Raw(ViewBag.FileConfig),
           EditorConfig:@Html.Raw(ViewBag.EditorConfig),
           EmailConfig:@Html.Raw(ViewBag.EmailConfig),
           SmsConfig:@Html.Raw(ViewBag.SmsConfig),
           WaterMarkConfig:@Html.Raw(ViewBag.WaterMarkConfig),
           NeedRestart: 0, //是否提交后重启进程
    };
       if (configData.SystemConfig.CrossDomain != null){
           configData.SystemConfig.CrossDomain = configData.SystemConfig.CrossDomain.replace(/,/g, "\r\n");
       } else{
           configData.SystemConfig.CrossDomain = "";
       }
       if (configData.SystemConfig.AdminIPLimit != null){
           configData.SystemConfig.AdminIPLimit = configData.SystemConfig.AdminIPLimit.replace(/,/g, "\r\n");
       }
       else{
           configData.SystemConfig.AdminIPLimit = "";
       }
       if (configData.SystemConfig.AdminDomain == null) {
           configData.SystemConfig.AdminDomain = "";
       }
      var vue= new Vue({
          el: "#main",
          data: configData,
            methods: {
                postSubmit: function () {
                    var _this= this;
                    var validated = this.validateForm({ tipsStyle: 1 });//表单验证
                    if (configData.WebConfig.Domain.trim() == configData.SystemConfig.AdminDomain.trim()) {
                        this.$message({
                            showClose: true,
                            message: '后台域名不能和主域名一样!',
                            type: 'error'
                        });
                        return false;
                    }
                    if (configData.WebConfig.Domain.trim() == configData.SystemConfig.AdminDomain.trim()) {
                        this.$message({
                            showClose: true,
                            message: '后台域名不能和主域名一样!',
                            type: 'error'
                        });
                        return false;
                    }
                    if (configData.WebConfig.Domain.trim() == configData.SystemConfig.MemberDomain.trim())
                    {
                        this.$message({
                            showClose: true,
                            message: '会员域名不能和主域名一样!',
                            type: 'error'
                        });
                        return false;
                    }
                    if (validated)
                    {
                        this.submit({
                            url: "@Url.ActionUrl()", data: configData, contentType: "application/json",success: function () {
                                if (_this.NeedRestart == 1) {
                                    //this.restartApplication();
                                    _this.NeedRestart = 0;//复原
                                }

                            }
                        });
                    }

                },
                restartApplication: function () {
                var url = "@Url.ActionUrl("RestartApplication","default")";
                var vue = this;
                vue.ajax({
                    type: "post", async: true, url: url,showSuccessMsg:false, success: function () {
                        //vue.$message.success("网站已重启成功！");
                    }
                });
            },
            },
    });

    function newGuid() {
        var guid = "";
        for (var i = 1; i <= 8; i++) {
            var n = Math.floor(Math.random() * 16.0).toString(16);
            guid += n;
        }
        vue.SystemConfig.SecretKey = guid;
    }
</script>