提交 1654b67b 编写于 作者: cxt104926's avatar cxt104926

1

上级 2bdc2be4
# stusystem
#### 1.介绍
一个简单的练手demo,[前后端分离]
一个简单的练手demo,[前后端分离]
运用了MySQL为后台数据库,easyui作为前台技术,使用了当前较为流行的框架spring Boot + MyBatis + shiro,前端是Vue + Element-ui架构,应用服务器使用了tomcat,以IDEA为开发工具,系统实现了宿舍管理、学生管理、宿舍分配、宿舍评比、损坏管理查询等必需的功能,其操作简单,界面友好,运行比较稳定,适用于大学院校大学生宿舍管理。
用户管理(增删改查)、宿舍管理(增删改查)、学生管理(增删改查)、宿舍分配(增删改查)、宿舍评比(增删改查)、损坏报备(增删改查)、日志记录(增查)、进出宿舍记录(增查)_调用人脸识别
......@@ -46,13 +46,16 @@
#### 4.使用说明
1. 项目启动:本系统前端采用的是vue,故而在启动时候先需要打包下前端,然后启动项目。
1. 项目启动:本系统前后端分离,故而在启动项目时候需要启动前端、后端两者。
前端启动:npm run dev
① 打包前端(IDEA下方Terminal):npm run build
② 启动后端:启动SpringBoot项目
③ 访问项目:在浏览器中输入 -> `localhost:2020`
2. 打包部署项目:
① 打包前端(IDEA下方Terminal):npm run build
② 启动后端:启动SpringBoot项目
③ 访问项目:在浏览器中输入 -> `localhost:2020`
#### 5.说在最后
......
#app{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-align:center;color:#2c3e50;margin-top:60px}h1[data-v-5e05269b],h2[data-v-5e05269b]{font-weight:400}ul[data-v-5e05269b]{list-style-type:none;padding:0}li[data-v-5e05269b]{display:inline-block;margin:0 10px}a[data-v-5e05269b]{color:#42b983}
/*# sourceMappingURL=app.f13280f6b4e2ea5fe8a53b3ce3b3b269.css.map */
\ No newline at end of file
{"version":3,"sources":["app.f13280f6b4e2ea5fe8a53b3ce3b3b269.css"],"names":[],"mappings":"AACA,KACE,6CAAmD,CACnD,kCAAmC,CACnC,iCAAkC,CAClC,iBAAkB,CAClB,aAAc,CACd,eACF,CAEA,wCACE,eACF,CACA,oBACE,oBAAqB,CACrB,SACF,CACA,oBACE,oBAAqB,CACrB,aACF,CACA,mBACE,aACF","file":"app.f13280f6b4e2ea5fe8a53b3ce3b3b269.css","sourcesContent":["\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 margin-top: 60px;\n}\n\nh1[data-v-5e05269b], h2[data-v-5e05269b] {\n font-weight: normal;\n}\nul[data-v-5e05269b] {\n list-style-type: none;\n padding: 0;\n}\nli[data-v-5e05269b] {\n display: inline-block;\n margin: 0 10px;\n}\na[data-v-5e05269b] {\n color: #42b983;\n}\n"]}
\ No newline at end of file
#app{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-align:center;color:#2c3e50;margin-top:60px}.but{font-size:.14rem;color:#3c8dbc}h1[data-v-5e05269b],h2[data-v-5e05269b]{font-weight:400}ul[data-v-5e05269b]{list-style-type:none;padding:0}li[data-v-5e05269b]{display:inline-block;margin:0 10px}a[data-v-5e05269b]{color:#42b983}
/*# sourceMappingURL=app.fde1d72a41cfe542fdc25bf9468dc689.css.map */
\ No newline at end of file
{"version":3,"sources":["app.fde1d72a41cfe542fdc25bf9468dc689.css"],"names":[],"mappings":"AACA,KACE,6CAAmD,CACnD,kCAAmC,CACnC,iCAAkC,CAClC,iBAAkB,CAClB,aAAc,CACd,eACF,CAEA,KACE,gBAAiB,CACjB,aACF,CAEA,wCACE,eACF,CACA,oBACE,oBAAqB,CACrB,SACF,CACA,oBACE,oBAAqB,CACrB,aACF,CACA,mBACE,aACF","file":"app.fde1d72a41cfe542fdc25bf9468dc689.css","sourcesContent":["\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 margin-top: 60px;\n}\n\n.but {\n font-size: .14rem;\n color: #3c8dbc\n}\n\nh1[data-v-5e05269b], h2[data-v-5e05269b] {\n font-weight: normal;\n}\nul[data-v-5e05269b] {\n list-style-type: none;\n padding: 0;\n}\nli[data-v-5e05269b] {\n display: inline-block;\n margin: 0 10px;\n}\na[data-v-5e05269b] {\n color: #42b983;\n}\n"]}
\ No newline at end of file
{"version":3,"sources":["webpack:///webpack/bootstrap 61ad56427365896ea26c"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,IAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.2ae2e69a05c33dfc65f8.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 61ad56427365896ea26c"],"sourceRoot":""}
\ No newline at end of file
{"version":3,"sources":["webpack:///webpack/bootstrap 997915f792467084e3dd"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,IAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.2ae2e69a05c33dfc65f8.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 997915f792467084e3dd"],"sourceRoot":""}
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>stusystem</title><link href=/static/css/app.f13280f6b4e2ea5fe8a53b3ce3b3b269.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.2ae2e69a05c33dfc65f8.js></script><script type=text/javascript src=/static/js/vendor.00d360f7b37e02379b40.js></script><script type=text/javascript src=/static/js/app.a93998411abe95e1e7d4.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>stusystem</title><link href=/static/css/app.fde1d72a41cfe542fdc25bf9468dc689.css rel=stylesheet></head><body><div id=index><div>这是首页</div><el-form :model=addAndEditFormData :rules=addAndEditRules class=form><el-form-item prop=account label=账号: :label-width=formLabelWidth><el-input v-model=addAndEditFormData.account placeholder=请输入账号 style=width:80%></el-input></el-form-item><el-form-item prop=password label=密码: :label-width=formLabelWidth><el-input v-model=addAndEditFormData.password placeholder=请输入密码 style=width:80%></el-input></el-form-item><el-form-item prop=verification label=验证码: :label-width=formLabelWidth><el-input v-model=addAndEditFormData.verification placeholder=请输入验证码 style=width:40%></el-input><img id=img @click=getVerification :src=imgSrc alt=验证码 title=点击更换验证码></el-form-item></el-form><div slot=footer class=dialog-footer><el-button type=primary @click=handleConfirmEvent><i class=el-icon-upload></i> 登 录</el-button></div><div><span>还没有账号? <a href=/register>去注册</a></span></div></div><script>export default {
name: 'index',
data() {
return {
addAndEditFormData: {
account: '',
password: '',
verification: ''
},
imgSrc: '/getVerify',
message: '',
addAndEditRules: {
account: {
required: true, message: '账号不能为空', trigger: 'blur'
},
password: {
required: true, message: '密码不能为空', trigger: 'blur'
},
verification: {
required: true, message: '验证码不能为空', trigger: 'blur'
},
},
// 样式数据
formLabelWidth: '120px',
}
},
created() {
},
methods: {
getVerification() {
let number = Math.ceil(Math.random() * 10);
this.imgSrc = '/getVerify?' + number;
},
handleConfirmEvent() {
let params = {
"account": this.addAndEditFormData.account,
"password": this.addAndEditFormData.password,
"verification": this.addAndEditFormData.verification
};
this.$api.post('/login', params).then(e => {
this.message = e.data.msg;
if (e.data.code === 200) {
this.$notify({
title: '成功',
message: this.message,
showClose: false,
type: 'success'
});
// 登录成功后跳转页面,1、请求后端返回页面;2、前端路由转发
} else {
this.$notify({
title: '失败',
message: this.message,
showClose: false,
type: 'warning'
});
}
});
},
}
}</script><style>.but {
font-size: .14rem;
color: #3c8dbc
}</style><script type=text/javascript src=/static/js/manifest.2ae2e69a05c33dfc65f8.js></script><script type=text/javascript src=/static/js/vendor.61413fb50f5ee89627d6.js></script><script type=text/javascript src=/static/js/app.7e50e2ca9a78da328da2.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>stusystem</title>
</head>
<body>
<div id="index">
<el-form :model="addAndEditFormData" :rules="addAndEditRules" class="form">
<el-form-item prop="account" label="账号:" :label-width="formLabelWidth">
<el-input v-model="addAndEditFormData.account" placeholder="请输入账号" style="width:80%"></el-input>
</el-form-item>
<el-form-item prop="password" label="密码:" :label-width="formLabelWidth">
<el-input v-model="addAndEditFormData.password" placeholder="请输入密码" style="width:80%"></el-input>
</el-form-item>
<el-form-item prop="verification" label="验证码:" :label-width="formLabelWidth">
<el-input v-model="addAndEditFormData.verification" placeholder="请输入验证码" style="width:40%"></el-input>
<img id="img" @click="getVerification" :src="imgSrc" alt="验证码" title="点击更换验证码"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleConfirmEvent"><i class="el-icon-upload"></i> 登 录</el-button>
</div>
<div>
<span>还没有账号? <a href="/register">去注册</a></span>
</div>
</div>
<script>
export default {
name: 'index',
data() {
return {
addAndEditFormData: {
account: '',
password: '',
verification: ''
},
imgSrc: '/getVerify',
message: '',
addAndEditRules: {
account: {
required: true, message: '账号不能为空', trigger: 'blur'
},
password: {
required: true, message: '密码不能为空', trigger: 'blur'
},
verification: {
required: true, message: '验证码不能为空', trigger: 'blur'
},
},
// 样式数据
formLabelWidth: '120px',
}
},
created() {
},
methods: {
getVerification() {
let number = Math.ceil(Math.random() * 10);
this.imgSrc = '/getVerify?' + number;
},
handleConfirmEvent() {
let params = {
"account": this.addAndEditFormData.account,
"password": this.addAndEditFormData.password,
"verification": this.addAndEditFormData.verification
};
this.$api.post('/login', params).then(e => {
this.message = e.data.msg;
if (e.data.code === 200) {
this.$notify({
title: '成功',
message: this.message,
showClose: false,
type: 'success'
});
// 登录成功后跳转页面,1、请求后端返回页面;2、前端路由转发
} else {
this.$notify({
title: '失败',
message: this.message,
showClose: false,
type: 'warning'
});
}
});
},
}
}
</script>
<style>
.but {
font-size: .14rem;
color: #3c8dbc
}
</style>
</body>
</html>
let http = this.$axios.create({
baseURL: 'http://localhost:2020',
withCredentials: true,
headers: {
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8'
},
transformRequest: [function (data) {
let newData = '';
for (let k in data) {
if (data.hasOwnProperty(k) === true) {
newData += encodeURIComponent(k) + '=' + encodeURIComponent(data[k]) + '&';
}
}
return newData;
}]
});
function apiAxios(method, url, params, response) {
http({
method: method,
url: url,
data: method === 'POST' || method === 'PUT' ? params : null,
params: method === 'GET' || method === 'DELETE' ? params : null,
}).then(function (res) {
response(res);
}).catch(function (err) {
response(err);
})
}
export default {
get: function (url, params, response) {
return apiAxios('GET', url, params, response)
},
post: function (url, params, response) {
return apiAxios('POST', url, params, response)
},
put: function (url, params, response) {
return apiAxios('PUT', url, params, response)
},
delete: function (url, params, response) {
return apiAxios('DELETE', url, params, response)
}
}
<template>
<div class="stusystem">
<h1>{{ msg }}</h1>
<h2>Essential Links</h2>
<ul>
<li>
<a
href="https://vuejs.org"
target="_blank"
>
Core Docs
</a>
</li>
<li>
<a
href="https://forum.vuejs.org"
target="_blank"
>
Forum
</a>
</li>
<li>
<a
href="https://chat.vuejs.org"
target="_blank"
>
Community Chat
</a>
</li>
<li>
<a
href="https://twitter.com/vuejs"
target="_blank"
>
Twitter
</a>
</li>
<br>
<li>
<a
href="http://vuejs-templates.github.io/webpack/"
target="_blank"
>
Docs for This Template
</a>
</li>
</ul>
<h2>Ecosystem</h2>
<ul>
<li>
<a
href="http://router.vuejs.org/"
target="_blank"
>
vue-router
</a>
</li>
<li>
<a
href="http://vuex.vuejs.org/"
target="_blank"
>
vuex
</a>
</li>
<li>
<a
href="http://vue-loader.vuejs.org/"
target="_blank"
>
vue-loader
</a>
</li>
<li>
<a
href="https://github.com/vuejs/awesome-vue"
target="_blank"
>
awesome-vue
</a>
</li>
</ul>
</div>
</template>
<script>
export default {
name: 'stusystem',
data() {
return {
msg: 'Welcome to Your Vue.js App'
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
font-weight: normal;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
# stusystem
> Dormitory management system
> stusystem
## Build Setup
......
......@@ -10,13 +10,11 @@ module.exports = {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {
},
proxyTable: {},
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
port: 8088, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
notifyOnErrors: true,
......@@ -40,12 +38,12 @@ module.exports = {
build: {
// Template for index.html
index: path.resolve(__dirname, '../../templates/index.html'),
index: path.resolve(__dirname, '../dist/index.html'),
// Paths
assetsRoot: path.resolve(__dirname, '../../'),
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
assetsPublicPath: './',
/**
* Source Maps
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>stusystem</title>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
......@@ -263,6 +263,14 @@
"integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==",
"dev": true
},
"async-validator": {
"version": "1.8.5",
"resolved": "https://registry.npmjs.org/async-validator/-/async-validator-1.8.5.tgz",
"integrity": "sha512-tXBM+1m056MAX0E8TL2iCjg8WvSyXu0Zc8LNtYqrVeyoL3+esHRZ4SieE9fKQyyU09uONjnMEjrNBMqT0mbvmA==",
"requires": {
"babel-runtime": "6.x"
}
},
"atob": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz",
......@@ -287,6 +295,7 @@
"version": "0.21.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
"dev": true,
"requires": {
"follow-redirects": "^1.10.0"
}
......@@ -541,8 +550,7 @@
"babel-helper-vue-jsx-merge-props": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz",
"integrity": "sha512-gsLiKK7Qrb7zYJNgiXKpXblxbV5ffSwR0f5whkPAaBAR4fhi6bwRZxX9wBlIc5M/v8CCkXUbXZL4N/nSE97cqg==",
"dev": true
"integrity": "sha512-gsLiKK7Qrb7zYJNgiXKpXblxbV5ffSwR0f5whkPAaBAR4fhi6bwRZxX9wBlIc5M/v8CCkXUbXZL4N/nSE97cqg=="
},
"babel-helpers": {
"version": "6.24.1",
......@@ -1070,7 +1078,6 @@
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
"integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
"dev": true,
"requires": {
"core-js": "^2.4.0",
"regenerator-runtime": "^0.11.0"
......@@ -1255,6 +1262,14 @@
"qs": "6.7.0",
"raw-body": "2.4.0",
"type-is": "~1.6.17"
},
"dependencies": {
"qs": {
"version": "6.7.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz",
"integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==",
"dev": true
}
}
},
"bonjour": {
......@@ -1585,15 +1600,15 @@
}
},
"caniuse-db": {
"version": "1.0.30001194",
"resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30001194.tgz",
"integrity": "sha512-YQskM5rdjJ+4/ouwy+02ee+OW66AViYFXsUN9I9DMK90rEyEYNMiHNLpdeC8VZu/SsZL37g+O83NtQugklmg6w==",
"version": "1.0.30001196",
"resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30001196.tgz",
"integrity": "sha512-8CvYgkTu2XlHUIs6GzrefQ9rqvthyvAquLiU4nfprGqE+UCm3srBYtq1qNW/toOMmQ7qpOV24HYOaDt/5QTtNQ==",
"dev": true
},
"caniuse-lite": {
"version": "1.0.30001194",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001194.tgz",
"integrity": "sha512-iDUOH+oFeBYk5XawYsPtsx/8fFpndAPUQJC7gBTfxHM8xw5nOZv7ceAD4frS1MKCLUac7QL5wdAJiFQlDRjXlA==",
"version": "1.0.30001196",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001196.tgz",
"integrity": "sha512-CPvObjD3ovWrNBaXlAIGWmg2gQQuJ5YhuciUOjPRox6hIQttu8O+b51dx6VIpIY9ESd2d0Vac1RKpICdG4rGUg==",
"dev": true
},
"center-align": {
......@@ -1976,15 +1991,6 @@
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=",
"dev": true
},
"copy-anything": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/copy-anything/-/copy-anything-2.0.3.tgz",
"integrity": "sha512-GK6QUtisv4fNS+XcI7shX0Gx9ORg7QqIznyfho79JTnX1XhLiyZHfftvGiziqzRiEi/Bjhgpi+D2o7HxJFPnDQ==",
"dev": true,
"requires": {
"is-what": "^3.12.0"
}
},
"copy-concurrently": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz",
......@@ -2024,8 +2030,7 @@
"core-js": {
"version": "2.6.12",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz",
"integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==",
"dev": true
"integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ=="
},
"core-util-is": {
"version": "1.0.2",
......@@ -3117,6 +3122,11 @@
"regexp.prototype.flags": "^1.2.0"
}
},
"deepmerge": {
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-1.5.2.tgz",
"integrity": "sha512-95k0GDqvBjZavkuvzx/YqVLv/6YYa17fz6ILMSf7neqQITCPbnfEnQvEgMPNjH4kgobe7+WIL0yJEHku+H3qtQ=="
},
"define-properties": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
......@@ -3404,11 +3414,24 @@
"dev": true
},
"electron-to-chromium": {
"version": "1.3.680",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.680.tgz",
"integrity": "sha512-XBACJT9RdpdWtoMXQPR8Be3ZtmizWWbxfw8cY2b5feUwiDO3FUl8qo4W2jXoq/WnnA3xBRqafu1XbpczqyUvlA==",
"version": "1.3.681",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.681.tgz",
"integrity": "sha512-W6uYvSUTHuyX2DZklIESAqx57jfmGjUkd7Z3RWqLdj9Mmt39ylhBuvFXlskQnvBHj0MYXIeQI+mjiwVddZLSvA==",
"dev": true
},
"element-ui": {
"version": "2.15.1",
"resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.15.1.tgz",
"integrity": "sha512-TqlScAKGH97XndSScUDeEHIzL1x7yg7DvQdKPEOUdiDcyIz3y3FJJBlpHYaJT96FOn1xpIcUZb+I2FJeU9EcrQ==",
"requires": {
"async-validator": "~1.8.1",
"babel-helper-vue-jsx-merge-props": "^2.0.0",
"deepmerge": "^1.2.0",
"normalize-wheel": "^1.0.1",
"resize-observer-polyfill": "^1.5.0",
"throttle-debounce": "^1.0.1"
}
},
"elliptic": {
"version": "6.5.4",
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz",
......@@ -3814,6 +3837,14 @@
"type-is": "~1.6.18",
"utils-merge": "1.0.1",
"vary": "~1.1.2"
},
"dependencies": {
"qs": {
"version": "6.7.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz",
"integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==",
"dev": true
}
}
},
"ext": {
......@@ -4080,7 +4111,8 @@
"follow-redirects": {
"version": "1.13.3",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.3.tgz",
"integrity": "sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA=="
"integrity": "sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA==",
"dev": true
},
"for-in": {
"version": "1.0.2",
......@@ -4696,13 +4728,6 @@
"integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==",
"dev": true
},
"image-size": {
"version": "0.5.5",
"resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz",
"integrity": "sha1-Cd/Uq50g4p6xw+gLiZA3jfnjy5w=",
"dev": true,
"optional": true
},
"import-cwd": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-2.1.0.tgz",
......@@ -5099,12 +5124,6 @@
"integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=",
"dev": true
},
"is-what": {
"version": "3.14.1",
"resolved": "https://registry.npmjs.org/is-what/-/is-what-3.14.1.tgz",
"integrity": "sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA==",
"dev": true
},
"is-windows": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz",
......@@ -5208,12 +5227,6 @@
"is-buffer": "^1.1.5"
}
},
"klona": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/klona/-/klona-2.0.4.tgz",
"integrity": "sha512-ZRbnvdg/NxqzC7L9Uyqzf4psi1OM4Cuc+sJAkQPjO6XkQIJTNbfK2Rsmbw8fx1p2mkZdp2FZYo2+LwXYY/uwIA==",
"dev": true
},
"last-call-webpack-plugin": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/last-call-webpack-plugin/-/last-call-webpack-plugin-2.1.2.tgz",
......@@ -5239,53 +5252,6 @@
"invert-kv": "^1.0.0"
}
},
"less": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/less/-/less-4.1.1.tgz",
"integrity": "sha512-w09o8tZFPThBscl5d0Ggp3RcrKIouBoQscnOMgFH3n5V3kN/CXGHNfCkRPtxJk6nKryDXaV9aHLK55RXuH4sAw==",
"dev": true,
"requires": {
"copy-anything": "^2.0.1",
"errno": "^0.1.1",
"graceful-fs": "^4.1.2",
"image-size": "~0.5.0",
"make-dir": "^2.1.0",
"mime": "^1.4.1",
"needle": "^2.5.2",
"parse-node-version": "^1.0.1",
"source-map": "~0.6.0",
"tslib": "^1.10.0"
},
"dependencies": {
"make-dir": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
"integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==",
"dev": true,
"optional": true,
"requires": {
"pify": "^4.0.1",
"semver": "^5.6.0"
}
},
"pify": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
"integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
"dev": true,
"optional": true
}
}
},
"less-loader": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/less-loader/-/less-loader-8.0.0.tgz",
"integrity": "sha512-tnDs0ZdwPZgNOg0NGJ0sAD2KViG9TvOMDVibT33fH1bpLkT4xMo5Ue2FsbjFsVsUKtuRTlU0tYp2/lRizrycLg==",
"dev": true,
"requires": {
"klona": "^2.0.4"
}
},
"load-json-file": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz",
......@@ -5925,37 +5891,6 @@
}
}
},
"needle": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/needle/-/needle-2.6.0.tgz",
"integrity": "sha512-KKYdza4heMsEfSWD7VPUIz3zX2XDwOyX2d+geb4vrERZMT5RMU6ujjaD+I5Yr54uZxQ2w6XRTAhHBbSCyovZBg==",
"dev": true,
"optional": true,
"requires": {
"debug": "^3.2.6",
"iconv-lite": "^0.4.4",
"sax": "^1.2.4"
},
"dependencies": {
"debug": {
"version": "3.2.7",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
"dev": true,
"optional": true,
"requires": {
"ms": "^2.1.1"
}
},
"ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
"dev": true,
"optional": true
}
}
},
"negotiator": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
......@@ -6083,6 +6018,11 @@
"sort-keys": "^1.0.0"
}
},
"normalize-wheel": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/normalize-wheel/-/normalize-wheel-1.0.1.tgz",
"integrity": "sha1-rsiGr/2wRQcNhWRH32Ls+GFG7EU="
},
"npm-run-path": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
......@@ -6449,12 +6389,6 @@
"json-parse-better-errors": "^1.0.1"
}
},
"parse-node-version": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz",
"integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==",
"dev": true
},
"parseurl": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
......@@ -9025,10 +8959,9 @@
"dev": true
},
"qs": {
"version": "6.7.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz",
"integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==",
"dev": true
"version": "6.9.6",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.9.6.tgz",
"integrity": "sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ=="
},
"query-string": {
"version": "4.3.4",
......@@ -9231,8 +9164,7 @@
"regenerator-runtime": {
"version": "0.11.1",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
"integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==",
"dev": true
"integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg=="
},
"regenerator-transform": {
"version": "0.10.1",
......@@ -9369,6 +9301,11 @@
"integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=",
"dev": true
},
"resize-observer-polyfill": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz",
"integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg=="
},
"resolve": {
"version": "1.20.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz",
......@@ -10307,6 +10244,11 @@
"integrity": "sha512-2wsvQ+4GwBvLPLWsNfLCDYGsW6xb7aeC6utq2Qh0PFwgEy7K7dsma9Jsmb2zSQj7GvYAyUGSntLtsv++GmgL1A==",
"dev": true
},
"throttle-debounce": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/throttle-debounce/-/throttle-debounce-1.1.0.tgz",
"integrity": "sha512-XH8UiPCQcWNuk2LYePibW/4qL97+ZQ1AN3FNXwZRBNPPowo/NRU5fAlDCSNBJIYCKbioZfuYtMhG4quqoJhVzg=="
},
"through2": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz",
......@@ -10417,12 +10359,6 @@
"integrity": "sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==",
"dev": true
},
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
},
"tty-browserify": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz",
......
{
"name": "stusystem",
"version": "1.0.0",
"description": "Dormitory management system",
"description": "stusystem",
"author": "cxt",
"private": true,
"scripts": {
......@@ -10,12 +10,14 @@
"build": "node build/build.js"
},
"dependencies": {
"axios": "^0.21.1",
"element-ui": "^2.15.1",
"qs": "^6.9.6",
"vue": "^2.5.2",
"vue-router": "^3.0.1"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"axios": "^0.21.1",
"babel-core": "^6.22.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-loader": "^7.1.1",
......@@ -31,8 +33,6 @@
"file-loader": "^1.1.4",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"less": "^4.1.1",
"less-loader": "^8.0.0",
"node-notifier": "^5.1.2",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
......
// axios 的简单封装
import axios from "axios";
import qs from "qs";
let baseURL = "http://127.0.0.1:2020";
export default {
post(url, data) {
return axios({method: "post", url: `${baseURL}${url}`, data: qs.stringify(data), timeout: 10000});
},
put(url, data) {
return axios({method: "put", url: `${baseURL}${url}`, data: qs.stringify(data), timeout: 10000});
},
delete(url, data) {
return axios({
method: "delete", url: `${baseURL}${url}`,
data: qs.stringify(data), timeout: 10000, headers: {"Content-Type": "application/x-www-form-urlencoded"}
});
},
get(url, params) {
return axios({
method: "get", url: `${baseURL}${url}`, params: params,
timeout: 10000
});
}
}
......@@ -16,7 +16,7 @@
<el-button type="primary" @click="handleConfirmEvent"><i class="el-icon-upload"></i> 登 录</el-button>
</div>
<div>
<span>还没有账号? <a href="/register">去注册</a></span>
<span>还没有账号? <router-link to="/register">去注册</router-link></span>
</div>
</div>
</template>
......@@ -62,23 +62,24 @@ export default {
"password": this.addAndEditFormData.password,
"verification": this.addAndEditFormData.verification
};
console.log(params);
this.$api.post('/login', params).then(e => {
this.message = e.data.msg;
if (e.data.code === 200) {
// this.$notify({
// title: '成功',
// message: this.message,
// showClose: false,
// type: 'success'
// });
this.$notify({
title: '成功',
message: this.message,
showClose: false,
type: 'success'
});
// 登录成功后跳转页面,1、请求后端返回页面;2、前端路由转发
} else {
// this.$notify({
// title: '失败',
// message: this.message,
// showClose: false,
// type: 'warning'
// });
this.$notify({
title: '失败',
message: this.message,
showClose: false,
type: 'warning'
});
}
});
},
......
<template>
<div id="register">
<h1>注册页面</h1>
<el-form :model="addAndEditFormData" :rules="addAndEditRules" class="form">
<el-form-item prop="account" label="账号:" :label-width="formLabelWidth">
<el-input v-model="addAndEditFormData.account" placeholder="请输入账号" style="width:80%"></el-input>
</el-form-item>
<el-form-item prop="password" label="密码:" :label-width="formLabelWidth">
<el-input v-model="addAndEditFormData.password" placeholder="请输入密码" style="width:80%"></el-input>
</el-form-item>
<el-form-item prop="verification" label="验证码:" :label-width="formLabelWidth">
<el-input v-model="addAndEditFormData.verification" placeholder="请输入验证码" style="width:40%"></el-input>
<img id="img" @click="getVerification" :src="imgSrc" alt="验证码" title="点击更换验证码"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleConfirmEvent"><i class="el-icon-upload"></i>注 册</el-button>
</div>
<div>
<span>已有账号? <router-link to="/">去登陆</router-link></span>
</div>
</div>
</template>
<script>
export default {
name: 'register',
data() {
return {
addAndEditFormData: {
account: '',
password: '',
verification: ''
},
imgSrc: '/getVerify',
message: '',
addAndEditRules: {
account: {
required: true, message: '账号不能为空', trigger: 'blur'
},
password: {
required: true, message: '密码不能为空', trigger: 'blur'
},
verification: {
required: true, message: '验证码不能为空', trigger: 'blur'
},
},
// 样式数据
formLabelWidth: '120px',
}
},
created() {
},
methods: {
getVerification() {
let number = Math.ceil(Math.random() * 10);
this.imgSrc = '/getVerify?' + number;
},
handleConfirmEvent() {
let params = {
"account": this.addAndEditFormData.account,
"password": this.addAndEditFormData.password,
"verification": this.addAndEditFormData.verification
};
this.$axios.post('/login', params).then(e => {
this.message = e.data.msg;
if (e.data.code === 200) {
this.$notify({
title: '成功',
message: this.message,
showClose: false,
type: 'success'
});
// 登录成功后跳转页面,1、请求后端返回页面;2、前端路由转发
} else {
this.$notify({
title: '失败',
message: this.message,
showClose: false,
type: 'warning'
});
}
});
},
}
}
</script>
<style>
.but {
font-size: .14rem;
color: #3c8dbc
}
</style>
......@@ -3,10 +3,12 @@
import Vue from 'vue'
import App from './App'
import router from './router'
import axios from 'axios'
import api from './api.js';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.prototype.$axios = axios
Vue.use(ElementUI);
Vue.prototype.$api = api;
Vue.config.productionTip = false
......@@ -18,3 +20,4 @@ new Vue({
components: { App },
template: '<App/>'
})
import Vue from 'vue'
import Router from 'vue-router'
import login from "@/components/login";
import stusystem from '../components/stusystem'
import login from '@/components/login'
import register from '@/components/register/register'
Vue.use(Router)
export default new Router({
routes: [
{
path: "/",
path: '/',
name: 'login',
component: login
},
{
path: '/111',
name: 'stusystem',
component: stusystem
path: '/register',
name: 'register',
component: register
}
]
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册