authorization

master
bseayin 2019-09-13 20:20:17 +08:00
parent a341faaebb
commit 1af21275e0
8 changed files with 396 additions and 0 deletions

View File

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>SpringBoot2</artifactId>
<groupId>zz</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>SpringBootAngularjs</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
<scope>true</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.15</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,190 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script src="assets/plugins/jquery/jquery.min.js"></script>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Tell the browser to be responsive to screen width -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<!-- Favicon icon -->
<link rel="icon" type="image/png" sizes="16x16" href="assets/images/favicon.png">
<title>Home</title>
<!-- Bootstrap Core CSS -->
<link href="assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/style.css" rel="stylesheet">
<!-- You can change the theme colors from here -->
<link href="css/colors/blue.css" id="theme" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script src="https://cdn.staticfile.org/angular.js/1.7.0/angular.min.js"></script>
<script src="https://cdn.staticfile.org/angular.js/1.7.0/angular-route.min.js"></script>
</head>
<body class="fix-header fix-sidebar card-no-border">
<!-- ============================================================== -->
<!-- Preloader - style you can find in spinners.css -->
<!-- ============================================================== -->
<div class="preloader">
<svg class="circular" viewBox="25 25 50 50">
<circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="2" stroke-miterlimit="10"/>
</svg>
</div>
<!-- ============================================================== -->
<!-- Main wrapper - style you can find in pages.scss -->
<!-- ============================================================== -->
<div id="main-wrapper" ng-app="indexapp" >
<!-- ============================================================== -->
<!-- Topbar header - style you can find in pages.scss -->
<!-- ============================================================== -->
<header class="topbar">
<nav class="navbar top-navbar navbar-toggleable-sm navbar-light">
<!-- ============================================================== -->
<!-- Logo -->
<!-- ============================================================== -->
<div class="navbar-header">
<a class="navbar-brand" href="index.html">
<!-- Logo icon -->
<b>
<!--You can put here icon as well // <i class="wi wi-sunset"></i> //-->
<!-- Dark Logo icon -->
<img src="assets/images/logo-icon.png" alt="homepage" class="dark-logo"/>
</b>
<!--End Logo icon -->
<!-- Logo text -->
<span>
<!-- dark Logo text -->
<img src="assets/images/logo-text.png" alt="homepage" class="dark-logo"/>
</span>
</a>
</div>
<!-- ============================================================== -->
<!-- End Logo -->
<!-- ============================================================== -->
<div class="navbar-collapse">
<!-- ============================================================== -->
<!-- toggle and nav items -->
<!-- ============================================================== -->
<ul class="navbar-nav mr-auto mt-md-0 ">
<!-- This is -->
<li class="nav-item"><a class="nav-link nav-toggler hidden-md-up text-muted waves-effect waves-dark"
href="javascript:void(0)"><i class="ti-menu"></i></a></li>
<li class="nav-item hidden-sm-down">
<form class="app-search p-l-20">
<input type="text" class="form-control" placeholder="Search for..."> <a class="srh-btn"><i
class="ti-search"></i></a>
</form>
</li>
</ul>
<!-- ============================================================== -->
<!-- User profile and search -->
<!-- ============================================================== -->
<ul class="navbar-nav my-lg-0">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle text-muted waves-effect waves-dark" href=""
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" id="username"></a>
<a href="login.html" class="btn btn-danger">登出</a>
</li>
</ul>
</div>
</nav>
</header>
<!-- ============================================================== -->
<!-- End Topbar header -->
<!-- ============================================================== -->
<!-- ============================================================== -->
<!-- Left Sidebar - style you can find in sidebar.scss -->
<!-- ============================================================== -->
<aside class="left-sidebar">
<!-- Sidebar scroll-->
<div class="scroll-sidebar">
<!-- Sidebar navigation-->
<nav class="sidebar-nav">
<ul id="sidebarnav">
<li>
<a href="#!/js" class="waves-effect"><i class="fa fa-clock-o m-r-10"
aria-hidden="true"></i>今日竞赛</a>
</li>
<li>
<a href="#!/jd" class="waves-effect"><i class="fa fa-clock-o m-r-10"
aria-hidden="true"></i>今日结对</a>
</li>
<li>
<a href="#!/bzzy" class="waves-effect" id="index3"><i class="fa fa-clock-o m-r-10"
aria-hidden="true"></i>布置作业</a>
</li>
<li>
<a href="#!/ckzy" class="waves-effect"><i class="fa fa-clock-o m-r-10"
aria-hidden="true"></i>查看作业</a>
</li>
<li>
<a href="#!/zypm" class="waves-effect"><i class="fa fa-clock-o m-r-10"
aria-hidden="true"></i>作业排名</a>
</li>
</ul>
</nav>
<!-- End Sidebar navigation -->
</div>
<!-- End Sidebar scroll-->
</aside>
<!-- ============================================================== -->
<!-- End Left Sidebar - style you can find in sidebar.scss -->
<!-- ============================================================== -->
<!-- ============================================================== -->
<!-- Page wrapper -->
<!-- ============================================================== -->
<div class="page-wrapper">
<!-- ============================================================== -->
<!-- Container fluid -->
<!-- ============================================================== -->
<div class="container-fluid">
<div ng-view></div>
</div>
</div>
</div>
<!-- ============================================================== -->
<!-- End Wrapper -->
<!-- ============================================================== -->
<!-- ============================================================== -->
<!-- All Jquery -->
<!-- ============================================================== -->
<!-- Bootstrap tether Core JavaScript -->
<script src="assets/plugins/bootstrap/js/tether.min.js"></script>
<script src="assets/plugins/bootstrap/js/bootstrap.min.js"></script>
<!-- slimscrollbar scrollbar JavaScript -->
<script src="js/jquery.slimscroll.js"></script>
<!--Wave Effects -->
<script src="js/waves.js"></script>
<!--Menu sidebar -->
<script src="js/sidebarmenu.js"></script>
<!--stickey kit -->
<script src="assets/plugins/sticky-kit-master/dist/sticky-kit.min.js"></script>
<!--Custom JavaScript -->
<script src="js/custom.min.js"></script>
<!-- ============================================================== -->
<!-- This page plugins -->
<!-- ============================================================== -->
<!-- Flot Charts JavaScript -->
<script src="assets/plugins/flot/jquery.flot.js"></script>
<script src="assets/plugins/flot.tooltip/js/jquery.flot.tooltip.min.js"></script>
<script src="js/flot-data.js"></script>
<!-- ============================================================== -->
<!-- Style switcher -->
<!-- ============================================================== -->
<script src="assets/plugins/styleswitcher/jQuery.style.switcher.js"></script>
<script src="js/index0.js"></script>
<script src="js/controller.js"></script>
</body>
</html>

