Commit ab664dc3 authored by 喻春霖's avatar 喻春霖

前端配置

parent 2530f35f
package com.chineseall.eden.authcenter.agent.controller;
import cn.sh.chineseall.framework.core.util.StringUtils;
import com.chineseall.eden.authcenter.agent.account.AdminUser;
import com.chineseall.eden.authcenter.agent.utils.JwtUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
......@@ -30,15 +28,15 @@ public class LoginController {
@PostMapping("login")
public String login(HttpServletRequest request, HttpServletResponse response, @RequestBody AdminUser loginInfo){
public String login(HttpServletRequest request, HttpServletResponse response, String account,String password){
if(loginInfo == null){
if(StringUtils.isEmpty(account) || StringUtils.isEmpty(password)){
return "/login/index";
}
if(Objects.equals(adminUser.getAccount(), loginInfo.getAccount()) && Objects.equals(adminUser.getPassword(), loginInfo.getPassword())){
if(Objects.equals(adminUser.getAccount(), account) && Objects.equals(adminUser.getPassword(), password)){
Map<String, Object> map = new HashMap<>();
map.put("account", loginInfo.getAccount());
map.put("password", loginInfo.getPassword());
map.put("account", account);
map.put("password", password);
Cookie cookie = new Cookie("sign", JwtUtils.createJWT(map));
cookie.setMaxAge(24 * 60 * 60);
cookie.setPath("/");
......
......@@ -178,4 +178,7 @@ oauthclient:
clientSecret: adaptive-learningSecret
admin-user:
account: ac_admin
password: AC_PWD_2022
......@@ -17,16 +17,16 @@
<meta content="" name="description" />
<meta content="width=device-width, initial-scale=1" name="viewport" />
<title>上海市中小学数字教材</title>
<link rel="stylesheet" href="../../static/css/main_0327.css" />
<link rel="stylesheet" href="../../static/css/statistics.css" />
<link rel="stylesheet" href="../../static/css/bootstrap.min.css" />
<link rel="stylesheet" href="../../static/css/normalize.css" />
<link rel="stylesheet" type="text/css" href="../../static/css/iview.css" />
<link rel="shortcut icon" href="../../static/img/favicon.ico">
<script type="text/javascript" src="../../static/js/jquery-1.10.2.min.js"></script>
<script src="../../static/js/echarts.min.js"></script>
<script src="../../static/js/vue.js"></script>
<script type="text/javascript" src="../../static/js/iview.min.js"></script>
<link rel="stylesheet" th:href="@{/static/css/main_0327.css}" />
<link rel="stylesheet" th:href="@{/static/css/statistics.css}" />
<link rel="stylesheet" th:href="@{/static/css/bootstrap.min.css}" />
<link rel="stylesheet" th:href="@{/static/css/normalize.css}" />
<link rel="stylesheet" type="text/css" th:href="@{/static/css/iview.css}" />
<link rel="shortcut icon" th:href="@{/static/img/favicon.ico}">
<script type="text/javascript" th:src="@{/static/js/jquery-1.10.2.min.js}"></script>
<script th:src="@{/static/js/echarts.min.js}"></script>
<script th:src="@{/static/js/vue.js}"></script>
<script type="text/javascript" th:src="@{/static/js/iview.min.js}"></script>
</head>
<body style="background-color: rgb(244, 245, 245);">
......@@ -39,12 +39,12 @@
<div id="app" class="static">
<div class="statistics-header">
<div class="flex" style="display: flex; align-items: center;">
<img src="../static/img/Rlogo.png" style="margin:5px 0; margin-left: 30px; width: 250px;" alt="">
<img th:src="@{/static/img/Rlogo.png}" style="margin:5px 0; margin-left: 30px; width: 250px;" alt="">
<Divider type="vertical" style="height: 26px;"></Divider>
<p style="font-size: 14px; font-weight: 700;">发现服务 · 速享之旅</p>
</div>
<div class="flex">
<img src="../static/img/top-title.png" style="height: 22px;" alt="">
<img th:src="@{/static/img/top-title.png}" style="height: 22px;" alt="">
</div>
<div class="flex" style="width: 33%;">
</div>
......
......@@ -39,13 +39,13 @@
<div class="form-group text-left" style="float: left">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1"><span aria-hidden="true" class="glyphicon glyphicon-user"></span></span>
<input aria-describedby="basic-addon1" autocomplete="off" class="form-control" id="username" placeholder="请输入管理员账号" size="25" tabindex="1" type="text" name="userName" value="" />
<input aria-describedby="basic-addon1" autocomplete="off" class="form-control" id="account" placeholder="请输入管理员账号" size="25" tabindex="1" type="text" name="account" value="" />
</div>
</div>
<div class="form-group text-left" style="float: left">
<div class="input-group">
<span class="input-group-addon " id="basic-addon2"> <span aria-hidden="true" class="glyphicon glyphicon-lock"></span></span>
<input aria-describedby="basic-addon1" autocomplete="off" class="form-control" id="password" placeholder="请输入管理员密码" size="25" tabindex="2" type="password" name="pwd" />
<input aria-describedby="basic-addon1" autocomplete="off" class="form-control" id="password" placeholder="请输入管理员密码" size="25" tabindex="2" type="password" name="password" />
</div>
</div>
<button accesskey="l" class="btn btn-primary btn-block" id="login-button" style="outline: 0" tabindex="6" type="button" onclick="toLogin()">登录
......
......@@ -172,7 +172,7 @@
</script>
<script type="text/javascript">
var baseUrl = "https://ds-test.etextbook.cn/authcenter";
var baseUrl = "/";
var colorList = [
'#6c5df1', '#a78bf4', '#fdbf3c', '#ec6367', '#2fcaa8', '#79c161'
......
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