Skip to content

Commit

Permalink
pref: first comit
Browse files Browse the repository at this point in the history
  • Loading branch information
paterleng committed Dec 6, 2024
1 parent f3b6600 commit e88d872
Show file tree
Hide file tree
Showing 58 changed files with 1,242 additions and 290 deletions.
224 changes: 224 additions & 0 deletions activity.log

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion api/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func ApiRoute(r *gin.Engine) {
// 用户信息
user.GET("/userinfo", GetApiManager().GetUserInfo)
// 修改用户信息
user.PUT("/put/userinfo")
user.PUT("/put/userinfo", GetApiManager().PutUserInfo)
// 充值信息
user.POST("/recharge", GetApiManager().Recharge)
}
Expand Down
Binary file removed checkerboard/dist.zip
Binary file not shown.
64 changes: 64 additions & 0 deletions checkerboard/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions checkerboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@
"antd": "^5.22.1",
"axios": "^1.7.7",
"ethers": "^5.7.2",
"i18next": "^23.11.5",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-i18next": "^15.1.3",
"react-infinite-scroll-component": "^6.1.0",
"react-router-dom": "^6.28.0",
"react-window": "^1.8.10",
Expand Down
Binary file added checkerboard/public/images/avatar/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added checkerboard/public/images/avatar/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added checkerboard/public/images/avatar/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added checkerboard/public/images/avatar/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added checkerboard/public/images/avatar/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added checkerboard/public/images/avatar/6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added checkerboard/public/images/avatar/7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added checkerboard/public/images/avatar/8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 6 additions & 10 deletions checkerboard/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@

import { createContext, useContext, useState } from 'react';
import { BrowserRouter as Router, Routes, Route, Navigate } from 'react-router-dom';
import Expand from './pages/Expand';
import Expand from './pages/home/Expand';
import ChessBoard from './components/chessboard/ChessBoard';
import RegisterForm from './pages/RegisterForm';
import LoginForm from './pages/login/LoginForm'
import ConnectWallet from './components/web3wallet/Wallet';
import LoginForm from './pages/login/LoginForm';
import Rule from './components/Rule';


// 创建 AuthContext 用于管理用户登录状态
Expand All @@ -16,18 +15,15 @@ function App() {
const [isLoggedIn, setIsLoggedIn] = useState(false);

return (
<>
{/* <div>
<ConnectWallet />
</div> */}

<>
<AuthContext.Provider value={{ isLoggedIn, setIsLoggedIn }}>
<Router>
<Routes>
<Route path='/' element={<Expand />}></Route>
<Route path="/newpage" element={<ChessBoard />} />
<Route path="/board/:id" element={<ChessBoard />} />
<Route path="/login" element={<LoginForm loginIn={isLoggedIn} />} />
<Route path="/register" element={<RegisterForm />} />
<Route path='/rule' element={<Rule />}></Route>
<Route
path="/"
element={
Expand Down
2 changes: 2 additions & 0 deletions checkerboard/src/apis/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const instance = axios.create({
},
});

// 请求拦截器
instance.interceptors.request.use(
(config) => {
const token = localStorage.getItem('atoken');
Expand All @@ -23,6 +24,7 @@ instance.interceptors.request.use(
}
);

// 响应拦截器
instance.interceptors.response.use(
(response) => {
if (response.data.code == 200 ) {
Expand Down
6 changes: 4 additions & 2 deletions checkerboard/src/apis/manage.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import instance from './api';

// 登录
export const loginUser = (loginData) => instance.post('user/login', loginData);
export const loginUser = (loginData) => instance.post('login', loginData);
// 用户信息
export const UserMessage = () => instance.get('user/userinfo')
// 棋盘信息
Expand All @@ -11,4 +11,6 @@ export const Board = (board_id) => instance.get(`checkboard/board?boardId=${boar
// 押注记录
export const Record = (page,size) => instance.get(`checkboard/record?page=${page}&size=${size}`)
// 获取所有记录的前50条
export const Records = () => instance.get('checkboard/records')
export const Records = () => instance.get('checkboard/records')
// 修改用户信息
export const UpdateUserInfo = (param) => instance.put('user/put/userinfo',param)
41 changes: 10 additions & 31 deletions checkerboard/src/components/Rule.jsx
Original file line number Diff line number Diff line change
@@ -1,37 +1,16 @@
import React, { useState } from 'react';
import { Button, Modal } from 'antd';
const Rule = () => {
const [open, setOpen] = useState(false);
const showModal = () => {
setOpen(true);
};
const hideModal = () => {
setOpen(false);
};
return (
<>
<Button type="primary" onClick={showModal}>
规则
</Button>
<Modal
title="规则"
open={open}
onOk={hideModal}
onCancel={hideModal}
okText="确认"
cancelButtonProps={{ style: { display: 'none' } }}
>
<p>
git remote:查看当前连接的代码仓库,<br />
git clone:克隆一个git仓库<br />
git status:查看文件的状态<br />
git branch:创建一个分支,后面有分支名就创建,没有就查看本地分支,加上-r参数可以查看远程分支,-d参数可以删除分支<br />
git checkout 分支名:切换到该分支<br />
git merge 分支名:将任意分支合并到当前分支中<br />
git fetch:获取远程仓库新建分支<br />
git log 查看提交记录<br />
</p>
</Modal>
<p>
git remote:查看当前连接的代码仓库,<br />
git clone:克隆一个git仓库<br />
git status:查看文件的状态<br />
git branch:创建一个分支,后面有分支名就创建,没有就查看本地分支,加上-r参数可以查看远程分支,-d参数可以删除分支<br />
git checkout 分支名:切换到该分支<br />
git merge 分支名:将任意分支合并到当前分支中<br />
git fetch:获取远程仓库新建分支<br />
git log 查看提交记录<br />
</p>
</>
);
};
Expand Down
2 changes: 1 addition & 1 deletion checkerboard/src/components/TransactionRecord.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const TransactionRecord = () => {
return (
<>
<Button type="primary" onClick={showLoading}>
提交记录
个人战报
</Button>
<Modal
title={<p>交易记录</p>}
Expand Down
1 change: 1 addition & 0 deletions checkerboard/src/components/boardinfo/BoardInfo.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

29 changes: 23 additions & 6 deletions checkerboard/src/components/chessboard/ChessBoard.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@
}

.countdown-wrapper {
display: flex;
justify-content: space-between;
align-items: flex-end;
display: flex;
justify-content: space-between;
align-items: flex-start;
flex-direction: column;
}

.countdown-wrapper-son{
Expand Down Expand Up @@ -95,9 +96,9 @@
width: 39vw;
height: 33vw;
padding: 10px;
border: 2px solid #ddd;
border-radius: 8px;
background-color: #fafafa;
/* border: 2px solid #ddd; */
/* border-radius: 8px; */
/* background-color: #fafafa; */
}

.grid-box {
Expand Down Expand Up @@ -153,6 +154,22 @@
margin-top: 0;
}

.popupStyle {
position: fixed;
transform: translate(-50%, -50%);
width: 250px;
height: 400px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
border-radius: 6px;
background-color: white;
border: 1px solid black;
padding: 20px;
margin-left: 200px;
z-index: 1200;
}

;

@media (max-width: 50vw) {
.grid-container {
grid-template-columns: repeat(5, 1fr);
Expand Down
Loading

0 comments on commit e88d872

Please sign in to comment.