View File

@ -0,0 +1,38 @@
<!-- ============================================================== -->
<!-- Bread crumb and right sidebar toggle -->
<!-- ============================================================== -->
<div class="row page-titles">
<div class="col-md-6 col-8 align-self-center">
<h3 class="text-themecolor m-b-0 m-t-0">今日竞赛</h3>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="javascript:void(0)">Home</a></li>
<li class="breadcrumb-item active">今日竞赛</li>
</ol>
</div>
</div>
<h1 class="bd-lead">竞赛是每个人单独完成作业</h1>
<main class="col-12 col-md-9 col-xl-9 py-md-9 pl-md-9 bd-content" role="main">
<div id="hw">
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<th>#</th>
<th>标题</th>
<th>内容</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="x in rs">
<td>1</td>
<td>{{x.title}}</td>
<td>Anna</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>竞赛作业需要在中午12点前提交</p>
</main>

View File

@ -0,0 +1,5 @@
app.controller('indexocontroller',
function ($scope) {
$scope.rs=[{title:'标题1',detail:'kpsdf'},{title:'标题15675fghf',detail:'kpsdf'}]
})

View File

@ -0,0 +1,14 @@
var app = angular.module('indexapp',['ngRoute']);
app.config(['$routeProvider', function($routeProvider){
$routeProvider
.when('/js',{templateUrl:'index01.html',
controller: 'indexocontroller'})
.when('/jd',{template:'这是电脑分类页面'})
.when('/bzzy',{template:'这是打印的机页面'})
.when('/ckzy',{template:'这是打印55机页面'})
.when('/zypm',{template:'这是打印问我机页面'})
.otherwise({redirectTo:'/js'});
}]);

View File

@ -0,0 +1,36 @@
var app = angular.module('loginapp', []);
app.controller('loginctr', function($scope, $http,$location) {
$scope.tologin = function() {
var adata = {
"username": $scope.username,
"password":$scope.pwd
}
var requestData = JSON.stringify(adata);
console.log("***********")
console.log($scope.username)
console.log(adata)
console.log(requestData)
$http({
method: 'POST',
url: 'login',
data: requestData
}).then(function successCallback(response) {
console.log(response)
if (response != null) {
window.location.href = "angularindex.html";
}
}, function errorCallback(response) {
// 请求失败执行代码
});
};
});

View File

@ -0,0 +1,42 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Bootstrap 实例 - 基本的表格</title>
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdn.staticfile.org/angular.js/1.7.0/angular.min.js"></script>
</head>
<body ng-app="myapp" ng-controller="myctr">
<table class="table">
<caption>基本的表格布局</caption>
<thead>
<tr>
<th>名称</th>
<th>年龄</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="t in res">
<td>{{t.name}}</td>
<td>{{t.age}}</td>
</tr>
</tbody>
</table>
<script>
var app = angular.module('myapp', []);
app.controller('myctr', function($scope, $location) {
$scope.res=[
{name:"展示",age:23},
{name:"展示2",age:123},
{name:"展示",age:623}
]
});
</script>
</body>
</html>

View File

@ -26,6 +26,7 @@
<module>SpringBootException</module>
<module>SpringBootMybatis</module>
<module>SpringBootShiroJWT</module>
<module>SpringBootAngularjs</module>
</modules>
<repositories>