├── doc ├── 1_home.jpg ├── 8_role.jpg ├── 3_register.jpg ├── 4_recharge.jpg ├── 6_key_list.jpg ├── 9_accounts.jpg ├── 5_key_create.jpg ├── 2_login_client.jpg └── 7_client_notice.jpg ├── public ├── favicon.ico └── index.html ├── src ├── assets │ ├── logo.png │ └── imgs │ │ ├── banner.jpg │ │ └── dnf-logo.png ├── views │ ├── manager │ │ ├── MgrAction.vue │ │ ├── MgrKLogs.vue │ │ ├── MgrNews.vue │ │ ├── MgrNotice.vue │ │ ├── Databases.vue │ │ ├── box │ │ │ └── SendEmail.vue │ │ ├── MgrCharach.vue │ │ ├── MgrAccount.vue │ │ └── MgrKeys.vue │ ├── Login.vue │ ├── Home.vue │ ├── Manager.vue │ ├── Recharge.vue │ └── Register.vue ├── App.vue ├── components │ └── NavBar.vue ├── router │ └── index.js └── main.js ├── babel.config.js ├── vue.config.js ├── package.json └── README.md /doc/1_home.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlyGuo/dnf-server-web-public/HEAD/doc/1_home.jpg -------------------------------------------------------------------------------- /doc/8_role.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlyGuo/dnf-server-web-public/HEAD/doc/8_role.jpg -------------------------------------------------------------------------------- /doc/3_register.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlyGuo/dnf-server-web-public/HEAD/doc/3_register.jpg -------------------------------------------------------------------------------- /doc/4_recharge.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlyGuo/dnf-server-web-public/HEAD/doc/4_recharge.jpg -------------------------------------------------------------------------------- /doc/6_key_list.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlyGuo/dnf-server-web-public/HEAD/doc/6_key_list.jpg -------------------------------------------------------------------------------- /doc/9_accounts.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlyGuo/dnf-server-web-public/HEAD/doc/9_accounts.jpg -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlyGuo/dnf-server-web-public/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlyGuo/dnf-server-web-public/HEAD/src/assets/logo.png -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /doc/5_key_create.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlyGuo/dnf-server-web-public/HEAD/doc/5_key_create.jpg -------------------------------------------------------------------------------- /doc/2_login_client.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlyGuo/dnf-server-web-public/HEAD/doc/2_login_client.jpg -------------------------------------------------------------------------------- /doc/7_client_notice.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlyGuo/dnf-server-web-public/HEAD/doc/7_client_notice.jpg -------------------------------------------------------------------------------- /src/assets/imgs/banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlyGuo/dnf-server-web-public/HEAD/src/assets/imgs/banner.jpg -------------------------------------------------------------------------------- /src/assets/imgs/dnf-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlyGuo/dnf-server-web-public/HEAD/src/assets/imgs/dnf-logo.png -------------------------------------------------------------------------------- /src/views/manager/MgrAction.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /src/views/manager/MgrKLogs.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /src/views/manager/MgrNews.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 21 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | devServer: { 3 | compress: true, 4 | inline: true, 5 | disableHostCheck: true, 6 | proxy: { 7 | '/api': { 8 | target: 'http://127.0.0.1:9001', 9 | ws: true, 10 | changeOrigin: true, 11 | pathRewrite: { 12 | '^/api': '/api' 13 | } 14 | }, 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/views/Login.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 38 | 39 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dnf-server-web", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "axios": "^0.21.1", 12 | "codemirror": "^5.61.0", 13 | "core-js": "^3.6.5", 14 | "element-ui": "^2.15.1", 15 | "js-base64": "^3.6.0", 16 | "vue": "^2.6.11", 17 | "vue-codemirror": "^4.0.6", 18 | "vue-codemirror-lite": "^1.0.4", 19 | "vue-router": "^3.2.0" 20 | }, 21 | "devDependencies": { 22 | "@vue/cli-plugin-babel": "~4.5.0", 23 | "@vue/cli-plugin-eslint": "~4.5.0", 24 | "@vue/cli-plugin-router": "~4.5.0", 25 | "@vue/cli-service": "~4.5.0", 26 | "babel-eslint": "^10.1.0", 27 | "eslint": "^6.7.2", 28 | "eslint-plugin-vue": "^6.2.2", 29 | "less": "^3.0.4", 30 | "less-loader": "^5.0.0", 31 | "vue-template-compiler": "^2.6.11" 32 | }, 33 | "eslintConfig": { 34 | "root": true, 35 | "env": { 36 | "node": true 37 | }, 38 | "extends": [ 39 | "plugin:vue/essential", 40 | "eslint:recommended" 41 | ], 42 | "parserOptions": { 43 | "parser": "babel-eslint" 44 | }, 45 | "rules": {} 46 | }, 47 | "browserslist": [ 48 | "> 1%", 49 | "last 2 versions", 50 | "not dead" 51 | ] 52 | } 53 | -------------------------------------------------------------------------------- /src/views/manager/MgrNotice.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 50 | 51 | -------------------------------------------------------------------------------- /src/views/Home.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 30 | 31 | 55 | -------------------------------------------------------------------------------- /src/components/NavBar.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 36 | 37 | -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueRouter from 'vue-router' 3 | import Home from '../views/Home.vue' 4 | 5 | Vue.use(VueRouter) 6 | 7 | const routes = [ 8 | { 9 | path: '/', 10 | name: 'Home', 11 | component: Home 12 | }, 13 | { 14 | path: '/login', 15 | component: () => import('../views/Login'), 16 | }, 17 | { 18 | path: '/register', 19 | component: () => import('../views/Register'), 20 | }, 21 | { 22 | path: '/recharge', 23 | component: () => import('../views/Recharge'), 24 | }, 25 | { 26 | path: '/manager', 27 | component: () => import('../views/Manager'), 28 | redirect: '/manager/account', 29 | children: [ 30 | { 31 | path: '/manager/account', 32 | component: () => import('../views/manager/MgrAccount'), 33 | }, { 34 | path: '/manager/charac', 35 | component: () => import('../views/manager/MgrCharach'), 36 | }, { 37 | path: '/manager/notice', 38 | component: () => import('../views/manager/MgrNotice'), 39 | }, { 40 | path: '/manager/news', 41 | component: () => import('../views/manager/MgrNews'), 42 | }, { 43 | path: '/manager/action', 44 | component: () => import('../views/manager/MgrAction'), 45 | }, { 46 | path: '/manager/keys', 47 | component: () => import('../views/manager/MgrKeys'), 48 | }, { 49 | path: '/manager/k-logs', 50 | component: () => import('../views/manager/MgrKLogs'), 51 | }, { 52 | path: '/manager/databases', 53 | component: () => import('../views/manager/Databases'), 54 | } 55 | ] 56 | } 57 | ] 58 | 59 | const router = new VueRouter({ 60 | mode: 'history', 61 | base: process.env.BASE_URL, 62 | routes 63 | }) 64 | 65 | export default router 66 | -------------------------------------------------------------------------------- /src/views/manager/Databases.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 79 | 80 | -------------------------------------------------------------------------------- /src/views/Manager.vue: -------------------------------------------------------------------------------- 1 | 69 | 70 | 80 | 81 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dnf-server-web 2 | 3 | > 先给大家推荐一个好玩的网站MyChatGPT(免梯子,国内直接用,不需要OpenAI账号):https://fuckicoding.com/ 4 | 5 | ## Project setup 6 | ``` 7 | npm install 8 | ``` 9 | 10 | ### Compiles and hot-reloads for development 11 | ``` 12 | npm run serve 13 | ``` 14 | 15 | ### Compiles and minifies for production 16 | ``` 17 | npm run build 18 | ``` 19 | 20 | ### Lints and fixes files 21 | ``` 22 | npm run lint 23 | ``` 24 | 25 | ### Customize configuration 26 | See [Configuration Reference](https://cli.vuejs.org/config/). 27 | 28 | ## 演示地址 29 | http://8.140.189.172:9002/ 30 | 可下载游戏登录玩耍。 31 | 32 | 配套登陆器: 33 | https://github.com/onlyGuo/dnf-client-public.git 34 | 35 | 配套后台系统: 36 | https://github.com/onlyGuo/dnf-server-public.git 37 | Email:719348277@qq.com 38 | 39 | ## 界面预览 40 | 目前已完成主页注册、充值、后台管理(账号管理、角色管理、制卡、查卡) 41 | 42 | ### 门户主页 43 | ![home](https://github.com/onlyGuo/dnf-server-web-public/blob/main/doc/1_home.jpg?raw=true) 44 | ### 登陆器 45 | ![login](https://github.com/onlyGuo/dnf-server-web-public/blob/main/doc/2_login_client.jpg?raw=true) 46 | ### 账号注册页面 47 | ![register](https://github.com/onlyGuo/dnf-server-web-public/blob/main/doc/3_register.jpg?raw=true) 48 | ### 账号充值页面 49 | ![recharge](https://github.com/onlyGuo/dnf-server-web-public/blob/main/doc/4_recharge.jpg?raw=true) 50 | ### 制作充值卡 51 | ![keys create](https://github.com/onlyGuo/dnf-server-web-public/blob/main/doc/5_key_create.jpg?raw=true) 52 | ### 充值卡列表 53 | ![kyes list](https://github.com/onlyGuo/dnf-server-web-public/blob/main/doc/6_key_list.jpg?raw=true) 54 | ### 账号管理 55 | ![account list](https://github.com/onlyGuo/dnf-server-web-public/blob/main/doc/9_accounts.jpg?raw=true) 56 | ### 角色管理 57 | ![role list](https://github.com/onlyGuo/dnf-server-web-public/blob/main/doc/8_role.jpg?raw=true) 58 | ### 登陆器通知 59 | ![login notice](https://github.com/onlyGuo/dnf-server-web-public/blob/main/doc/7_client_notice.jpg?raw=true) 60 | 61 | ## 部署步骤 62 | 推荐以docker方式部署到服务器中,且推荐此类方式。另外推荐一个基于官方openjdk修改的镜像,调整了时区,使其对应中国时区: `guoshengkai/openjdk:8`。 63 | 以下讲解在物理机中的部署方式。 64 | 1. 服务器安装JDK8 65 | 2. 数据库创建用户,要求具有dof数据库的增删改查权限,也可以直接使用game用户但不建议。 66 | 3. 数据库`d_taiwan`库下创建`login_notice`表,用于存放登陆器公告 67 | ````sql 68 | create table login_notice 69 | ( 70 | id INT(10) auto_increment 71 | primary key, 72 | content TEXT(65535) null comment '通知内容' 73 | ); 74 | 75 | INSERT INTO d_taiwan.login_notice (id, content) VALUES (1, 'MS4g5paw54mI55qE55m76ZmG5Zmo5byA5Y+R5a6M5q+V77yM546w5bey5pSv5oyB6Ieq5Yqo5pu05pawCjIuIOWFrOWFseWFheWAvOmhtemdouW3suW8gOaUvu+8jOi0reS5sOWFheWAvOWNoeWSjENES+iBlOezu+WQhOS7o+eQhgozLiDlhoXkvqfljbPlsIbliKDmoaPov47mnaXlhazmtYs='); 76 | ```` 77 | 4. 数据库创建`dnf_service`库,用于存放后台管理系统相关业务,并导入以下SQL 78 | ````sql 79 | create table dnf_service.recharge_key 80 | ( 81 | id INT(10) auto_increment 82 | primary key, 83 | content VARCHAR(50) null comment '卡密本体', 84 | type INT(10) null comment '0 = 点券, 1 = 装备', 85 | face INT(10) null comment '点券数量或装备编号', 86 | face_name VARCHAR(500) null, 87 | status INT(10) null comment '0=未使用,1=已使用', 88 | use_account VARCHAR(20) null comment '使用账号', 89 | use_uid INT(10) null comment '使用账号ID', 90 | create_time DATETIME(19) null comment '创建时间', 91 | use_time DATETIME(19) null comment '使用时间' 92 | ); 93 | ```` 94 | 5. 安装后台服务:https://github.com/onlyGuo/dnf-server-public.git 95 | 6. 本地安装nodejs环境 96 | 7. cd到本项目根目录下编译源码 97 | ````bash 98 | npm install 99 | npm run build 100 | ```` 101 | 8. 服务器创建站点,将本项目源码编译文件放到站点目录中,并配置反向代理防止本项目与后台交互产生跨域问题,以nginx为例。 102 | ```` 103 | server{ 104 | listen 9002; # 页面访问端口 105 | listen [::]:9002; # 页面访问端口 106 | server_name localhost; 107 | 108 | # 站点目录, “/home/html/dnf”改为你自己的目录 109 | location / { 110 | root /home/html/dnf; 111 | try_files $uri $uri/ /index.html; 112 | } 113 | 114 | error_page 500 502 503 504 /50x.html; 115 | location = /50x.html { 116 | root /usr/share/nginx/html; 117 | } 118 | 119 | # 后台服务代理,“http://172.18.0.3:9001;”改为你自己的服务路径和端口 120 | location ~/api/v1 { 121 | proxy_pass http://172.18.0.3:9001; 122 | proxy_set_header Host $host:$server_port; 123 | } 124 | } 125 | ```` 126 | 9. 访问http://servername:9002即可。 127 | 10. 补充一下,修改源码中的Home.vue改为自己的客户端下载地址,重新编译并上传。 128 | 129 | 130 | -------------------------------------------------------------------------------- /src/views/Recharge.vue: -------------------------------------------------------------------------------- 1 | 46 | 47 | 97 | 98 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | import Axios from 'axios'; 5 | import ElementUI, {Message} from 'element-ui'; 6 | import 'element-ui/lib/theme-chalk/index.css'; 7 | import VueCodemirror from 'vue-codemirror' 8 | import 'codemirror/lib/codemirror.css' 9 | 10 | Vue.use(ElementUI); 11 | Vue.use(VueCodemirror); 12 | 13 | 14 | Vue.config.productionTip = false 15 | /** 16 | * 全局数组删除操作 17 | * @param val 18 | */ 19 | Array.prototype.remove = function (val) { 20 | var index = this.indexOf(val); 21 | if (index > -1) { 22 | this.splice(index, 1); 23 | } 24 | }; 25 | 26 | 27 | Axios.defaults.baseURL = "/api/v1/" 28 | Axios.defaults.timeout = 10000 29 | 30 | /** 31 | * 请求拦截器 32 | */ 33 | Axios.interceptors.request.use( 34 | config => { 35 | // 允许携带cookie 36 | config.withCredentials = true; 37 | config.headers['Content-Type'] = "application/json"; 38 | config.headers['token'] = window.localStorage.getItem("token"); 39 | return config 40 | }, 41 | error => { 42 | return Promise.error(error) 43 | } 44 | ) 45 | 46 | /** 47 | * 相应拦截器 48 | */ 49 | Axios.interceptors.response.use( 50 | response => { 51 | if (response.status === 200) { 52 | return Promise.resolve(response) 53 | } else { 54 | return Promise.reject(response) 55 | } 56 | }, 57 | // 服务器状态码不是200的情况 58 | error => { 59 | console.log(error) 60 | try { 61 | if (error.response.status) { 62 | if (error.response.status === 401) { 63 | router.replace({ 64 | path: '/login' 65 | }) 66 | } else if (error.response.status === 400) { 67 | Message.error(error.response.data.message); 68 | } else { 69 | Message.error('网络错误,请稍后再试'); 70 | } 71 | return Promise.reject(error.response) 72 | } 73 | }catch (e){ 74 | Message.error('网络错误,请稍后再试'); 75 | return Promise.reject(error.response) 76 | } 77 | } 78 | ) 79 | Vue.prototype.ser = Axios 80 | Vue.prototype.ser.ctx = Axios.defaults.baseURL 81 | 82 | /** 83 | * 全局路由跳转 84 | * @param path 85 | * 跳转路径 86 | * @param replace 87 | * 是否直接更换 88 | */ 89 | Vue.prototype.go = (path, replace) => { 90 | if (replace) { 91 | router.replace({ 92 | path: path 93 | }); 94 | } else { 95 | router.push({ 96 | path: path 97 | }); 98 | } 99 | } 100 | 101 | Vue.prototype.jobs = () => { 102 | return [ 103 | { 104 | name: '鬼剑士(男)', 105 | subs: {'0': '未转职', '17': '剑圣', '18': '鬼泣', '19': '狱血魔神', '20': '大暗黑天'} 106 | },{ 107 | name: '格斗家(女)', 108 | subs: { '0': '未转职', '17': '百花缭乱', '18': '武神', '19': '毒王', '20': '暴风眼'} 109 | 110 | },{ 111 | name: '神枪手(男)', 112 | subs: { '0': '未转职', '17': '枪神', '18': '狂暴者', '19': '机械战神', '20': '大将军'} 113 | },{ 114 | name: '魔法师(女)', 115 | subs: { '0': '未转职', '17': '大魔导师', '18': '月之女皇', '19': '贝亚娜斗神', '20': '魔术师'} 116 | },{ 117 | name: '圣职者(男)', 118 | subs: { '0': '未转职', '17': '天启者', '18': '神之手', '19': '龙斗士', '20': '末日守护者'} 119 | },{ 120 | name: '神枪手(女)', 121 | subs: { '0': '未转职', '17': '沾血蔷薇', '18': '重炮掌控者', '19': '机械之心', '20': '战争女神'} 122 | },{ 123 | name: '暗夜使者(女)', 124 | subs: { '0': '未转职', '17': '银月', '18': '灵魂收割者'} 125 | },{ 126 | name: '格斗家(男)', 127 | subs: { '0': '未转职', '17': '狂虎帝', '18': '武极', '19': '千手罗汉', '20': '风林火山'} 128 | },{ 129 | name: '魔法师(男)', 130 | subs: { '0': '未转职', '17': '元素爆破师', '18': '冰冻之心'} 131 | },{ 132 | name: '黑暗武士(男)', 133 | subs: { '0': '未转职', '17': '自我觉醒'} 134 | } 135 | ] 136 | } 137 | 138 | 139 | /** 140 | * 全局UUID 141 | * @returns {string} 142 | */ 143 | Vue.prototype.uuid = () => { 144 | let s = []; 145 | let hexDigits = "0123456789abcdef"; 146 | for (let i = 0; i < 36; i++) { 147 | s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1); 148 | } 149 | s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010 150 | s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01 151 | s[8] = s[13] = s[18] = s[23] = "-"; 152 | let uuid = s.join(""); 153 | return uuid.replace("-", ""); 154 | } 155 | 156 | 157 | 158 | 159 | new Vue({ 160 | router, 161 | render: h => h(App) 162 | }).$mount('#app') 163 | -------------------------------------------------------------------------------- /src/views/Register.vue: -------------------------------------------------------------------------------- 1 | 42 | 43 | 115 | 116 | -------------------------------------------------------------------------------- /src/views/manager/box/SendEmail.vue: -------------------------------------------------------------------------------- 1 | 65 | 66 | 145 | 146 | -------------------------------------------------------------------------------- /src/views/manager/MgrCharach.vue: -------------------------------------------------------------------------------- 1 | 104 | 105 | 164 | 165 | -------------------------------------------------------------------------------- /src/views/manager/MgrAccount.vue: -------------------------------------------------------------------------------- 1 | 111 | 112 | 178 | 179 | -------------------------------------------------------------------------------- /src/views/manager/MgrKeys.vue: -------------------------------------------------------------------------------- 1 | 136 | 137 | 224 | 225 | 228 | --------------------------------------------------------------------------------