add game,home pages
This commit is contained in:
@@ -9,9 +9,11 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/js-cookie": "^2.2.6",
|
||||
"@types/socket.io-client": "^1.4.32",
|
||||
"axios": "^0.19.2",
|
||||
"core-js": "^3.6.4",
|
||||
"js-cookie": "^2.2.1",
|
||||
"socket.io-client": "^2.3.0",
|
||||
"vue": "^2.6.11",
|
||||
"vue-class-component": "^7.2.3",
|
||||
"vue-property-decorator": "^8.4.1",
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
+67
-29
@@ -1,29 +1,67 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<img alt="Vue logo" src="./assets/logo.png">
|
||||
<HelloWorld msg="Welcome to Your Vue.js + TypeScript App"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue } from 'vue-property-decorator';
|
||||
import HelloWorld from './components/HelloWorld.vue';
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
HelloWorld,
|
||||
},
|
||||
})
|
||||
export default class App extends Vue {}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
#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;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div id="app">
|
||||
<router-view/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Vue } from 'vue-property-decorator';
|
||||
|
||||
export default class App extends Vue {}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
#app {
|
||||
font-family: Avenir, Helvetica, Arial, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
text-align: center;
|
||||
color: #2c3e50;
|
||||
}
|
||||
*{
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
body{
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.container{
|
||||
margin-top: 30px;
|
||||
.input-bd{
|
||||
line-height: 30px;
|
||||
margin: 10px;
|
||||
.input-name{
|
||||
display: inline-block;
|
||||
width: 100px;
|
||||
text-align: right;
|
||||
}
|
||||
.input-text{
|
||||
display: inline-block;
|
||||
padding-left: 10px;
|
||||
input{
|
||||
height: 30px;
|
||||
width: 180px;
|
||||
padding:0 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.btn {
|
||||
margin-top: 15px;
|
||||
span{
|
||||
color: #fff;
|
||||
background-color: #6796ff;
|
||||
border-radius: 8px;
|
||||
padding: 5px 20px;
|
||||
display: inline-block;
|
||||
}
|
||||
b{
|
||||
display: inline-block;
|
||||
border: aliceblue;
|
||||
border-radius: 8px;
|
||||
padding: 5px 20px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
+1
-1
@@ -8,5 +8,5 @@ Vue.config.productionTip = false;
|
||||
new Vue({
|
||||
router,
|
||||
store,
|
||||
render: h => h(App),
|
||||
render: (h) => h(App),
|
||||
}).$mount('#app');
|
||||
|
||||
+37
-27
@@ -1,27 +1,37 @@
|
||||
import Vue from 'vue';
|
||||
import VueRouter, { RouteConfig } from 'vue-router';
|
||||
import Home from '../views/Home.vue';
|
||||
|
||||
Vue.use(VueRouter);
|
||||
|
||||
const routes: RouteConfig[] = [
|
||||
{
|
||||
path: '/',
|
||||
name: 'Home',
|
||||
component: Home,
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
name: 'login',
|
||||
// route level code-splitting
|
||||
// this generates a separate chunk (about.[hash].js) for this route
|
||||
// which is lazy-loaded when the route is visited.
|
||||
component: () => import('../views/login.vue'),
|
||||
},
|
||||
];
|
||||
|
||||
const router = new VueRouter({
|
||||
routes,
|
||||
});
|
||||
|
||||
export default router;
|
||||
import Vue from 'vue';
|
||||
import VueRouter, { RouteConfig } from 'vue-router';
|
||||
import Home from '../views/Home.vue';
|
||||
import Login from '../views/login.vue';
|
||||
import Register from '../views/register.vue';
|
||||
import Game from '../views/game.vue';
|
||||
|
||||
Vue.use(VueRouter);
|
||||
|
||||
const routes: RouteConfig[] = [
|
||||
{
|
||||
path: '/',
|
||||
name: 'home',
|
||||
component: Home,
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
name: 'login',
|
||||
component: Login,
|
||||
},
|
||||
{
|
||||
path: '/register',
|
||||
name: 'register',
|
||||
component: Register,
|
||||
},
|
||||
{
|
||||
path: '/game/:roomNumber',
|
||||
name: 'game',
|
||||
component: Game,
|
||||
},
|
||||
];
|
||||
|
||||
const router = new VueRouter({
|
||||
routes,
|
||||
});
|
||||
|
||||
export default router;
|
||||
|
||||
@@ -1,8 +1,20 @@
|
||||
import request from '../utils/request';
|
||||
|
||||
export default {
|
||||
register: (userName: string, password: string) => request({
|
||||
url: '',
|
||||
body: { userName, password },
|
||||
}),
|
||||
};
|
||||
import request from '../utils/request';
|
||||
|
||||
export default {
|
||||
register: (userName: string, password: string) => request({
|
||||
url: '/user/register',
|
||||
body: { userName, password },
|
||||
}),
|
||||
login: (userAccount: string, password: string) => request({
|
||||
url: '/user/login',
|
||||
body: { userAccount, password },
|
||||
}),
|
||||
createRoom: () => request({
|
||||
url: '/game/room',
|
||||
body: { },
|
||||
}),
|
||||
buyIn: (buyInSize: number) => request({
|
||||
url: '/game/buyIn',
|
||||
body: { buyInSize },
|
||||
}),
|
||||
};
|
||||
|
||||
+33
-26
@@ -1,26 +1,33 @@
|
||||
import axios, { AxiosRequestConfig, Method } from 'axios';
|
||||
import cookie from 'js-cookie';
|
||||
const request = async ({ method = 'post' as Method, url = '', body= {}, timeout = 8000 }) => {
|
||||
const origin = '';
|
||||
if (!url) {
|
||||
return Promise.reject('Request url is null!');
|
||||
}
|
||||
const token = cookie.get('game_token');
|
||||
const headers = {
|
||||
Authorization: `Bearer ${token}`,
|
||||
};
|
||||
url = `${origin}/${url}`;
|
||||
const option: AxiosRequestConfig = {
|
||||
url,
|
||||
method,
|
||||
timeout,
|
||||
withCredentials: true,
|
||||
headers,
|
||||
};
|
||||
try {
|
||||
return await axios(option);
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
};
|
||||
export default request;
|
||||
import axios, {AxiosRequestConfig, Method} from 'axios';
|
||||
import cookie from 'js-cookie';
|
||||
|
||||
const request = async ({method = 'post' as Method, url = '', body = {}, timeout = 8000}) => {
|
||||
const origin = 'http://127.0.0.1:7001/node';
|
||||
if (!url) {
|
||||
return Promise.reject('Request url is null!');
|
||||
}
|
||||
const token = cookie.get('token');
|
||||
const headers = {
|
||||
Authorization: `Bearer ${token}`,
|
||||
};
|
||||
url = `${origin}${url}`;
|
||||
const option: AxiosRequestConfig = {
|
||||
url,
|
||||
method,
|
||||
timeout,
|
||||
data: body,
|
||||
withCredentials: true,
|
||||
headers,
|
||||
};
|
||||
try {
|
||||
const result = await axios(option);
|
||||
if (result.data.code === '000000') {
|
||||
return result.data;
|
||||
} else {
|
||||
throw result.data;
|
||||
}
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
};
|
||||
export default request;
|
||||
|
||||
+49
-16
@@ -1,16 +1,49 @@
|
||||
<template>
|
||||
<div class="home">
|
||||
<div class="create-room" @creatRoom = 'createRoom'>create room</div>
|
||||
<div class="join room" @joinRoom = 'joinRoom'>join room</div>
|
||||
<div class="room number">room number: </div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue } from 'vue-property-decorator';
|
||||
export default class Login extends Vue {
|
||||
roomNumber: string = '';
|
||||
createRoom() {}
|
||||
joinRoom() {}
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class="home container">
|
||||
<div class="create-room"
|
||||
@click="createRoom">create room
|
||||
</div>
|
||||
<div class="join room"
|
||||
@click="joinRoom">join room
|
||||
</div>
|
||||
<div class="room number">room number:</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {Vue} from 'vue-property-decorator';
|
||||
import Component from 'vue-class-component';
|
||||
import service from '../service';
|
||||
|
||||
@Component
|
||||
export default class Home extends Vue {
|
||||
public roomNumber: string = '';
|
||||
|
||||
private async createRoom() {
|
||||
try {
|
||||
const result = await service.createRoom();
|
||||
const {roomNumber} = result.data;
|
||||
console.log(result);
|
||||
this.$router.replace({name: 'game', params: {roomNumber}});
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
private joinRoom() {
|
||||
console.log('');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less">
|
||||
.container{
|
||||
.create-room{
|
||||
padding: 10px;
|
||||
background-color: #6796ff;
|
||||
color: #fff;
|
||||
border-radius: 8px;
|
||||
width: 100px;
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
+119
-22
@@ -1,22 +1,119 @@
|
||||
<template>
|
||||
<div class="game-container">
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
methods : {},
|
||||
computed: {},
|
||||
mounted() {},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.game-container{
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div class="game-container">
|
||||
<div class="game-body">
|
||||
<div class="users">
|
||||
<span v-for="user in users"> {{user.nick_name}}: {{user.counter}}</span>
|
||||
</div>
|
||||
<div class="join">
|
||||
{{joinMsg}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="buy-in">
|
||||
<div class="input-bd">
|
||||
<div class="input-name">buy in:</div>
|
||||
<div class="input-text">
|
||||
<input type="text"
|
||||
v-model="buyInSize"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {Vue} from 'vue-property-decorator';
|
||||
import Component from 'vue-class-component';
|
||||
import io from 'socket.io-client';
|
||||
import cookie from 'js-cookie';
|
||||
import service from '../service';
|
||||
|
||||
interface IUser {
|
||||
counter: number;
|
||||
nick_name: string;
|
||||
}
|
||||
|
||||
interface IMsg {
|
||||
action: string;
|
||||
clients: string[];
|
||||
target: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
@Component
|
||||
export default class Game extends Vue {
|
||||
public socket: any = null;
|
||||
private users: IUser[] = [];
|
||||
private joinMsg = '';
|
||||
private buyInSize = 0;
|
||||
|
||||
get roomId() {
|
||||
return this.$route.params.roomNumber;
|
||||
}
|
||||
|
||||
private socketInit() {
|
||||
const token = cookie.get('token');
|
||||
const log = console.log;
|
||||
this.socket = io('http://127.0.0.1:7001/socket', {
|
||||
// 实际使用中可以在这里传递参数
|
||||
query: {
|
||||
room: this.roomId,
|
||||
token,
|
||||
},
|
||||
transports: ['websocket'],
|
||||
});
|
||||
this.socket.on('connect', () => {
|
||||
const id: string = this.socket.id;
|
||||
|
||||
log('#connect,', id, this.socket);
|
||||
|
||||
// 监听自身 id 以实现 p2p 通讯
|
||||
this.socket.on(id, (msg: IMsg) => {
|
||||
log('#receive,', msg);
|
||||
});
|
||||
});
|
||||
|
||||
// 接收在线用户信息
|
||||
this.socket.on('online', (msg: IMsg) => {
|
||||
log('#online,', msg);
|
||||
if (msg.action === 'join') {
|
||||
this.joinMsg = msg.message;
|
||||
}
|
||||
if (msg.action === 'players') {
|
||||
this.users = JSON.parse(msg.message);
|
||||
console.log('users', JSON.parse(msg.message));
|
||||
}
|
||||
});
|
||||
|
||||
// 系统事件
|
||||
this.socket.on('disconnect', (msg: IMsg) => {
|
||||
log('#disconnect', msg);
|
||||
});
|
||||
|
||||
this.socket.on('disconnecting', () => {
|
||||
log('#disconnecting');
|
||||
});
|
||||
|
||||
this.socket.on('error', () => {
|
||||
log('#error');
|
||||
});
|
||||
}
|
||||
|
||||
private async buyIn() {
|
||||
try {
|
||||
const result = await service.buyIn(this.buyInSize);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
private mounted() {
|
||||
this.socketInit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less"
|
||||
scoped>
|
||||
.game-container {
|
||||
}
|
||||
</style>
|
||||
|
||||
+53
-20
@@ -1,20 +1,53 @@
|
||||
<template>
|
||||
<div class="about">
|
||||
<h1>This is an about page</h1>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { Component, Vue } from 'vue-property-decorator';
|
||||
import HelloWorld from './components/HelloWorld.vue';
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
HelloWorld,
|
||||
},
|
||||
})
|
||||
export default class Login extends Vue {
|
||||
userName: string = '';
|
||||
password: string = '';
|
||||
login() {}
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class="login container">
|
||||
<div class="user-name input-bd">
|
||||
<div class="input-name">userName:</div>
|
||||
<div class="input-text">
|
||||
<input type="text"
|
||||
v-model="userAccount"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="password input-bd">
|
||||
<div class="input-name">password:</div>
|
||||
<div class="input-text">
|
||||
<input type="password"
|
||||
v-model="password"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="login-btn btn">
|
||||
<span @click="login">sign in</span>
|
||||
<b @click="signUp">sign up</b>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import {Vue} from 'vue-property-decorator';
|
||||
import service from '../service';
|
||||
import Component from 'vue-class-component';
|
||||
import cookie from 'js-cookie';
|
||||
|
||||
@Component
|
||||
export default class Login extends Vue {
|
||||
public userAccount: string = '';
|
||||
public password: string = '';
|
||||
|
||||
private signUp() {
|
||||
this.$router.replace({name: 'register'});
|
||||
return;
|
||||
}
|
||||
|
||||
private async login() {
|
||||
try {
|
||||
const result = await service.login(this.userAccount, this.password);
|
||||
const { token } = result.data;
|
||||
cookie.set('token', token, {expires: 1});
|
||||
this.$router.replace({name: 'home'});
|
||||
console.log(result);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less">
|
||||
</style>
|
||||
|
||||
@@ -1,35 +1,53 @@
|
||||
<template>
|
||||
<div class="register-container">
|
||||
<div class="user-name">user name <input type="text" v-model="userName"></div>
|
||||
<div class="password">user name <input type="password" v-model="password"></div>
|
||||
<div class="re-password">password: <input type="password" v-model="rePassword"></div>
|
||||
<div class="s-btn" > <span @click="register">submit</span></div>
|
||||
</div>
|
||||
</template>
|
||||
<style type='less'>
|
||||
</style>
|
||||
<script lang="ts">
|
||||
import {Component, Vue} from 'vue-property-decorator';
|
||||
import service from '../service'
|
||||
|
||||
@Component({
|
||||
components: {},
|
||||
})
|
||||
export default class Register extends Vue {
|
||||
userName: string = '';
|
||||
password: string = '';
|
||||
rePassword: string = '';
|
||||
async register() {
|
||||
try {
|
||||
const option = {
|
||||
userName: this.userName,
|
||||
password: this.password,
|
||||
}
|
||||
const result = await service.register(...option)
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class="register-container container">
|
||||
<div class="user-name input-bd">
|
||||
<div class="input-name">userName:</div>
|
||||
<div class="input-text">
|
||||
<input type="text"
|
||||
v-model="userName"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="password input-bd">
|
||||
<div class="input-name">password:</div>
|
||||
<div class="input-text">
|
||||
<input type="text"
|
||||
v-model="password"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="re-password input-bd">
|
||||
<div class="input-name">re-password:</div>
|
||||
<div class="input-text">
|
||||
<input type="text"
|
||||
v-model="rePassword"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="s-btn btn"><span @click="register">submit</span></div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import {Vue} from 'vue-property-decorator';
|
||||
import service from '../service';
|
||||
import Component from 'vue-class-component';
|
||||
|
||||
@Component
|
||||
export default class Register extends Vue {
|
||||
public userName: string = '';
|
||||
public password: string = '';
|
||||
public rePassword: string = '';
|
||||
|
||||
get vaild() {
|
||||
return this.password === this.rePassword;
|
||||
}
|
||||
|
||||
private async register() {
|
||||
try {
|
||||
const result = await service.register(this.userName, this.password);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less">
|
||||
|
||||
</style>
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
"no-consecutive-blank-lines": false,
|
||||
"object-literal-sort-keys": false,
|
||||
"ordered-imports": false,
|
||||
"no-console": false,
|
||||
"quotemark": [true, "single"]
|
||||
}
|
||||
}
|
||||
|
||||
+179
-2
@@ -908,6 +908,11 @@
|
||||
resolved "https://registry.npmjs.org/@types/q/-/q-1.5.2.tgz#690a1475b84f2a884fd07cd797c00f5f31356ea8"
|
||||
integrity sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw==
|
||||
|
||||
"@types/socket.io-client@^1.4.32":
|
||||
version "1.4.32"
|
||||
resolved "https://registry.npmjs.org/@types/socket.io-client/-/socket.io-client-1.4.32.tgz#988a65a0386c274b1c22a55377fab6a30789ac14"
|
||||
integrity sha512-Vs55Kq8F+OWvy1RLA31rT+cAyemzgm0EWNeax6BWF8H7QiiOYMJIdcwSDdm5LVgfEkoepsWkS+40+WNb7BUMbg==
|
||||
|
||||
"@types/webpack-env@^1.15.1":
|
||||
version "1.15.1"
|
||||
resolved "https://registry.npmjs.org/@types/webpack-env/-/webpack-env-1.15.1.tgz#c8e84705e08eed430b5e15b39c65b0944e4d1422"
|
||||
@@ -1329,6 +1334,11 @@ address@^1.1.2:
|
||||
resolved "https://registry.npm.taobao.org/address/download/address-1.1.2.tgz#bf1116c9c758c51b7a933d296b72c221ed9428b6"
|
||||
integrity sha1-vxEWycdYxRt6kz0pa3LCIe2UKLY=
|
||||
|
||||
after@0.8.2:
|
||||
version "0.8.2"
|
||||
resolved "https://registry.npm.taobao.org/after/download/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f"
|
||||
integrity sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=
|
||||
|
||||
aggregate-error@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.npm.taobao.org/aggregate-error/download/aggregate-error-3.0.1.tgz#db2fe7246e536f40d9b5442a39e117d7dd6a24e0"
|
||||
@@ -1492,6 +1502,11 @@ array-unique@^0.3.2:
|
||||
resolved "https://registry.npm.taobao.org/array-unique/download/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"
|
||||
integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=
|
||||
|
||||
arraybuffer.slice@~0.0.7:
|
||||
version "0.0.7"
|
||||
resolved "https://registry.npm.taobao.org/arraybuffer.slice/download/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675"
|
||||
integrity sha1-O7xCdd1YTMGxCAm4nU6LY6aednU=
|
||||
|
||||
asap@~2.0.3:
|
||||
version "2.0.6"
|
||||
resolved "https://registry.npm.taobao.org/asap/download/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46"
|
||||
@@ -1615,11 +1630,21 @@ babel-plugin-dynamic-import-node@^2.3.0:
|
||||
dependencies:
|
||||
object.assign "^4.1.0"
|
||||
|
||||
backo2@1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.npm.taobao.org/backo2/download/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947"
|
||||
integrity sha1-MasayLEpNjRj41s+u2n038+6eUc=
|
||||
|
||||
balanced-match@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npm.taobao.org/balanced-match/download/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
|
||||
integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
|
||||
|
||||
base64-arraybuffer@0.1.5:
|
||||
version "0.1.5"
|
||||
resolved "https://registry.npm.taobao.org/base64-arraybuffer/download/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8"
|
||||
integrity sha1-c5JncZI7Whl0etZmqlzUv5xunOg=
|
||||
|
||||
base64-js@^1.0.2:
|
||||
version "1.3.1"
|
||||
resolved "https://registry.npm.taobao.org/base64-js/download/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1"
|
||||
@@ -1650,6 +1675,13 @@ bcrypt-pbkdf@^1.0.0:
|
||||
dependencies:
|
||||
tweetnacl "^0.14.3"
|
||||
|
||||
better-assert@~1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.npm.taobao.org/better-assert/download/better-assert-1.0.2.tgz#40866b9e1b9e0b55b481894311e68faffaebc522"
|
||||
integrity sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=
|
||||
dependencies:
|
||||
callsite "1.0.0"
|
||||
|
||||
bfj@^6.1.1:
|
||||
version "6.1.2"
|
||||
resolved "https://registry.npm.taobao.org/bfj/download/bfj-6.1.2.tgz#325c861a822bcb358a41c78a33b8e6e2086dde7f"
|
||||
@@ -1687,6 +1719,11 @@ bindings@^1.5.0:
|
||||
dependencies:
|
||||
file-uri-to-path "1.0.0"
|
||||
|
||||
blob@0.0.5:
|
||||
version "0.0.5"
|
||||
resolved "https://registry.npm.taobao.org/blob/download/blob-0.0.5.tgz?cache=0&sync_timestamp=1580722883513&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fblob%2Fdownload%2Fblob-0.0.5.tgz#d680eeef25f8cd91ad533f5b01eed48e64caf683"
|
||||
integrity sha1-1oDu7yX4zZGtUz9bAe7UjmTK9oM=
|
||||
|
||||
bluebird@^3.1.1, bluebird@^3.5.5:
|
||||
version "3.7.2"
|
||||
resolved "https://registry.npm.taobao.org/bluebird/download/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f"
|
||||
@@ -1975,6 +2012,11 @@ caller-path@^2.0.0:
|
||||
dependencies:
|
||||
caller-callsite "^2.0.0"
|
||||
|
||||
callsite@1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npm.taobao.org/callsite/download/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20"
|
||||
integrity sha1-KAOY5dZkvXQDi28JBRU+borxvCA=
|
||||
|
||||
callsites@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.npm.taobao.org/callsites/download/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50"
|
||||
@@ -2282,11 +2324,26 @@ commondir@^1.0.1:
|
||||
resolved "https://registry.npm.taobao.org/commondir/download/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b"
|
||||
integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=
|
||||
|
||||
component-bind@1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npm.taobao.org/component-bind/download/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1"
|
||||
integrity sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=
|
||||
|
||||
component-emitter@1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.npm.taobao.org/component-emitter/download/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6"
|
||||
integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=
|
||||
|
||||
component-emitter@^1.2.1:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.npm.taobao.org/component-emitter/download/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0"
|
||||
integrity sha1-FuQHD7qK4ptnnyIVhT7hgasuq8A=
|
||||
|
||||
component-inherit@0.0.3:
|
||||
version "0.0.3"
|
||||
resolved "https://registry.npm.taobao.org/component-inherit/download/component-inherit-0.0.3.tgz#645fc4adf58b72b649d5cae65135619db26ff143"
|
||||
integrity sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=
|
||||
|
||||
compressible@~2.0.16:
|
||||
version "2.0.18"
|
||||
resolved "https://registry.npm.taobao.org/compressible/download/compressible-2.0.18.tgz?cache=0&sync_timestamp=1578286264482&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcompressible%2Fdownload%2Fcompressible-2.0.18.tgz#af53cca6b070d4c3c0750fbd77286a6d7cc46fba"
|
||||
@@ -2700,7 +2757,7 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3:
|
||||
dependencies:
|
||||
ms "2.0.0"
|
||||
|
||||
debug@=3.1.0:
|
||||
debug@=3.1.0, debug@~3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
|
||||
integrity sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=
|
||||
@@ -2714,7 +2771,7 @@ debug@^3.0.0, debug@^3.1.1, debug@^3.2.5:
|
||||
dependencies:
|
||||
ms "^2.1.1"
|
||||
|
||||
debug@^4.1.0, debug@^4.1.1:
|
||||
debug@^4.1.0, debug@^4.1.1, debug@~4.1.0:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.npm.taobao.org/debug/download/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
|
||||
integrity sha1-O3ImAlUQnGtYnO4FDx1RYTlmR5E=
|
||||
@@ -3034,6 +3091,34 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0:
|
||||
dependencies:
|
||||
once "^1.4.0"
|
||||
|
||||
engine.io-client@~3.4.0:
|
||||
version "3.4.0"
|
||||
resolved "https://registry.npm.taobao.org/engine.io-client/download/engine.io-client-3.4.0.tgz#82a642b42862a9b3f7a188f41776b2deab643700"
|
||||
integrity sha1-gqZCtChiqbP3oYj0F3ay3qtkNwA=
|
||||
dependencies:
|
||||
component-emitter "1.2.1"
|
||||
component-inherit "0.0.3"
|
||||
debug "~4.1.0"
|
||||
engine.io-parser "~2.2.0"
|
||||
has-cors "1.1.0"
|
||||
indexof "0.0.1"
|
||||
parseqs "0.0.5"
|
||||
parseuri "0.0.5"
|
||||
ws "~6.1.0"
|
||||
xmlhttprequest-ssl "~1.5.4"
|
||||
yeast "0.1.2"
|
||||
|
||||
engine.io-parser@~2.2.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.npm.taobao.org/engine.io-parser/download/engine.io-parser-2.2.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fengine.io-parser%2Fdownload%2Fengine.io-parser-2.2.0.tgz#312c4894f57d52a02b420868da7b5c1c84af80ed"
|
||||
integrity sha1-MSxIlPV9UqArQgho2ntcHISvgO0=
|
||||
dependencies:
|
||||
after "0.8.2"
|
||||
arraybuffer.slice "~0.0.7"
|
||||
base64-arraybuffer "0.1.5"
|
||||
blob "0.0.5"
|
||||
has-binary2 "~1.0.2"
|
||||
|
||||
enhanced-resolve@^4.0.0, enhanced-resolve@^4.1.0:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.npm.taobao.org/enhanced-resolve/download/enhanced-resolve-4.1.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fenhanced-resolve%2Fdownload%2Fenhanced-resolve-4.1.1.tgz#2937e2b8066cd0fe7ce0990a98f0d71a35189f66"
|
||||
@@ -3726,6 +3811,18 @@ has-ansi@^2.0.0:
|
||||
dependencies:
|
||||
ansi-regex "^2.0.0"
|
||||
|
||||
has-binary2@~1.0.2:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.npm.taobao.org/has-binary2/download/has-binary2-1.0.3.tgz#7776ac627f3ea77250cfc332dab7ddf5e4f5d11d"
|
||||
integrity sha1-d3asYn8+p3JQz8My2rfd9eT10R0=
|
||||
dependencies:
|
||||
isarray "2.0.1"
|
||||
|
||||
has-cors@1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.npm.taobao.org/has-cors/download/has-cors-1.1.0.tgz#5e474793f7ea9843d1bb99c23eef49ff126fff39"
|
||||
integrity sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=
|
||||
|
||||
has-flag@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.npm.taobao.org/has-flag/download/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
|
||||
@@ -4076,6 +4173,11 @@ indexes-of@^1.0.1:
|
||||
resolved "https://registry.npm.taobao.org/indexes-of/download/indexes-of-1.0.1.tgz#f30f716c8e2bd346c7b67d3df3915566a7c05607"
|
||||
integrity sha1-8w9xbI4r00bHtn0985FVZqfAVgc=
|
||||
|
||||
indexof@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.npm.taobao.org/indexof/download/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d"
|
||||
integrity sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=
|
||||
|
||||
infer-owner@^1.0.3, infer-owner@^1.0.4:
|
||||
version "1.0.4"
|
||||
resolved "https://registry.npm.taobao.org/infer-owner/download/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467"
|
||||
@@ -4420,6 +4522,11 @@ isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0:
|
||||
resolved "https://registry.npm.taobao.org/isarray/download/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
|
||||
integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=
|
||||
|
||||
isarray@2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.npm.taobao.org/isarray/download/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e"
|
||||
integrity sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=
|
||||
|
||||
isexe@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.npm.taobao.org/isexe/download/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
|
||||
@@ -5283,6 +5390,11 @@ object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1:
|
||||
resolved "https://registry.npm.taobao.org/object-assign/download/object-assign-4.1.1.tgz?cache=0&sync_timestamp=1571657171505&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fobject-assign%2Fdownload%2Fobject-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
|
||||
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
|
||||
|
||||
object-component@0.0.3:
|
||||
version "0.0.3"
|
||||
resolved "https://registry.npm.taobao.org/object-component/download/object-component-0.0.3.tgz#f0c69aa50efc95b866c186f400a33769cb2f1291"
|
||||
integrity sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=
|
||||
|
||||
object-copy@^0.1.0:
|
||||
version "0.1.0"
|
||||
resolved "https://registry.npm.taobao.org/object-copy/download/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c"
|
||||
@@ -5586,6 +5698,20 @@ parse5@^5.1.1:
|
||||
resolved "https://registry.npm.taobao.org/parse5/download/parse5-5.1.1.tgz#f68e4e5ba1852ac2cadc00f4555fff6c2abb6178"
|
||||
integrity sha1-9o5OW6GFKsLK3AD0VV//bCq7YXg=
|
||||
|
||||
parseqs@0.0.5:
|
||||
version "0.0.5"
|
||||
resolved "https://registry.npm.taobao.org/parseqs/download/parseqs-0.0.5.tgz#d5208a3738e46766e291ba2ea173684921a8b89d"
|
||||
integrity sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=
|
||||
dependencies:
|
||||
better-assert "~1.0.0"
|
||||
|
||||
parseuri@0.0.5:
|
||||
version "0.0.5"
|
||||
resolved "https://registry.npm.taobao.org/parseuri/download/parseuri-0.0.5.tgz#80204a50d4dbb779bfdc6ebe2778d90e4bce320a"
|
||||
integrity sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=
|
||||
dependencies:
|
||||
better-assert "~1.0.0"
|
||||
|
||||
parseurl@~1.3.2, parseurl@~1.3.3:
|
||||
version "1.3.3"
|
||||
resolved "https://registry.npm.taobao.org/parseurl/download/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4"
|
||||
@@ -6783,6 +6909,35 @@ snapdragon@^0.8.1:
|
||||
source-map-resolve "^0.5.0"
|
||||
use "^3.1.0"
|
||||
|
||||
socket.io-client@^2.3.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.npm.taobao.org/socket.io-client/download/socket.io-client-2.3.0.tgz#14d5ba2e00b9bcd145ae443ab96b3f86cbcc1bb4"
|
||||
integrity sha1-FNW6LgC5vNFFrkQ6uWs/hsvMG7Q=
|
||||
dependencies:
|
||||
backo2 "1.0.2"
|
||||
base64-arraybuffer "0.1.5"
|
||||
component-bind "1.0.0"
|
||||
component-emitter "1.2.1"
|
||||
debug "~4.1.0"
|
||||
engine.io-client "~3.4.0"
|
||||
has-binary2 "~1.0.2"
|
||||
has-cors "1.1.0"
|
||||
indexof "0.0.1"
|
||||
object-component "0.0.3"
|
||||
parseqs "0.0.5"
|
||||
parseuri "0.0.5"
|
||||
socket.io-parser "~3.3.0"
|
||||
to-array "0.1.4"
|
||||
|
||||
socket.io-parser@~3.3.0:
|
||||
version "3.3.0"
|
||||
resolved "https://registry.npm.taobao.org/socket.io-parser/download/socket.io-parser-3.3.0.tgz#2b52a96a509fdf31440ba40fed6094c7d4f1262f"
|
||||
integrity sha1-K1KpalCf3zFEC6QP7WCUx9TxJi8=
|
||||
dependencies:
|
||||
component-emitter "1.2.1"
|
||||
debug "~3.1.0"
|
||||
isarray "2.0.1"
|
||||
|
||||
sockjs-client@1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.npm.taobao.org/sockjs-client/download/sockjs-client-1.4.0.tgz#c9f2568e19c8fd8173b4997ea3420e0bb306c7d5"
|
||||
@@ -7273,6 +7428,11 @@ timsort@^0.3.0:
|
||||
resolved "https://registry.npm.taobao.org/timsort/download/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4"
|
||||
integrity sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=
|
||||
|
||||
to-array@0.1.4:
|
||||
version "0.1.4"
|
||||
resolved "https://registry.npm.taobao.org/to-array/download/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890"
|
||||
integrity sha1-F+bBH3PdTz10zaek/zI46a2b+JA=
|
||||
|
||||
to-arraybuffer@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.npm.taobao.org/to-arraybuffer/download/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43"
|
||||
@@ -7941,6 +8101,18 @@ ws@^6.0.0, ws@^6.2.1:
|
||||
dependencies:
|
||||
async-limiter "~1.0.0"
|
||||
|
||||
ws@~6.1.0:
|
||||
version "6.1.4"
|
||||
resolved "https://registry.npm.taobao.org/ws/download/ws-6.1.4.tgz#5b5c8800afab925e94ccb29d153c8d02c1776ef9"
|
||||
integrity sha1-W1yIAK+rkl6UzLKdFTyNAsF3bvk=
|
||||
dependencies:
|
||||
async-limiter "~1.0.0"
|
||||
|
||||
xmlhttprequest-ssl@~1.5.4:
|
||||
version "1.5.5"
|
||||
resolved "https://registry.npm.taobao.org/xmlhttprequest-ssl/download/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e"
|
||||
integrity sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4=
|
||||
|
||||
xtend@^4.0.0, xtend@~4.0.1:
|
||||
version "4.0.2"
|
||||
resolved "https://registry.npm.taobao.org/xtend/download/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54"
|
||||
@@ -8017,6 +8189,11 @@ yargs@^15.0.0:
|
||||
y18n "^4.0.0"
|
||||
yargs-parser "^18.1.1"
|
||||
|
||||
yeast@0.1.2:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.npm.taobao.org/yeast/download/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419"
|
||||
integrity sha1-AI4G2AlDIMNy28L47XagymyKxBk=
|
||||
|
||||
yorkie@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.npm.taobao.org/yorkie/download/yorkie-2.0.0.tgz#92411912d435214e12c51c2ae1093e54b6bb83d9"
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
Navicat MySQL Data Transfer
|
||||
|
||||
Source Server : test
|
||||
Source Server Version : 50077
|
||||
Source Host : localhost:3306
|
||||
Source Database : poker
|
||||
|
||||
Target Server Type : MYSQL
|
||||
Target Server Version : 50077
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 2020-04-17 23:05:30
|
||||
*/
|
||||
|
||||
SET FOREIGN_KEY_CHECKS=0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for comand_record
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `comand_record`;
|
||||
CREATE TABLE `comand_record` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`user_id` int(11) default NULL,
|
||||
`game_id` int(11) default NULL,
|
||||
`type` text,
|
||||
`comand` text,
|
||||
`room_id` int(11) default NULL,
|
||||
`create_time` timestamp NOT NULL default CURRENT_TIMESTAMP,
|
||||
`update_time` datetime default NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of comand_record
|
||||
-- ----------------------------
|
||||
DROP TRIGGER IF EXISTS `update_comand_record_time`;
|
||||
DELIMITER ;;
|
||||
CREATE TRIGGER `update_comand_record_time` BEFORE UPDATE ON `comand_record` FOR EACH ROW SET NEW.`UPDATE_TIME` = NOW()
|
||||
;;
|
||||
DELIMITER ;
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
Navicat MySQL Data Transfer
|
||||
|
||||
Source Server : test
|
||||
Source Server Version : 50077
|
||||
Source Host : localhost:3306
|
||||
Source Database : poker
|
||||
|
||||
Target Server Type : MYSQL
|
||||
Target Server Version : 50077
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 2020-04-17 23:05:17
|
||||
*/
|
||||
|
||||
SET FOREIGN_KEY_CHECKS=0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for game
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `game`;
|
||||
CREATE TABLE `game` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`room_id` int(11) default NULL,
|
||||
`status` int(11) default NULL,
|
||||
`common_card` text,
|
||||
`winners` varchar(255) default NULL,
|
||||
`pot` decimal(8,0) default NULL,
|
||||
`create_time` timestamp NOT NULL default CURRENT_TIMESTAMP,
|
||||
`update_time` datetime default NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of game
|
||||
-- ----------------------------
|
||||
DROP TRIGGER IF EXISTS `update_game_time`;
|
||||
DELIMITER ;;
|
||||
CREATE TRIGGER `update_game_time` BEFORE UPDATE ON `game` FOR EACH ROW SET NEW.`UPDATE_TIME` = NOW()
|
||||
;;
|
||||
DELIMITER ;
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
Navicat MySQL Data Transfer
|
||||
|
||||
Source Server : test
|
||||
Source Server Version : 50077
|
||||
Source Host : localhost:3306
|
||||
Source Database : poker
|
||||
|
||||
Target Server Type : MYSQL
|
||||
Target Server Version : 50077
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 2020-04-17 23:05:40
|
||||
*/
|
||||
|
||||
SET FOREIGN_KEY_CHECKS=0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for game_record
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `game_record`;
|
||||
CREATE TABLE `game_record` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`game_id` int(11) default NULL,
|
||||
`room_number` int(11) default NULL,
|
||||
`buy_in` int(11) NOT NULL,
|
||||
`hand_card` varchar(25) default NULL,
|
||||
`user_id` int(11) default NULL,
|
||||
`create_time` timestamp NOT NULL default CURRENT_TIMESTAMP,
|
||||
`update_time` datetime default NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of game_record
|
||||
-- ----------------------------
|
||||
DROP TRIGGER IF EXISTS `update_game_record_time`;
|
||||
DELIMITER ;;
|
||||
CREATE TRIGGER `update_game_record_time` BEFORE UPDATE ON `game_record` FOR EACH ROW SET NEW.`UPDATE_TIME` = NOW()
|
||||
;;
|
||||
DELIMITER ;
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
Navicat MySQL Data Transfer
|
||||
|
||||
Source Server : test
|
||||
Source Server Version : 50077
|
||||
Source Host : localhost:3306
|
||||
Source Database : poker
|
||||
|
||||
Target Server Type : MYSQL
|
||||
Target Server Version : 50077
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 2020-04-17 23:05:49
|
||||
*/
|
||||
|
||||
SET FOREIGN_KEY_CHECKS=0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for room
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `room`;
|
||||
CREATE TABLE `room` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`room_number` text,
|
||||
`create_time` timestamp NOT NULL default CURRENT_TIMESTAMP,
|
||||
`update_time` datetime default NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of room
|
||||
-- ----------------------------
|
||||
INSERT INTO `room` VALUES ('1', '522687', '2020-04-01 15:33:32', null);
|
||||
INSERT INTO `room` VALUES ('2', '145519', '2020-04-01 16:58:53', null);
|
||||
INSERT INTO `room` VALUES ('3', '354507', '2020-04-01 17:35:32', null);
|
||||
INSERT INTO `room` VALUES ('4', '973599', '2020-04-02 17:09:52', null);
|
||||
INSERT INTO `room` VALUES ('5', '338302', '2020-04-02 17:12:39', null);
|
||||
INSERT INTO `room` VALUES ('6', '739937', '2020-04-16 16:33:43', null);
|
||||
INSERT INTO `room` VALUES ('7', '604560', '2020-04-16 16:35:35', null);
|
||||
INSERT INTO `room` VALUES ('8', '205826', '2020-04-17 09:57:41', null);
|
||||
INSERT INTO `room` VALUES ('9', '507003', '2020-04-17 13:51:25', null);
|
||||
INSERT INTO `room` VALUES ('10', '633228', '2020-04-17 13:55:04', null);
|
||||
INSERT INTO `room` VALUES ('11', '719376', '2020-04-17 15:06:55', null);
|
||||
INSERT INTO `room` VALUES ('12', '516433', '2020-04-17 16:08:29', null);
|
||||
INSERT INTO `room` VALUES ('13', '991922', '2020-04-17 16:20:18', null);
|
||||
INSERT INTO `room` VALUES ('14', '346124', '2020-04-17 16:20:52', null);
|
||||
INSERT INTO `room` VALUES ('15', '261855', '2020-04-17 17:29:38', null);
|
||||
DROP TRIGGER IF EXISTS `update_room_time`;
|
||||
DELIMITER ;;
|
||||
CREATE TRIGGER `update_room_time` BEFORE UPDATE ON `room` FOR EACH ROW SET NEW.`UPDATE_TIME` = NOW()
|
||||
;;
|
||||
DELIMITER ;
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
Navicat MySQL Data Transfer
|
||||
|
||||
Source Server : test
|
||||
Source Server Version : 50077
|
||||
Source Host : localhost:3306
|
||||
Source Database : poker
|
||||
|
||||
Target Server Type : MYSQL
|
||||
Target Server Version : 50077
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 2020-04-17 23:05:58
|
||||
*/
|
||||
|
||||
SET FOREIGN_KEY_CHECKS=0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for user
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `user`;
|
||||
CREATE TABLE `user` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`nick_name` char(25) character set utf8 default NULL,
|
||||
`password` char(25) default NULL,
|
||||
`account` char(25) default NULL,
|
||||
`create_time` timestamp NOT NULL default CURRENT_TIMESTAMP,
|
||||
`update_time` datetime default NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of user
|
||||
-- ----------------------------
|
||||
INSERT INTO `user` VALUES ('1', 'c', '123', 'cai', '2020-04-01 16:26:32', null);
|
||||
INSERT INTO `user` VALUES ('2', '蔡', '123', 'cai111', '2020-04-01 16:28:17', null);
|
||||
INSERT INTO `user` VALUES ('3', '蔡1', '123', 'cai11', '2020-04-01 16:29:43', null);
|
||||
DROP TRIGGER IF EXISTS `update_user_time`;
|
||||
DELIMITER ;;
|
||||
CREATE TRIGGER `update_user_time` BEFORE UPDATE ON `user` FOR EACH ROW SET NEW.`UPDATE_TIME` = NOW()
|
||||
;;
|
||||
DELIMITER ;
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
+2
@@ -14,7 +14,9 @@ export class Account extends BaseController {
|
||||
async login() {
|
||||
try {
|
||||
const { body } = this.getRequestBody();
|
||||
console.log(body, 'body');
|
||||
const { userAccount, password } = body;
|
||||
console.log(userAccount, 'userAccount');
|
||||
const accountInfo: IAccountInfo = { userAccount, password };
|
||||
const result = await this.service.login(accountInfo);
|
||||
this.success(result);
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import { Context, inject, controller, post, provide } from 'midway';
|
||||
import BaseController from '../../lib/baseController';
|
||||
import { IRoomService } from '../../interface/IRoom';
|
||||
|
||||
@provide()
|
||||
@controller('/node/game')
|
||||
export class GameController extends BaseController {
|
||||
|
||||
@inject()
|
||||
ctx: Context;
|
||||
|
||||
@inject('GameService')
|
||||
gameService: IGameService;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@post('/buyIn')
|
||||
async buyIn() {
|
||||
try {
|
||||
const result = await this.gameService.add();
|
||||
this.success(result);
|
||||
} catch (e) {
|
||||
this.fail('create room error');
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
+5
-1
@@ -10,7 +10,11 @@ export default function auth(): any {
|
||||
const roomService = await app.applicationContext.getAsync('RoomService');
|
||||
const query = socket.handshake.query;
|
||||
// 用户信息
|
||||
const { room, userName } = query;
|
||||
const { room, token } = query;
|
||||
|
||||
const userInfo = app.jwt.verify(token);
|
||||
|
||||
const { userName } = userInfo;
|
||||
|
||||
// 检查房间是否存在,不存在则踢出用户
|
||||
// 备注:此处 app.redis 与插件无关,可用其他存储代替
|
||||
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
+2
-1
@@ -39,8 +39,9 @@ export default (appInfo: EggAppInfo) => {
|
||||
credentials: true,
|
||||
origin(ctx: Context) {
|
||||
const origin: string = ctx.get('origin');
|
||||
console.log(origin, 'orgin');
|
||||
// 允许*域名访问
|
||||
if (origin.indexOf('172.22.88.118') > -1) {
|
||||
if (origin.indexOf('http://172.22.72.70:8080') > -1) {
|
||||
console.log('come in');
|
||||
return origin;
|
||||
} else {
|
||||
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
+1
-1
@@ -1,5 +1,5 @@
|
||||
export interface IUser {
|
||||
nickName: string;
|
||||
nick_name: string;
|
||||
account: string;
|
||||
password?: string;
|
||||
}
|
||||
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
+6
-6
@@ -1,5 +1,5 @@
|
||||
import { inject, Context } from 'midway';
|
||||
import { IRequestBody } from '../interface/IRequestBody';
|
||||
// import { IRequestBody } from '../interface/IRequestBody';
|
||||
import { IResult, ResultCode } from '../interface/IResult';
|
||||
|
||||
export default class BaseController {
|
||||
@@ -11,11 +11,11 @@ export default class BaseController {
|
||||
* 获取请求内容
|
||||
* @returns {IRequestBody}
|
||||
*/
|
||||
public getRequestBody(): IRequestBody {
|
||||
let params: IRequestBody;
|
||||
params = this.ctx.request.body.params && JSON.parse(this.ctx.request.body.params) || {};
|
||||
console.log(this.ctx.request.body, 'params');
|
||||
return params;
|
||||
public getRequestBody() {
|
||||
// let params: IRequestBody;
|
||||
// params = this.ctx.request.body.params && JSON.parse(this.ctx.request.body.params) || {};
|
||||
// console.log(this.ctx.request.body, 'params');
|
||||
return this.ctx.request;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Executable → Regular
Executable → Regular
+4
-2
@@ -71,8 +71,10 @@ export class AccountService extends BaseService implements IAccountService {
|
||||
return await this.user.findByAccount(userAccount);
|
||||
}
|
||||
|
||||
private getToken(userAccount: string) {
|
||||
const token = this.jwt.sign({ userAccount },
|
||||
private async getToken(userAccount: string) {
|
||||
const user = await this.user.findByAccount(userAccount);
|
||||
console.log(user, 'user----------');
|
||||
const token = this.jwt.sign({ userName: user.nick_name },
|
||||
this.jwtConfig.secret, { expiresIn: 60 * 60 });
|
||||
this.ctx.logger.info(`AccountService getToken token--${token}`);
|
||||
return token;
|
||||
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Reference in New Issue
Block a user