添加网页调试
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
node_modules
|
node_modules
|
||||||
game-server/dist
|
game-server/dist
|
||||||
|
game-server/logs
|
||||||
*.DS_Store
|
*.DS_Store
|
||||||
|
.vscode/*
|
||||||
|
|||||||
@@ -6,3 +6,8 @@ export const ENCRYPT_IV = 'f7182j5f04e377ux';
|
|||||||
export const ENCRYPT_KEY = 'fiqaxijabbantusmprc234fj';
|
export const ENCRYPT_KEY = 'fiqaxijabbantusmprc234fj';
|
||||||
|
|
||||||
export const AUTH_SMS_CNT_PER_DAY = 8;
|
export const AUTH_SMS_CNT_PER_DAY = 8;
|
||||||
|
|
||||||
|
export const COUNTER = {
|
||||||
|
UID: 'uid',
|
||||||
|
};
|
||||||
|
|
||||||
@@ -31,7 +31,8 @@ export class EntryHandler {
|
|||||||
console.log('user token not found');
|
console.log('user token not found');
|
||||||
return {
|
return {
|
||||||
code: 500,
|
code: 500,
|
||||||
error: true
|
error: true,
|
||||||
|
data: 'user token not found'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,4 +5,11 @@ export default class HomeController extends Controller {
|
|||||||
const { ctx } = this;
|
const { ctx } = this;
|
||||||
ctx.body = await ctx.service.test.sayHi('egg');
|
ctx.body = await ctx.service.test.sayHi('egg');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async dev() {
|
||||||
|
const { ctx } = this;
|
||||||
|
await ctx.render('index',{
|
||||||
|
title: 'xxx'
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ function aesDecrypt(data, key, iv) {
|
|||||||
|
|
||||||
module.exports = options => {
|
module.exports = options => {
|
||||||
return async function parmsDecode(ctx: Context, next) {
|
return async function parmsDecode(ctx: Context, next) {
|
||||||
|
if(ctx.request.url == '/dev') {
|
||||||
|
await next();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (options.threshold && ctx.length < options.threshold) return;
|
if (options.threshold && ctx.length < options.threshold) return;
|
||||||
const reqBody = ctx.request.body;
|
const reqBody = ctx.request.body;
|
||||||
|
|
||||||
|
|||||||
+6
File diff suppressed because one or more lines are too long
@@ -0,0 +1,69 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<title>
|
||||||
|
chatofpinus
|
||||||
|
</title>
|
||||||
|
<link rel="stylesheet" href="bootstrap.min.css" type="text/css" />
|
||||||
|
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||||
|
<script src="js/lib/jquery-1.8.0.min.js" type="text/javascript">
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script src="js/lib/build/build.js" type="text/javascript">
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
require('boot');
|
||||||
|
</script>
|
||||||
|
<script src="js/client.js">
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="app" class="container">
|
||||||
|
<div class="page-header"><h1>调试</h1></div>
|
||||||
|
<div class="row">
|
||||||
|
<div id="loginError"></div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<form id="form">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="uid">uid (chat)</label>
|
||||||
|
<input type="text" class="form-control" id="uid" name="uid" placeholder="uid" value="asd">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="rid">rid (chat)</label>
|
||||||
|
<input type="text" class="form-control" id="rid" name="rid" placeholder="rid" value="123">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="route">接口</label>
|
||||||
|
<input type="text" class="form-control" id="route" name="route" placeholder="接口">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="route">token</label>
|
||||||
|
<input type="text" class="form-control" id="token" name="token" placeholder="token">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="route">serverId</label>
|
||||||
|
<input type="text" class="form-control" id="serverId" name="serverId" placeholder="serverId">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="params">参数</label>
|
||||||
|
<textarea class="form-control" name="params" id="params" cols="30" rows="10"></textarea>
|
||||||
|
</div>
|
||||||
|
<div class="text-right" aria-label="...">
|
||||||
|
<button type="button" id="add" class="btn btn-default btn-l">加入</button>
|
||||||
|
<button type="button" id="remove" class="btn btn-default btn-l" style="display: none;">离开</button>
|
||||||
|
<button type="button" id="send" class="btn btn-primary btn-l">发送</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6" id="content"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"name": "pomelo-client",
|
||||||
|
"description": "pomelo-client",
|
||||||
|
"local": [ "boot" ],
|
||||||
|
"paths": [ "local"]
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "pomelo-protocol",
|
||||||
|
"description": "pomelo-protocol",
|
||||||
|
"keywords": [
|
||||||
|
"pomelo",
|
||||||
|
"protocol"
|
||||||
|
],
|
||||||
|
"version": "0.1.3",
|
||||||
|
"main": "lib/protocol.js",
|
||||||
|
"scripts": [
|
||||||
|
"lib/protocol.js"
|
||||||
|
],
|
||||||
|
"repo": "https://github.com/NetEase/pomelo-protocol"
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "emitter",
|
||||||
|
"repo": "component/emitter",
|
||||||
|
"description": "Event emitter",
|
||||||
|
"keywords": [
|
||||||
|
"emitter",
|
||||||
|
"events"
|
||||||
|
],
|
||||||
|
"version": "1.1.2",
|
||||||
|
"scripts": [
|
||||||
|
"index.js"
|
||||||
|
],
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"name": "pomelo-jsclient-websocket",
|
||||||
|
"description": "pomelo-jsclient-websocket",
|
||||||
|
"keywords": [
|
||||||
|
"pomelo",
|
||||||
|
"jsclient",
|
||||||
|
"websocket"
|
||||||
|
],
|
||||||
|
"version": "0.0.1",
|
||||||
|
"main": "lib/pomelo-client.js",
|
||||||
|
"scripts": [
|
||||||
|
"lib/pomelo-client.js"
|
||||||
|
],
|
||||||
|
"repo": "https://github.com/pomelonode/pomelo-jsclient-websocket"
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "pomelo-protobuf",
|
||||||
|
"description": "pomelo-protobuf",
|
||||||
|
"keywords": [
|
||||||
|
"pomelo",
|
||||||
|
"protobuf"
|
||||||
|
],
|
||||||
|
"version": "0.2.0",
|
||||||
|
"main": "lib/client/protobuf.js",
|
||||||
|
"scripts": [
|
||||||
|
"lib/client/protobuf.js"
|
||||||
|
],
|
||||||
|
"repo": "https://github.com/pomelonode/pomelo-protobuf"
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"name": "boot",
|
||||||
|
"description": "Main app boot component",
|
||||||
|
"dependencies": {
|
||||||
|
"component/emitter":"master",
|
||||||
|
"NetEase/pomelo-protocol": "master",
|
||||||
|
"pomelonode/pomelo-protobuf": "master",
|
||||||
|
"pomelonode/pomelo-jsclient-websocket": "master"
|
||||||
|
},
|
||||||
|
"scripts": ["index.js"]
|
||||||
|
}
|
||||||
@@ -0,0 +1,183 @@
|
|||||||
|
body {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
body, #entry {
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
body, table {
|
||||||
|
font-family: DejaVu Sans Mono, fixed;
|
||||||
|
font-size: 14pt;
|
||||||
|
line-height: 150%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#loginView {
|
||||||
|
width: 100%;
|
||||||
|
font-size: 13pt;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
#loginTitle {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 150px;
|
||||||
|
font-size: 50pt;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#loginView input[type = "text"] {
|
||||||
|
height: 30px;
|
||||||
|
width: 270px;
|
||||||
|
font-size: inherit;
|
||||||
|
margin-left: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#loginView input[type = "button"] {
|
||||||
|
height: 30px;
|
||||||
|
width: 90px;
|
||||||
|
font-size: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
#loginView table {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
margin-top: 10%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#loginView table tr {
|
||||||
|
text-align: center;
|
||||||
|
height: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#loginView table tr td {
|
||||||
|
padding-top: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#loginError {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 16pt;
|
||||||
|
color: #ff0000;
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#chatHistory {
|
||||||
|
padding-bottom: 5.1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#toolbar {
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
bottom: 0;
|
||||||
|
background: #007077;
|
||||||
|
}
|
||||||
|
|
||||||
|
#toolbar ul {
|
||||||
|
margin: 0;
|
||||||
|
padding: 5px 0 0 6px;
|
||||||
|
height: 35px;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#toolbar li {
|
||||||
|
display: block;
|
||||||
|
float: left;
|
||||||
|
margin: 0 2em 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#toolbar select {
|
||||||
|
width: 100px;
|
||||||
|
height: 30px;
|
||||||
|
font-size: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
#entry {
|
||||||
|
width: 100%;
|
||||||
|
font-size: inherit;
|
||||||
|
padding: 1em;
|
||||||
|
margin: 0;
|
||||||
|
border-width: 0;
|
||||||
|
outline-width: 0;
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message {
|
||||||
|
margin: 0.1em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message td {
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nick {
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 0 1em 0 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pop {
|
||||||
|
display: none;
|
||||||
|
background: #fff;
|
||||||
|
width: 260px;
|
||||||
|
height: 152px;
|
||||||
|
border: 1px solid #e0e0e0;
|
||||||
|
font-size: 12px;
|
||||||
|
font-family: DejaVu Sans Mono, fixed;
|
||||||
|
position: fixed;
|
||||||
|
right: 10px;
|
||||||
|
bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#popHead {
|
||||||
|
line-height: 40px;
|
||||||
|
background: #E74C65;
|
||||||
|
border-bottom: 1px solid #e0e0e0;
|
||||||
|
position: relative;
|
||||||
|
font-size: 12px;
|
||||||
|
padding: 0 0 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#popHead h2 {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #666;
|
||||||
|
line-height: 40px;
|
||||||
|
height: 32px;
|
||||||
|
margin-top: -12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#popHead #popClose {
|
||||||
|
position: absolute;
|
||||||
|
right: 10px;
|
||||||
|
top: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#popHead a#popClose:hover {
|
||||||
|
color: #f00;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
#popContent {
|
||||||
|
padding: 20px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#popIntro {
|
||||||
|
text-align: center;
|
||||||
|
line-height: 160%;
|
||||||
|
margin: 5px 0;
|
||||||
|
color: #000;
|
||||||
|
font-size: 12pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
#popMore {
|
||||||
|
text-align: right;
|
||||||
|
border-top: 1px solid #ccc;
|
||||||
|
line-height: 24px;
|
||||||
|
padding-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#popMore:hover {
|
||||||
|
color: #f00;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.btn-l {
|
||||||
|
width: 100px;
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ import { Application } from 'egg';
|
|||||||
export default (app: Application) => {
|
export default (app: Application) => {
|
||||||
const { controller, router } = app;
|
const { controller, router } = app;
|
||||||
const tokenParser = app.middleware.tokenParser();
|
const tokenParser = app.middleware.tokenParser();
|
||||||
|
router.get('/dev', controller.home.dev);
|
||||||
router.get('/', controller.home.index);
|
router.get('/', controller.home.index);
|
||||||
router.post('/user/getsms', controller.account.getSms);
|
router.post('/user/getsms', controller.account.getSms);
|
||||||
router.post('/user/smslogin', controller.account.smsLogin);
|
router.post('/user/smslogin', controller.account.smsLogin);
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { EggPlugin } from 'egg';
|
import { EggPlugin } from 'egg';
|
||||||
|
|
||||||
const plugin: EggPlugin = {
|
const plugin: EggPlugin = {
|
||||||
// static: true,
|
static: true,
|
||||||
// nunjucks: {
|
nunjucks: {
|
||||||
// enable: true,
|
enable: true,
|
||||||
// package: 'egg-view-nunjucks',
|
package: 'egg-view-nunjucks',
|
||||||
// },
|
},
|
||||||
cors: {
|
cors: {
|
||||||
enable: true,
|
enable: true,
|
||||||
package: 'egg-cors',
|
package: 'egg-cors',
|
||||||
|
|||||||
Generated
+8
@@ -4078,6 +4078,14 @@
|
|||||||
"mz": "^2.7.0"
|
"mz": "^2.7.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"egg-view-nunjucks": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/egg-view-nunjucks/-/egg-view-nunjucks-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-csuqQSFRpR1G+nu8OxDgHDba1v8RVJ8i4fadX66o73mnclKN6EXPdX9c9igegPeXXucUdDAPAHfJo6nZMJaghw==",
|
||||||
|
"requires": {
|
||||||
|
"nunjucks": "^3.1.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"egg-watcher": {
|
"egg-watcher": {
|
||||||
"version": "3.1.1",
|
"version": "3.1.1",
|
||||||
"resolved": "https://registry.npm.taobao.org/egg-watcher/download/egg-watcher-3.1.1.tgz",
|
"resolved": "https://registry.npm.taobao.org/egg-watcher/download/egg-watcher-3.1.1.tgz",
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
"egg-alinode": "^2.0.1",
|
"egg-alinode": "^2.0.1",
|
||||||
"egg-cors": "^2.2.3",
|
"egg-cors": "^2.2.3",
|
||||||
"egg-scripts": "^2.6.0",
|
"egg-scripts": "^2.6.0",
|
||||||
|
"egg-view-nunjucks": "^2.2.0",
|
||||||
"mongoose": "^5.10.1",
|
"mongoose": "^5.10.1",
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
"underscore": "^1.10.2"
|
"underscore": "^1.10.2"
|
||||||
|
|||||||
+2
@@ -14,6 +14,7 @@ import 'egg-schedule';
|
|||||||
import 'egg-static';
|
import 'egg-static';
|
||||||
import 'egg-jsonp';
|
import 'egg-jsonp';
|
||||||
import 'egg-view';
|
import 'egg-view';
|
||||||
|
import 'egg-view-nunjucks';
|
||||||
import 'egg-cors';
|
import 'egg-cors';
|
||||||
import 'egg-alinode';
|
import 'egg-alinode';
|
||||||
import { EggPluginItem } from 'egg';
|
import { EggPluginItem } from 'egg';
|
||||||
@@ -31,6 +32,7 @@ declare module 'egg' {
|
|||||||
static?: EggPluginItem;
|
static?: EggPluginItem;
|
||||||
jsonp?: EggPluginItem;
|
jsonp?: EggPluginItem;
|
||||||
view?: EggPluginItem;
|
view?: EggPluginItem;
|
||||||
|
nunjucks?: EggPluginItem;
|
||||||
cors?: EggPluginItem;
|
cors?: EggPluginItem;
|
||||||
alinode?: EggPluginItem;
|
alinode?: EggPluginItem;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user