upgrad.blade.php 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. @extends('layouts.base')
  2. @section('title', trans('系统升级'))
  3. @section('css')
  4. <style>
  5. .main-panel {
  6. background: #f0f2f4;
  7. }
  8. .main-panel > .content {
  9. padding: 0px 10px;
  10. }
  11. .bg-purple {
  12. background: #fff;
  13. margin: 10px 0;
  14. padding: 10px;
  15. }
  16. .bg-purple-light {
  17. background: #fff;
  18. margin: 10px 0;
  19. padding: 10px;
  20. }
  21. .top-title {
  22. display: flex;
  23. align-items: center;
  24. }
  25. .systen-new {
  26. line-height: 25px;
  27. margin-left: 13px;
  28. }
  29. .line {
  30. display: block;
  31. width: 2px;
  32. height: 18px;
  33. background: #29ba9c;
  34. margin-right: 10px;
  35. }
  36. .version-card {
  37. margin: 20px 40px;
  38. line-height: 33px;
  39. }
  40. .version-card .new-version {
  41. font-size: 15px;
  42. color: #65b687;
  43. font-weight: 600;
  44. }
  45. .version-card .el-button--primary {
  46. color: #FFF;
  47. background-color: #65b687;
  48. border-color: #29BA9C;
  49. margin-top: 20px;
  50. }
  51. .version-card .el-button--primary:focus {
  52. color: #FFF;
  53. background-color: #57c988;
  54. border-color: #57c988;
  55. }
  56. .version-card .el-button--primary:hover {
  57. color: #FFF;
  58. background-color: #57c988;
  59. border-color: #57c988;
  60. }
  61. .update-tip {
  62. margin: 0 13px;
  63. }
  64. .update-tip .el-checkbox{
  65. white-space: normal !important;
  66. display: flex !important;
  67. font-weight: bold;
  68. }
  69. .update-file {
  70. margin: 0 13px;
  71. line-height: 30px;
  72. }
  73. .title-tip {
  74. font-size: 16px;
  75. color: #e65652;
  76. font-weight: 500;
  77. margin-top: 20px;
  78. }
  79. .check-box {
  80. display: flex;
  81. flex-direction: column;
  82. height: 637px;
  83. overflow-y: auto;
  84. }
  85. .active-color {
  86. color: #e15652;
  87. font-weight: 400;
  88. }
  89. .origin-state {
  90. margin-left: 20px;
  91. }
  92. .service-time {
  93. margin-bottom: 10px;
  94. }
  95. .active-weith-color {
  96. color: #e15652;
  97. font-weight: 600;
  98. }
  99. .el-dialog {
  100. display: flex;
  101. flex-direction: column;
  102. margin:0 !important;
  103. position:absolute;
  104. top:50%;
  105. left:50%;
  106. transform:translate(-50%,-50%);
  107. }
  108. .el-dialog__body {
  109. padding: 0 20px !important;
  110. font-weight: 600;
  111. }
  112. .text-tip {
  113. margin: 10px 0;
  114. }
  115. .el-dialog .el-button--primary {
  116. color: #FFF;
  117. background-color: #65b687;
  118. border-color: #29BA9C;
  119. }
  120. .el-dialog .el-button--primary:focus {
  121. color: #FFF;
  122. background-color: #57c988;
  123. border-color: #57c988;
  124. }
  125. .el-dialog .el-button--primary:hover {
  126. color: #FFF;
  127. background-color: #57c988;
  128. border-color: #57c988;
  129. }
  130. .version-box {
  131. border-left: 1px solid #e9e9e9;
  132. margin: 0;
  133. }
  134. .version-radius {
  135. background: #409eff;
  136. width: 10px;
  137. height: 10px;
  138. border-radius: 50%;
  139. float: left;
  140. position: relative;
  141. left: -5px;
  142. }
  143. .version-margin-left {
  144. margin-left: 30px;
  145. }
  146. .version-num {
  147. font-weight: 900;
  148. font-size: 22px;
  149. line-height: 24px;
  150. margin-bottom: 20px;
  151. }
  152. .version-margin-bottom {
  153. margin-bottom: 20px;
  154. }
  155. .version-time {
  156. background: #f9f9f9;
  157. border: 1px solid #e9e9e9;
  158. padding: 5px 10px;
  159. font-weight: 500;
  160. }
  161. .version-content {
  162. font-weight: 500;
  163. line-height: 28px;
  164. }
  165. .no-update-log {
  166. display: flex;
  167. justify-content: center;
  168. height: 790px;
  169. margin: 20px;
  170. }
  171. .update-log {
  172. padding:30px 0 10px 15px;
  173. color:#333;
  174. font-size:15px;
  175. line-height:24px;
  176. height: 550px;
  177. overflow-y: auto;
  178. }
  179. .vue-page {
  180. border-radius: 5px;
  181. width: calc(100% - 0.5%);
  182. float: right;
  183. /* margin-right: 35px;
  184. position: fixed;
  185. bottom: 0;
  186. right: 0; */
  187. padding: 15px 5% 15px 0;
  188. background: #fff;
  189. height: 60px;
  190. z-index: 999;
  191. margin-top: 0;
  192. box-shadow: 0 2px 9px rgba(51, 51, 51, 0.1);
  193. }
  194. .active-disabled {
  195. color: #c0c4cc !important;
  196. background-image: none !important;
  197. background-color: #eeeeee !important;
  198. border-color: #eeeeee !important;
  199. }
  200. .grid-content {
  201. height: 1160px;
  202. }
  203. .right-system {
  204. background: #fff;
  205. padding: 20px 20px 0 20px;
  206. margin-top: 10px;
  207. }
  208. </style>
  209. @endsection
  210. @section('content')
  211. <div id="upgrad" v-loading="init_loading">
  212. <el-row class="box" :gutter="10">
  213. <el-col :span="12">
  214. <div class="grid-content bg-purple">
  215. <div class="top-title">
  216. <span class="line"></span>
  217. <span>系统更新</span>
  218. </div>
  219. <div class="version-card">
  220. <div>本地后端版本: [[search.local_backend_version !== '' ? search.local_backend_version : '未知']]</div>
  221. <div>本地前端 (H5) 版本: [[search.local_frontend_version !== '' ? search.local_frontend_version : '未知']]</div>
  222. <div class="new-version">云端后台最新版本: [[search.origin_backend_version !== '' ? search.origin_backend_version : '未知']]</div>
  223. <div class="new-version">云端前端最新版本: [[search.origin_frontend_version !== '' ? search.origin_frontend_version : '未知']]</div>
  224. <el-button :class="search.upgrade_status == 1 ? '' : 'active-disabled'" type="primary" size="medium" :loading="init_loading" :disabled="search.upgrade_status == 1 ? false : true" @click="checkUpdateFile" v-if="is_update == ''">检查最新文件</el-button>
  225. <div v-if="is_update == 1">
  226. <el-button
  227. :class="agreeCheckList.length == 2 ? '' : 'active-disabled'"
  228. type="success"
  229. icon="el-icon-download"
  230. v-if="is_update_type === 1"
  231. :disabled="agreeCheckList.length == 2 ? false : true"
  232. @click="upgrade()"
  233. :loading="is_show_progress === 1"
  234. >立即更新</el-button
  235. >
  236. <el-button
  237. :class="agreeCheckList.length == 2 ? '' : 'active-disabled'"
  238. type="success"
  239. icon="el-icon-download"
  240. v-if="is_update_type === 2"
  241. :disabled="agreeCheckList.length == 2 ? false : true"
  242. @click="upgradeFront()"
  243. :loading="is_show_progress === 1"
  244. >立即更新</el-button
  245. >
  246. </div>
  247. </div>
  248. <div v-if="is_update == 1">
  249. <!-- <div v-if="is_update == 99" style="color:green;fonr-weight:800;line-height:50px;">
  250. 恭喜您,当前版本为最新版!
  251. </div> -->
  252. <div v-if="is_update == -1" style="fonr-weight:800;line-height:50px;">
  253. 暂未授权!
  254. </div>
  255. <div
  256. v-if="is_update == 3"
  257. style="color:green;fonr-weight:800;line-height:50px;"
  258. >
  259. 检查更新中...
  260. </div>
  261. <div
  262. v-if="is_update === -2"
  263. style="color:red;fonr-weight:800;line-height:50px;"
  264. >
  265. 网络请求超时!
  266. </div>
  267. <div
  268. v-if="is_update == 98"
  269. style="color:red;fonr-weight:800;line-height:50px;"
  270. >
  271. [[ error_msg ]]
  272. </div>
  273. <div class="update-tip" v-if="is_update == 1 && (is_update_type == 1 || is_update_type == 2)">
  274. <el-checkbox-group v-model="agreeCheckList">
  275. <el-checkbox label="file">我已知晓,点击立即更新将会请求云端文件覆盖本地文件,并执行数据库迁移文件以更新数据库表、字段等信息;</el-checkbox>
  276. <el-checkbox label="update">我已知晓,在线更新不能保证100%成功,可能会因更新失败导致程序运行异常,异常技术处理需要时间;如果我的剩余售后服务时长为0,官方将不会处理我的任何问题,包括更新导致的程序异常等.</el-checkbox>
  277. </el-checkbox-group>
  278. </div>
  279. <div class="update-file">
  280. <div style="display: flex;align-items: center;">
  281. <div class="title-tip" v-if="is_update == 1 && is_update_type == 1">更新之前请注意数据备份</div>
  282. <div style="display:inline-block;padding-left:10px;color:#999;margin-top: 20px;" v-if="is_show_progress === 1">
  283. <div v-if="is_show_progress_type === 1">
  284. 后台文件已更新
  285. <span style="color:red;font-weight:900">
  286. [[ updated_file ]]
  287. </span>
  288. 个文件 / 共
  289. <span style="color:red;font-weight:900">
  290. [[ total_file ]] </span
  291. >个文件!
  292. </div>
  293. <div v-if="is_show_progress_type === 2">
  294. 前端文件正在下载更新
  295. </div>
  296. <div v-if="is_show_progress_type === 3">
  297. 更新完成
  298. </div>
  299. <div v-if="is_show_progress_type === 4">
  300. 网络请求超时
  301. </div>
  302. </div>
  303. </div>
  304. <div v-if="is_update == 1 && is_update_type == 1">更新文件(选中则不更新)</div>
  305. <div class="check-box"><el-checkbox :true-label="1" :false-label="0" :label="item.path" v-for="(item,index) in files" :key="index" v-model.number="item.is_choose" v-if="is_update == 1 && is_update_type == 1"></el-checkbox></div>
  306. </div>
  307. <!-- <div v-if="is_update == 1 && is_update_type == 2">
  308. 当前版本号:<span
  309. style="color:red;fonr-weight:900;line-height:50px;"
  310. >[[ version ]]</span
  311. >
  312. </div> -->
  313. </div>
  314. </div>
  315. </el-col>
  316. <el-col :span="12">
  317. <div class="grid-content">
  318. <div class="right-system">
  319. <div class="top-title">
  320. <span class="line"></span>
  321. <span>系统信息</span>
  322. </div>
  323. <div class="systen-new">
  324. <br>
  325. <div>当前域名: [[search.current_domain !== '' ? search.current_domain : '未知']] <span class="active-color origin-state" v-if="search.current_domain">[[search.domain_status_txt]]</span></div>
  326. <div>客户端授权域名: [[search.origin_domain !== '' ? search.origin_domain : '未知']]</div>
  327. <br>
  328. <div>已安装插件数量: [[search.local_plugins_count !== '' ? `${search.local_plugins_count}个` : '未知']]</div>
  329. <div>已授权插件数量: [[search.origin_plugins_count !== '' ? `${search.origin_plugins_count}个` : '未知']]</div>
  330. <div class="active-color" v-if="search.no_auth_plugins > 0">未授权安装插件数量: [[search.no_auth_plugins !== '' ? `${search.no_auth_plugins}个` : '未知']]</div>
  331. <div class="active-color" v-else>&nbsp;</div>
  332. <br v-if="search.upgrade_status === 0">
  333. <div class="active-color" v-if="search.upgrade_status === 0">涉嫌使用盗版插件,为了保证您的权益,请及时联系客服处理!</div>
  334. <div class="active-color" v-if="search.upgrade_status === 0">我国《中华人民共和国刑法》第二百一十七条规定: 以营利为目的,有下列侵犯著作权情形之一,违法所得数额较大或者有其他严重情节的,处三年以下有期徒刑或者拘役,并处或者单处罚金;违法所得数额巨大或者有其他特别严重情节的,处三年以上七年以下有期徒刑,并处罚金:
  335. (一)未经著作权人许可,复制发行其文字作品、音乐、电影、电视、录像作品、计算软件及其他作品的; (二)出版他人享有专有出版权的图书的;(三)
  336. 未经录音录像制作者许可,复制发行其制作的录音录像的; (四)制作、出售假冒他人著名的美术作品的.</div>
  337. <br v-if="search.upgrade_status === 0">
  338. <div class="service-time">剩余售后服务时长: <span class="active-color">[[search.service_time !== '' ? `${search.service_time}天` : '未知']]</span></div>
  339. <div class="active-weith-color" style="height: 50px">
  340. <div v-if="search.service_time === 0" >
  341. 温馨提示: 当前售后服务时长为0,我们不会限制您更新系统,系统更新为所有客户统一推送,不管您是否付费,都不存在差别对待;但是因您售后服务
  342. 时长为0,我们将不会处理您的任何问题,包括因为更新出错导致系统异常等,如果您不具备技术维护能力,建议您续费后再进行系统更新!详情请联系客服!!!
  343. </div>
  344. </div>
  345. </div>
  346. </div>
  347. <div class="right-system">
  348. <br>
  349. <div class="top-title">
  350. <span class="line"></span>
  351. <span>更新日志</span>
  352. </div>
  353. <div class="no-update-log" v-show="log.length == 0">未知</div>
  354. <div class="update-log" v-show="log.length > 0" :style="{height: search.upgrade_status === 0 ? '613px' : '787px'}">
  355. <div class="version-box" v-for="(item, index) in log" :key="index">
  356. <div class="version-radius"></div>
  357. <div class="version-margin-left">
  358. <div class="version-num">[[item.title]]</div>
  359. <div class="version-margin-bottom">
  360. <span class="version-time">[[item.created_at]]</span>
  361. </div>
  362. <div style="padding-bottom:30px">
  363. <div v-for="(item1, index1) in item.content" :key="index1" v-html="item1"></div>
  364. </div>
  365. </div>
  366. </div>
  367. <div class="vue-page">
  368. <el-row>
  369. <el-col align="center">
  370. <el-pagination layout="prev, pager, next,jumper" @current-change="search1" :total="total" :page-size="per_page" :current-page="current_page" background></el-pagination>
  371. </el-col>
  372. </el-row>
  373. </div>
  374. </div>
  375. </div>
  376. </div>
  377. </el-col>
  378. </el-row>
  379. <el-dialog
  380. title="温馨提示"
  381. center
  382. :visible.sync="dialogVisible"
  383. :show-close="false"
  384. :close-on-click-modal="false"
  385. :close-on-press-escape="false"
  386. width="25%">
  387. <div>进入系统更新页面,您的程序将会请求我们的云端系统,检验您当前程序的版本和信息,用于检测是否存在新的更新文件.</div>
  388. <div class="text-tip">该请求不会修改您本地的任何文件和数据!</div>
  389. <span slot="footer" class="dialog-footer">
  390. <el-button type="info" @click="cancel">取消</el-button>
  391. <el-button type="primary" @click="agreeCheck(1)" :loading="agreeLoading">我已知晓并同意!</el-button>
  392. </span>
  393. </el-dialog>
  394. </div>
  395. <script>
  396. let upgrad = new Vue({
  397. el: "#upgrad",
  398. delimiters: ['[[', ']]'],
  399. name: 'upgrad',
  400. data() {
  401. return {
  402. file:'',
  403. update:'',
  404. dialogVisible: true,
  405. search:{
  406. current_domain: "",
  407. domain_status_txt: "",
  408. local_backend_version: "",
  409. local_frontend_version: "",
  410. local_plugins_count: "",
  411. no_auth_plugins: "",
  412. origin_backend_version: "",
  413. origin_domain: "",
  414. origin_frontend_version: "",
  415. origin_plugins_count: "",
  416. service_time: "",
  417. upgrade_status: "",
  418. hasUpgradeFile:0, //判断需不需要弹出层
  419. },
  420. twoSearch:{},
  421. log:[], //日志列表
  422. agreeCheckList:[],
  423. files:[], //更新文件
  424. not_files: [],
  425. agreeLoading:false,
  426. logLoading:false,
  427. init_loading: false,
  428. filecount: "", //后台文件数
  429. frontendUpgrad: "", //前端文件数
  430. is_update: '',
  431. is_update_type: 1, //显示哪个升级按钮
  432. error_msg:'',//错误提示
  433. is_show_progress: 0,
  434. is_show_progress_type: 0,
  435. total_file: 0,
  436. updated_file: 0,
  437. current_page:1,
  438. total:1,
  439. per_page:1,
  440. }
  441. },
  442. // mounted() {
  443. // this.agreeCheck('')
  444. // },
  445. watch:{
  446. logLoading(newVal,oldVal){
  447. if(newVal){
  448. document.getElementsByClassName('update-log')[0].scrollTop = 0;
  449. }
  450. }
  451. },
  452. methods:{
  453. cancel(){
  454. window.history.go(-1);
  455. },
  456. search1(page){
  457. this.getDataLog(page);
  458. },
  459. agreeCheck(val){
  460. this.init_loading = true;
  461. this.agreeLoading = true;
  462. // if(val){
  463. // this.search = this.twoSearch;
  464. // this.init_loading = false;
  465. // this.dialogVisible = false;
  466. // this.getDataLog(1);
  467. // return
  468. // }
  469. this.$http.post('{!! yzWebUrl('update.system-info') !!}').then(response => {
  470. return response.json();
  471. }).then(({data,msg,result}) => {
  472. if(result){
  473. if(data.hasUpgradeFile == undefined){
  474. data.hasUpgradeFile = 0;
  475. }
  476. // if(val || data.hasUpgradeFile == 1){
  477. this.search = data;
  478. this.getDataLog(1);
  479. this.dialogVisible = false;
  480. this.agreeLoading = false;
  481. // }
  482. // if(data.hasUpgradeFile === 0 && val == ''){
  483. // this.dialogVisible = true;
  484. // this.twoSearch = data;
  485. // }
  486. this.init_loading = false;
  487. }else{
  488. this.$message.success(msg);
  489. this.agreeLoading = false;
  490. this.init_loading = false;
  491. }
  492. }).catch(err => {
  493. console.log(err);
  494. })
  495. },
  496. // 获取更新日志
  497. getDataLog(page){
  498. this.logLoading = false;
  499. this.$http.post('{!! yzWebUrl('update.log') !!}',{page}).then(response => {
  500. return response.json();
  501. }).then(({data,msg,result}) => {
  502. if(result){
  503. this.log = data.data;
  504. this.total = data.total;
  505. this.per_page = data.per_page;
  506. this.current_page = data.current_page;
  507. this.logFormat();
  508. this.logLoading = true;
  509. }else{
  510. this.$message.success(msg);
  511. this.logLoading = true;
  512. }
  513. }).catch(err => {
  514. console.log(err);
  515. })
  516. },
  517. // 处理日志格式
  518. logFormat(){
  519. if (this.log && this.log.length >= 0) {
  520. let content = [];
  521. for (let i = 0; i < this.log.length; i++) {
  522. this.log[i].created_at = this.log[i].created_at.split(" ")[0];
  523. this.log[i].content = this.log[i].content.split("\n");
  524. }
  525. }
  526. },
  527. // 检查更新文件
  528. checkUpdateFile(){
  529. this.is_update = 3
  530. this.init_loading = true;
  531. this.$http.get('{!! yzWebUrl('update.verifyheck') !!}', {}).then(res => {
  532. return res.json();
  533. })
  534. .then(response => {
  535. if (response.result == 1) {
  536. if (response.filecount > 0) {
  537. this.files = response.files;
  538. // this.version = response.version; //后台版本号
  539. // if (response.list && response.list.length > 0) {
  540. // this.new_version =
  541. // response.list[response.frontendUpgrad - 1].version; //前端版本号
  542. // }
  543. this.filecount = response.filecount; //后台文件数
  544. this.frontendUpgrad = response.frontendUpgrad; //前端文件数
  545. // this.log = response.log;
  546. // // 升级说明数据处理
  547. // if (this.log && this.log.length >= 0) {
  548. // let content = [];
  549. // for (let i = 0; i < this.log.length; i++) {
  550. // this.log[i].created_at = this.log[i].created_at.split(" ")[0];
  551. // // console.log(this.log[i].content.split("\n"))
  552. // this.log[i].content = this.log[i].content.split("\n");
  553. // }
  554. // // this.content_list.push(content)
  555. // }
  556. this.is_update = 1;
  557. this.is_update_type = 1;
  558. }
  559. //后台没有更新文件
  560. else if (response.filecount <= 0) {
  561. // 前后端都没有更新文件
  562. if (response.frontendUpgrad == 0) {
  563. this.is_update = 99;
  564. }
  565. // 后台没有更新文件,前端有更新文件
  566. else {
  567. this.filecount = response.filecount; //后台文件数
  568. this.frontendUpgrad = response.frontendUpgrad; //前端文件数
  569. this.new_version =
  570. response.list[response.frontendUpgrad - 1].version; //前端版本号
  571. this.version = response.version; //后台版本号
  572. this.is_update = 1;
  573. this.is_update_type = 2;
  574. }
  575. }
  576. this.init_loading = false;
  577. } else if (response.result == -1) {
  578. this.$message.error("暂未授权!");
  579. this.is_update = -1;
  580. this.init_loading = false;
  581. } else if (response.result == -2) {
  582. this.$message.error("网络请求超时!");
  583. this.is_update = -2;
  584. this.init_loading = false;
  585. } else if (response.result == 99) {
  586. this.$message.success("当前版本为最新版!");
  587. this.is_update = 99;
  588. this.init_loading = false;
  589. } else if (response.result == 98) {
  590. this.$message.error(response.msg);
  591. this.error_msg = response.msg;
  592. this.is_update = 98;
  593. this.init_loading = false;
  594. } else if (response.result === 0) {
  595. // this.$router.push({ path: "/login" });
  596. }
  597. })
  598. .catch(() => {
  599. this.init_loading = false;
  600. });
  601. },
  602. upgrade() {
  603. var that = this;
  604. that.is_show_progress = 1;
  605. for (let i = 0; i < that.files.length; i++) {
  606. if (that.files[i].is_choose === 1) {
  607. that.not_files.push(that.files[i].path);
  608. }
  609. }
  610. this.$http.post('{!! yzWebUrl('update.fileDownload') !!}', {
  611. protocol:{
  612. file:1,
  613. update:1
  614. },
  615. nofiles: that.not_files
  616. }).then(res => {
  617. return res.json();
  618. })
  619. .then(response => {
  620. if (response.result == 1) {
  621. that.is_show_progress_type = 1;
  622. that.updated_file = response.success;
  623. that.total_file = response.total;
  624. that.upgrade();
  625. }
  626. // 更新前端
  627. else if (response.result == 2) {
  628. if (that.frontendUpgrad > 0) {
  629. that.upgradeFront();
  630. } else {
  631. that.is_show_progress_type = 3;
  632. that.is_show_progress = 0;
  633. location.reload();
  634. }
  635. }
  636. //不更新的文件
  637. else if (response.result == 3) {
  638. that.upgrade();
  639. }
  640. })
  641. .catch(() => {
  642. // this.loading = false;
  643. });
  644. console.log(that.not_files);
  645. },
  646. upgradeFront() {
  647. var that = this;
  648. that.is_show_progress = 1;
  649. that.is_show_progress_type = 2;
  650. this.$http.post('{!! yzWebUrl('update.startDownload') !!}', {}).then(res => {
  651. return res.json();
  652. })
  653. .then(response => {
  654. if (response.status == 1) {
  655. that.is_show_progress_type = 3;
  656. that.is_show_progress = 0;
  657. location.reload();
  658. } else {
  659. that.is_show_progress_type = 4;
  660. that.is_show_progress = 0;
  661. }
  662. })
  663. .catch(() => {
  664. // this.loading = false;
  665. });
  666. },
  667. }
  668. })
  669. </script>
  670. @endsection