Commit c897835e authored by panyf's avatar panyf
Browse files

[CP]修改返回错误信息异常问题,增加jwt鉴权功能

parent 5c58920d
......@@ -46,6 +46,11 @@
<version>3.4.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.1</version>
</dependency>
</dependencies>
<build>
......
package com.example.compileproxyserver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
......@@ -25,10 +27,39 @@ public class FileUploadController {
private static final String UPLOAD_DIR = "/home/devicemanager/programs";
private static final String TARGET_FILE = "radarcal.cc";
private static final String USER_NAME = "cdProxy";
private static final String USER_PASSWORD = "cdProxy_zed";
@Autowired
private JwtUtil jwtUtil;
@PostMapping("/login")
public ResponseEntity<String> login(@RequestParam("username") String username, @RequestParam("password") String password) {
System.out.println("username: " + username + " password: " + password);
if (USER_NAME.equals(username) && USER_PASSWORD.equals(password)) {
String token = new JwtUtil().generateToken(username);
//test
System.out.println("token: " + token + " username: " + username + " password: " + password + "extractname: " + jwtUtil.extractUsername(token));
return ResponseEntity.ok(new JwtUtil.AuthResponse(token).getToken());
} else {
return ResponseEntity.status(401).body("Invalid username or password");
}
}
@PostMapping("/upload")
public ResponseEntity<Object> uploadFile(@RequestParam("file") MultipartFile file) {
public ResponseEntity<Object> uploadFile(@RequestHeader("Authorization") String authorizationHeader,
@RequestParam("file") MultipartFile file) {
try {
String token = authorizationHeader.replace("Bearer ", "");
System.out.println("token: " + token + " username: " + "extractname: " + jwtUtil.extractUsername(token));
String username = jwtUtil.extractUsername(token);
if(jwtUtil.validateToken(token, username)){
System.out.println("Token is valid");
return ResponseEntity.status(401).body("token错误,请刷新页面重新登录");
}
// 创建上传目录
File uploadDir = new File(UPLOAD_DIR);
if (!uploadDir.exists()) {
......@@ -73,6 +104,8 @@ public class FileUploadController {
return ResponseEntity.status(500)
.contentType(MediaType.TEXT_PLAIN)
.body(e.getMessage());
} catch (RuntimeException e) {
return ResponseEntity.status(401).body(e.getMessage());
}
}
......@@ -87,13 +120,11 @@ public class FileUploadController {
Process rmMkdirProcess = rmMkdirBuilder.start();
int rmMkdirExitCode = rmMkdirProcess.waitFor();
// 捕获并打印 rm -rf build && mkdir build 的输出
logProcessOutput(rmMkdirProcess);
if (rmMkdirExitCode != 0) {
// 获取错误流并读取错误信息
try (BufferedReader errorReader = new BufferedReader(new InputStreamReader(rmMkdirProcess.getErrorStream()))) {
String errorLog = errorReader.lines().collect(Collectors.joining(" "));
String errorLog = errorReader.lines().collect(Collectors.joining("\n"));
System.out.println("Failed to clean and create build directory: " + errorLog);
return new PublishResult(false, "Failed to clean and create build directory: " + errorLog, publishDir);
}
}
......@@ -104,50 +135,18 @@ public class FileUploadController {
Process cmakeMakeProcess = cmakeMakeBuilder.start();
int cmakeMakeExitCode = cmakeMakeProcess.waitFor();
// 捕获并打印 cmake 和 make 的输出
String outputLog = logProcessOutput(cmakeMakeProcess);
if (cmakeMakeExitCode != 0) {
// 获取错误流并读取错误信息
try (BufferedReader errorReader = new BufferedReader(new InputStreamReader(cmakeMakeProcess.getErrorStream()))) {
String errorLog = errorReader.lines().collect(Collectors.joining(" "));
return new PublishResult(false, "CMake or Make failed: " + outputLog + " Error: " + errorLog, publishDir);
String errorLog = errorReader.lines().collect(Collectors.joining("\n"));
return new PublishResult(false, "CMake or Make failed: " + " Error: " + errorLog, publishDir);
}
}
return new PublishResult(true, "Build succeeded", publishDir);
}
/**
* 捕获并打印进程的标准输出和错误输出。
*
* @param process 要捕获输出的进程
* @return 标准输出的日志内容
*/
private String logProcessOutput(Process process) throws IOException {
StringBuilder outputLog = new StringBuilder();
// 捕获标准输出
try (BufferedReader outputReader = new BufferedReader(new InputStreamReader(process.getInputStream()))) {
String line;
System.out.println("Standard Output:");
while ((line = outputReader.readLine()) != null) {
System.out.println(line); // 打印到控制台
}
}
// 捕获错误输出
try (BufferedReader errorReader = new BufferedReader(new InputStreamReader(process.getErrorStream()))) {
String line;
System.out.println("Error Output:");
while ((line = errorReader.readLine()) != null) {
System.err.println(line); // 打印到控制台(红色字体)
}
}
return outputLog.toString();
}
private Path findPublishedFile(Path publishDir) {
File[] files = publishDir.toFile().listFiles();
......
package com.example.compileproxyserver;
import io.jsonwebtoken.*;
import org.springframework.stereotype.Component;
import java.util.Date;
@Component
public class JwtUtil {
private final String SECRET_KEY = "ZEDzedZeDZEdzEDzeDtechTechTEchTEChTECHsecretSECRET";
public String generateToken(String username) {
return Jwts.builder()
.setSubject(username)
.setIssuedAt(new Date(System.currentTimeMillis()))
.setExpiration(new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 10))
.signWith(SignatureAlgorithm.HS256, SECRET_KEY)
.compact();
}
public String extractUsername(String token) {
return Jwts.parser().setSigningKey(SECRET_KEY).parseClaimsJws(token).getBody().getSubject();
}
public boolean validateToken(String token, String username) {
try {
final String extractedUsername = extractUsername(token);
return (extractedUsername.equals(username) && !isTokenExpired(token));
} catch (JwtException | IllegalArgumentException e) {
throw new RuntimeException("Expired or invalid JWT token");
}
}
private boolean isTokenExpired(String token) {
return Jwts.parser().setSigningKey(SECRET_KEY).parseClaimsJws(token).getBody().getExpiration().before(new Date());
}
public class AuthRequest {
private String username;
private String password;
// Getters and setters
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
static class AuthResponse {
private String token;
public AuthResponse(String token) {
this.token = token;
}
// Getter
public String getToken() {
return token;
}
}
}
#app{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-align:center;color:#2c3e50}.upload-container[data-v-9955520a]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100vh}
\ No newline at end of file
(function(){"use strict";var e={6653:function(e,t,s){var r=s(5471),o=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"app"}},[t("router-view")],1)},n=[],i={data(){return{}},methods:{},mounted(){}},a=i,l=s(1656),u=(0,l.A)(a,o,n,!1,null,null,null),c=u.exports,d=s(173),g=function(){var e=this,t=e._self._c;return t("div",{staticClass:"upload-container"},[t("el-dialog",{attrs:{visible:e.loginDialogVisible,title:"登录"},on:{"update:visible":function(t){e.loginDialogVisible=t}}},[t("el-form",{on:{submit:function(t){return t.preventDefault(),e.handleLogin.apply(null,arguments)}}},[t("el-form-item",{attrs:{label:"用户名"}},[t("el-input",{model:{value:e.loginForm.username,callback:function(t){e.$set(e.loginForm,"username",t)},expression:"loginForm.username"}})],1),t("el-form-item",{attrs:{label:"密码"}},[t("el-input",{attrs:{type:"password"},model:{value:e.loginForm.password,callback:function(t){e.$set(e.loginForm,"password",t)},expression:"loginForm.password"}})],1),t("el-button",{attrs:{type:"primary","native-type":"submit"}},[e._v("登录")])],1)],1),e.isLoggedIn?t("el-upload",{ref:"uploadRef",attrs:{action:e.uploadUrl,"auto-upload":!1,"on-change":e.handleFileChange,"file-list":e.fileList,accept:".cc",multiple:!1},scopedSlots:e._u([{key:"trigger",fn:function(){return[t("el-button",{attrs:{size:"small",type:"primary"}},[e._v("选取文件")])]},proxy:!0}],null,!1,2040363866)},[t("el-button",{staticStyle:{"margin-left":"10px"},attrs:{size:"small",type:"success",disabled:e.isUploading},on:{click:e.uploadFile}},[e._v(" 上传并编译 ")])],1):e._e(),e.isLoggedIn&&e.isUploading?t("el-progress",{staticClass:"mt-4",attrs:{percentage:e.progressPercentage,status:e.progressStatus,"stroke-width":10,"show-info":!1}}):e._e(),e.isLoggedIn&&e.isSuccess?t("el-alert",{staticClass:"mt-4",attrs:{title:"编译成功!",type:"success","show-icon":""}}):e._e(),e.isLoggedIn&&e.showErrorMessage?t("el-alert",{staticClass:"mt-4",attrs:{title:"发布错误信息",type:"error",closable:!1}},[e._v(" "+e._s(e.errorMessage)+" ")]):e._e(),e.isLoggedIn&&e.isDownloadAvailable?t("el-button",{staticClass:"mt-4",attrs:{size:"small",type:"primary"},on:{click:e.downloadFile}},[e._v(" 下载标定程序 ")]):e._e()],1)},p=[],h=(s(4603),s(7566),s(8721),s(4335)),f={data(){return{loginDialogVisible:!0,loginForm:{username:"",password:""},isLoggedIn:!1,uploadUrl:"/upload",fileList:[],selectedFile:null,downloadUrl:null,downloadFileName:"radarcal",errorMessage:"",showErrorMessage:!1,isUploading:!1,progressPercentage:0,progressStatus:"",isSuccess:!1,isDownloadAvailable:!1,progressInterval:null}},methods:{handleLogin(){h.A.post("/login",this.loginForm).then((e=>{const t=e.data;localStorage.setItem("token",t),this.isLoggedIn=!0,this.loginDialogVisible=!1,this.$message.success("登录成功")})).catch((e=>{this.$message.error("登录失败,请检查用户名和密码")}))},handleFileChange(e){this.selectedFile=e.raw,this.fileList=[e]},async uploadFile(){if(this.selectedFile){this.errorMessage="",this.showErrorMessage=!1,this.isSuccess=!1,this.isUploading=!0,this.progressPercentage=0,this.progressStatus="",this.progressInterval=setInterval((()=>{this.progressPercentage<100?this.progressPercentage+=1:clearInterval(this.progressInterval)}),1200);try{const e=new FormData;e.append("file",this.selectedFile);const t=await fetch(this.uploadUrl,{method:"POST",headers:{Authorization:`Bearer ${localStorage.getItem("token")}`},body:e});if(clearInterval(this.progressInterval),t.ok){const e=await t.blob();this.downloadUrl=window.URL.createObjectURL(e),this.isDownloadAvailable=!0,this.isSuccess=!0,this.progressPercentage=100,this.progressStatus="success",this.$message.success("编译成功!")}else{const e=await t.text();this.errorMessage=e,this.showErrorMessage=!0,this.progressStatus="error",401===t.status&&(this.$message.error("登录已过期,请重新登录"),this.isLoggedIn=!1,this.loginDialogVisible=!0)}}catch(e){clearInterval(this.progressInterval),console.error("发生错误:",e),this.errorMessage="发生错误,请重试",this.showErrorMessage=!0,this.progressStatus="error",e.response&&401===e.response.status&&(this.$message.error("登录已过期,请重新登录"),this.isLoggedIn=!1,this.loginDialogVisible=!0)}finally{this.isUploading=!1}}else this.$message.error("请选择一个文件")},downloadFile(){if(this.downloadUrl){const e=document.createElement("a");e.href=this.downloadUrl,e.download=this.downloadFileName,document.body.appendChild(e),e.click(),document.body.removeChild(e)}}}},m=f,v=(0,l.A)(m,g,p,!1,null,"9955520a",null),b=v.exports;r["default"].use(d.Ay);const w=[{path:"/",name:"root",redirect:"/upload"},{path:"/upload",name:"upload",component:b}],y=new d.Ay({mode:"history",base:"/",routes:w});var F=y,I=s(1052),S=s.n(I),_=s(9952);r["default"].config.productionTip=!1,r["default"].use(S()),r["default"].use(S(),{locale:_["default"]}),new r["default"]({router:F,render:e=>e(c)}).$mount("#app")}},t={};function s(r){var o=t[r];if(void 0!==o)return o.exports;var n=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(n.exports,n,n.exports,s),n.loaded=!0,n.exports}s.m=e,function(){s.amdO={}}(),function(){var e=[];s.O=function(t,r,o,n){if(!r){var i=1/0;for(c=0;c<e.length;c++){r=e[c][0],o=e[c][1],n=e[c][2];for(var a=!0,l=0;l<r.length;l++)(!1&n||i>=n)&&Object.keys(s.O).every((function(e){return s.O[e](r[l])}))?r.splice(l--,1):(a=!1,n<i&&(i=n));if(a){e.splice(c--,1);var u=o();void 0!==u&&(t=u)}}return t}n=n||0;for(var c=e.length;c>0&&e[c-1][2]>n;c--)e[c]=e[c-1];e[c]=[r,o,n]}}(),function(){s.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return s.d(t,{a:t}),t}}(),function(){s.d=function(e,t){for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}}(),function(){s.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){s.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}(),function(){s.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e}}(),function(){var e={524:0};s.O.j=function(t){return 0===e[t]};var t=function(t,r){var o,n,i=r[0],a=r[1],l=r[2],u=0;if(i.some((function(t){return 0!==e[t]}))){for(o in a)s.o(a,o)&&(s.m[o]=a[o]);if(l)var c=l(s)}for(t&&t(r);u<i.length;u++)n=i[u],s.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return s.O(c)},r=self["webpackChunkfrontend"]=self["webpackChunkfrontend"]||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}();var r=s.O(void 0,[504],(function(){return s(6653)}));r=s.O(r)})();
//# sourceMappingURL=app.cd3a0313.js.map
\ No newline at end of file
{"version":3,"file":"js/app.cd3a0313.js","mappings":"mEAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,MAAM,CAACE,MAAM,CAAC,GAAK,QAAQ,CAACF,EAAG,gBAAgB,EACrH,EACIG,EAAkB,GCKtB,GACAC,IAAAA,GACA,QACA,EACAC,QAAA,GACAC,OAAAA,GAAA,GCZyO,I,UCQrOC,GAAY,OACd,EACAV,EACAM,GACA,EACA,KACA,KACA,MAIF,EAAeI,EAAiB,Q,SCnB5BV,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,MAAM,CAACQ,YAAY,oBAAoB,CAACR,EAAG,YAAY,CAACE,MAAM,CAAC,QAAUJ,EAAIW,mBAAmB,MAAQ,MAAMC,GAAG,CAAC,iBAAiB,SAASC,GAAQb,EAAIW,mBAAmBE,CAAM,IAAI,CAACX,EAAG,UAAU,CAACU,GAAG,CAAC,OAAS,SAASC,GAAgC,OAAx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IC/CvF,IAAIK,EAAsB/D,EAAoBa,OAAEV,EAAW,CAAC,MAAM,WAAa,OAAOH,EAAoB,KAAO,IACjH+D,EAAsB/D,EAAoBa,EAAEkD,E","sources":["webpack://frontend/./src/App.vue","webpack://frontend/src/App.vue","webpack://frontend/./src/App.vue?c036","webpack://frontend/./src/App.vue?0e40","webpack://frontend/./src/views/UploadView.vue","webpack://frontend/src/views/UploadView.vue","webpack://frontend/./src/views/UploadView.vue?2744","webpack://frontend/./src/views/UploadView.vue?85a7","webpack://frontend/./src/router/index.js","webpack://frontend/./src/main.js","webpack://frontend/webpack/bootstrap","webpack://frontend/webpack/runtime/amd options","webpack://frontend/webpack/runtime/chunk loaded","webpack://frontend/webpack/runtime/compat get default export","webpack://frontend/webpack/runtime/define property getters","webpack://frontend/webpack/runtime/global","webpack://frontend/webpack/runtime/hasOwnProperty shorthand","webpack://frontend/webpack/runtime/make namespace object","webpack://frontend/webpack/runtime/node module decorator","webpack://frontend/webpack/runtime/jsonp chunk loading","webpack://frontend/webpack/startup"],"sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{attrs:{\"id\":\"app\"}},[_c('router-view')],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n <div id=\"app\">\n <router-view></router-view>\n </div>\n</template>\n\n<script>\nexport default {\n data() {\n return {};\n },\n methods: {},\n mounted() {}\n};\n</script>\n\n<style>\n#app {\n font-family: Avenir, Helvetica, Arial, sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-align: center;\n color: #2c3e50;\n}\n</style>","import mod from \"-!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./App.vue?vue&type=template&id=471891ce\"\nimport script from \"./App.vue?vue&type=script&lang=js\"\nexport * from \"./App.vue?vue&type=script&lang=js\"\nimport style0 from \"./App.vue?vue&type=style&index=0&id=471891ce&prod&lang=css\"\n\n\n/* normalize component */\nimport normalizer from \"!../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:\"upload-container\"},[_c('el-dialog',{attrs:{\"visible\":_vm.loginDialogVisible,\"title\":\"登录\"},on:{\"update:visible\":function($event){_vm.loginDialogVisible=$event}}},[_c('el-form',{on:{\"submit\":function($event){$event.preventDefault();return _vm.handleLogin.apply(null, arguments)}}},[_c('el-form-item',{attrs:{\"label\":\"用户名\"}},[_c('el-input',{model:{value:(_vm.loginForm.username),callback:function ($$v) {_vm.$set(_vm.loginForm, \"username\", $$v)},expression:\"loginForm.username\"}})],1),_c('el-form-item',{attrs:{\"label\":\"密码\"}},[_c('el-input',{attrs:{\"type\":\"password\"},model:{value:(_vm.loginForm.password),callback:function ($$v) {_vm.$set(_vm.loginForm, \"password\", $$v)},expression:\"loginForm.password\"}})],1),_c('el-button',{attrs:{\"type\":\"primary\",\"native-type\":\"submit\"}},[_vm._v(\"登录\")])],1)],1),(_vm.isLoggedIn)?_c('el-upload',{ref:\"uploadRef\",attrs:{\"action\":_vm.uploadUrl,\"auto-upload\":false,\"on-change\":_vm.handleFileChange,\"file-list\":_vm.fileList,\"accept\":\".cc\",\"multiple\":false},scopedSlots:_vm._u([{key:\"trigger\",fn:function(){return [_c('el-button',{attrs:{\"size\":\"small\",\"type\":\"primary\"}},[_vm._v(\"选取文件\")])]},proxy:true}],null,false,2040363866)},[_c('el-button',{staticStyle:{\"margin-left\":\"10px\"},attrs:{\"size\":\"small\",\"type\":\"success\",\"disabled\":_vm.isUploading},on:{\"click\":_vm.uploadFile}},[_vm._v(\" 上传并编译 \")])],1):_vm._e(),(_vm.isLoggedIn && _vm.isUploading)?_c('el-progress',{staticClass:\"mt-4\",attrs:{\"percentage\":_vm.progressPercentage,\"status\":_vm.progressStatus,\"stroke-width\":10,\"show-info\":false}}):_vm._e(),(_vm.isLoggedIn && _vm.isSuccess)?_c('el-alert',{staticClass:\"mt-4\",attrs:{\"title\":\"编译成功!\",\"type\":\"success\",\"show-icon\":\"\"}}):_vm._e(),(_vm.isLoggedIn && _vm.showErrorMessage)?_c('el-alert',{staticClass:\"mt-4\",attrs:{\"title\":\"发布错误信息\",\"type\":\"error\",\"closable\":false}},[_vm._v(\" \"+_vm._s(_vm.errorMessage)+\" \")]):_vm._e(),(_vm.isLoggedIn && _vm.isDownloadAvailable)?_c('el-button',{staticClass:\"mt-4\",attrs:{\"size\":\"small\",\"type\":\"primary\"},on:{\"click\":_vm.downloadFile}},[_vm._v(\" 下载标定程序 \")]):_vm._e()],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<!-- src/components/Upload.vue -->\r\n<template>\r\n <div class=\"upload-container\">\r\n <!-- 登录窗口 -->\r\n <el-dialog :visible.sync=\"loginDialogVisible\" title=\"登录\">\r\n <el-form @submit.prevent=\"handleLogin\">\r\n <el-form-item label=\"用户名\">\r\n <el-input v-model=\"loginForm.username\"></el-input>\r\n </el-form-item>\r\n <el-form-item label=\"密码\">\r\n <el-input type=\"password\" v-model=\"loginForm.password\"></el-input>\r\n </el-form-item>\r\n <el-button type=\"primary\" native-type=\"submit\">登录</el-button>\r\n </el-form>\r\n </el-dialog>\r\n\r\n <!-- 上传组件,登录成功后显示 -->\r\n <el-upload\r\n v-if=\"isLoggedIn\"\r\n ref=\"uploadRef\"\r\n :action=\"uploadUrl\"\r\n :auto-upload=\"false\"\r\n :on-change=\"handleFileChange\"\r\n :file-list=\"fileList\"\r\n accept=\".cc\"\r\n :multiple=\"false\"\r\n >\r\n <template #trigger>\r\n <el-button size=\"small\" type=\"primary\">选取文件</el-button>\r\n </template>\r\n <el-button\r\n style=\"margin-left: 10px;\"\r\n size=\"small\"\r\n type=\"success\"\r\n :disabled=\"isUploading\"\r\n @click=\"uploadFile\"\r\n >\r\n 上传并编译\r\n </el-button>\r\n </el-upload>\r\n\r\n <!-- 动态进度条 -->\r\n <el-progress\r\n v-if=\"isLoggedIn && isUploading\"\r\n :percentage=\"progressPercentage\"\r\n :status=\"progressStatus\"\r\n class=\"mt-4\"\r\n :stroke-width=\"10\"\r\n :show-info=\"false\"\r\n ></el-progress>\r\n\r\n <!-- 成功提示 -->\r\n <el-alert\r\n v-if=\"isLoggedIn && isSuccess\"\r\n title=\"编译成功!\"\r\n type=\"success\"\r\n show-icon\r\n class=\"mt-4\"\r\n ></el-alert>\r\n\r\n <!-- 错误信息栏 -->\r\n <el-alert\r\n v-if=\"isLoggedIn && showErrorMessage\"\r\n title=\"发布错误信息\"\r\n type=\"error\"\r\n :closable=\"false\"\r\n class=\"mt-4\"\r\n >\r\n {{ errorMessage }}\r\n </el-alert>\r\n\r\n <!-- 下载按钮 -->\r\n <el-button\r\n v-if=\"isLoggedIn && isDownloadAvailable\"\r\n size=\"small\"\r\n type=\"primary\"\r\n @click=\"downloadFile\"\r\n class=\"mt-4\"\r\n >\r\n 下载标定程序\r\n </el-button>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport axios from \"axios\";\r\n\r\nexport default {\r\n data() {\r\n return {\r\n loginDialogVisible: true, // 登录窗口初始显示\r\n loginForm: {\r\n username: \"\",\r\n password: \"\"\r\n },\r\n isLoggedIn: false, // 登录状态\r\n uploadUrl: \"/upload\",\r\n fileList: [],\r\n selectedFile: null,\r\n downloadUrl: null,\r\n downloadFileName: \"radarcal\",\r\n errorMessage: \"\",\r\n showErrorMessage: false, // 控制错误信息栏的显示\r\n isUploading: false, // 是否正在上传和编译\r\n progressPercentage: 0, // 进度条百分比\r\n progressStatus: \"\", // 进度条状态(success/error)\r\n isSuccess: false, // 是否编译成功\r\n isDownloadAvailable: false, // 是否显示下载按钮\r\n progressInterval: null // 用于存储进度条更新的定时器\r\n };\r\n },\r\n methods: {\r\n handleLogin() {\r\n axios\r\n .post(\"/login\", this.loginForm)\r\n .then(response => {\r\n const token = response.data;\r\n localStorage.setItem(\"token\", token); // 存储 Token\r\n this.isLoggedIn = true;\r\n this.loginDialogVisible = false; // 关闭登录窗口\r\n this.$message.success(\"登录成功\");\r\n })\r\n .catch(error => {\r\n this.$message.error(\"登录失败,请检查用户名和密码\");\r\n });\r\n },\r\n handleFileChange(file) {\r\n this.selectedFile = file.raw;\r\n this.fileList = [file];\r\n },\r\n async uploadFile() {\r\n if (!this.selectedFile) {\r\n this.$message.error(\"请选择一个文件\");\r\n return;\r\n }\r\n\r\n // 清空错误信息和成功提示\r\n this.errorMessage = \"\";\r\n this.showErrorMessage = false;\r\n this.isSuccess = false;\r\n\r\n // 开始上传和编译\r\n this.isUploading = true;\r\n this.progressPercentage = 0;\r\n this.progressStatus = \"\";\r\n\r\n // 设置进度条定时器,100 秒内均匀增长到 100%\r\n this.progressInterval = setInterval(() => {\r\n if (this.progressPercentage < 100) {\r\n this.progressPercentage += 1; // 每秒增加 1%\r\n } else {\r\n clearInterval(this.progressInterval); // 停止定时器\r\n }\r\n }, 1200); // 每1.2秒更新一次进度条\r\n\r\n try {\r\n const formData = new FormData();\r\n formData.append(\"file\", this.selectedFile);\r\n\r\n const response = await fetch(this.uploadUrl, {\r\n method: \"POST\",\r\n headers: {\r\n Authorization: `Bearer ${localStorage.getItem(\"token\")}` // 添加 Token 到请求头\r\n },\r\n body: formData\r\n });\r\n\r\n clearInterval(this.progressInterval); // 停止进度条定时器\r\n\r\n if (response.ok) {\r\n const blob = await response.blob();\r\n this.downloadUrl = window.URL.createObjectURL(blob);\r\n this.isDownloadAvailable = true; // 显示下载按钮\r\n this.isSuccess = true; // 标记编译成功\r\n this.progressPercentage = 100; // 进度条完成\r\n this.progressStatus = \"success\"; // 进度条状态为成功\r\n this.$message.success(\"编译成功!\"); // 提示编译成功\r\n } else {\r\n const errorText = await response.text();\r\n this.errorMessage = errorText;\r\n this.showErrorMessage = true; // 显示错误信息栏\r\n this.progressStatus = \"error\"; // 进度条状态为失败\r\n if (response.status === 401) {\r\n this.$message.error(\"登录已过期,请重新登录\");\r\n this.isLoggedIn = false;\r\n this.loginDialogVisible = true; // 显示登录窗口\r\n }\r\n }\r\n } catch (error) {\r\n clearInterval(this.progressInterval); // 停止进度条定时器\r\n console.error(\"发生错误:\", error);\r\n this.errorMessage = \"发生错误,请重试\";\r\n this.showErrorMessage = true; // 显示错误信息栏\r\n this.progressStatus = \"error\"; // 进度条状态为失败\r\n if (error.response && error.response.status === 401) {\r\n this.$message.error(\"登录已过期,请重新登录\");\r\n this.isLoggedIn = false;\r\n this.loginDialogVisible = true; // 显示登录窗口\r\n }\r\n } finally {\r\n this.isUploading = false; // 隐藏进度条\r\n }\r\n },\r\n downloadFile() {\r\n if (this.downloadUrl) {\r\n const link = document.createElement(\"a\");\r\n link.href = this.downloadUrl;\r\n link.download = this.downloadFileName;\r\n document.body.appendChild(link);\r\n link.click();\r\n document.body.removeChild(link);\r\n }\r\n }\r\n }\r\n};\r\n</script>\r\n\r\n<style scoped>\r\n.upload-container {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n justify-content: center;\r\n height: 100vh;\r\n}\r\n</style>","import mod from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./UploadView.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./UploadView.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./UploadView.vue?vue&type=template&id=9955520a&scoped=true\"\nimport script from \"./UploadView.vue?vue&type=script&lang=js\"\nexport * from \"./UploadView.vue?vue&type=script&lang=js\"\nimport style0 from \"./UploadView.vue?vue&type=style&index=0&id=9955520a&prod&scoped=true&lang=css\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"9955520a\",\n null\n \n)\n\nexport default component.exports","import Vue from 'vue'\nimport VueRouter from 'vue-router'\nimport UploadView from \"@/views/UploadView.vue\";\n\nVue.use(VueRouter)\n\nconst routes = [\n {\n path: '/',\n name: 'root',\n redirect: '/upload'\n },\n {\n path: '/upload',\n name: 'upload',\n component: UploadView\n },\n\n]\n\nconst router = new VueRouter({\n mode: 'history',\n base: process.env.BASE_URL,\n routes\n})\n\nexport default router\n","import Vue from 'vue'\r\nimport App from './App.vue'\r\nimport router from './router'\r\nimport ElementUI from 'element-ui';\r\nimport 'element-ui/lib/theme-chalk/index.css';\r\nimport locale from 'element-ui/lib/locale/lang/zh-CN';\r\n\r\n\r\nVue.config.productionTip = false\r\nVue.use(ElementUI);\r\nVue.use(ElementUI, { locale });\r\n\r\nnew Vue({\r\n router,\r\n render: h => h(App)\r\n}).$mount('#app')\r\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","__webpack_require__.amdO = {};","var deferred = [];\n__webpack_require__.O = function(result, chunkIds, fn, priority) {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = function(module) {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t524: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkfrontend\"] = self[\"webpackChunkfrontend\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [504], function() { return __webpack_require__(6653); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["render","_vm","this","_c","_self","attrs","staticRenderFns","data","methods","mounted","component","staticClass","loginDialogVisible","on","$event","preventDefault","handleLogin","apply","arguments","model","value","loginForm","username","callback","$$v","$set","expression","password","_v","isLoggedIn","ref","uploadUrl","handleFileChange","fileList","scopedSlots","_u","key","fn","proxy","staticStyle","isUploading","uploadFile","_e","progressPercentage","progressStatus","isSuccess","showErrorMessage","_s","errorMessage","isDownloadAvailable","downloadFile","selectedFile","downloadUrl","downloadFileName","progressInterval","axios","post","then","response","token","localStorage","setItem","$message","success","catch","error","file","raw","setInterval","clearInterval","formData","FormData","append","fetch","method","headers","Authorization","getItem","body","ok","blob","window","URL","createObjectURL","errorText","text","status","console","link","document","createElement","href","download","appendChild","click","removeChild","Vue","use","VueRouter","routes","path","name","redirect","UploadView","router","mode","base","process","config","productionTip","ElementUI","locale","h","App","$mount","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","id","loaded","__webpack_modules__","call","m","amdO","deferred","O","result","chunkIds","priority","notFulfilled","Infinity","i","length","fulfilled","j","Object","keys","every","splice","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","g","globalThis","Function","e","obj","prop","prototype","hasOwnProperty","Symbol","toStringTag","nmd","paths","children","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","self","forEach","bind","push","__webpack_exports__"],"sourceRoot":""}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment