A complete set of underworld management system, including the entire back-end management system, query and export of the book of life and death, and the function of knocking on wooden fish to add merit. The back-end uses node+mysql+express
technology stack, and the front-end technology stack uses Vue+elementUI
, a multi-user multi-authority system.
Preview address: http://df.earthonline.club/home
account admin, password 123456, please do not change the account password
In order to avoid problems caused by various practical factors, the operation process of this underworld management system is not the real (widely circulated statement) process. For example, the legendary Wangxiang Terrace and Sansheng Stone have not been reflected, but are only referenced in the overall process and theme.
--Add preview address
--Fixed the situation where administrator permissions would be reset to NaN error
--Fixed the issue where the Knockout Fish page directly returns an error after turning on automatic
-- Add test data, api/test.sql
此项目包含三部分,包括后端api接口,前端管理后台,前端用户体验端
The overall functions include: data statistics preview, book of life and death management, soul seducer, soul seduction management, Hell Palace trial, trial record, eighteen levels of hell, equipment management, six paths of reincarnation, equipment management, remittance, remittance management, role setting, authority management, Administrator management and system settings
Functional flow Adding the data of the life and death book will contain various data of this person, including name, date of birth, death and address, yin and yang virtues, wealth contained in life, type of death, cause of death, description of this person's life, attribute description, marriage status, and death Complete data such as circumstances, etc., will be added to the list of people waiting to be seduced after the death date, waiting for the seducer to capture the soul, and then be handed over to the inquisitor for trial. According to the rewards and punishments in his life, the results include being re-entered into reincarnation, and being sentenced to eighteen years old. A layer of hell, in the world and knocking on wooden fish to increase merits
运行环境准备:
nodeJS -v 16.15.0
mysql -V 8.0.28
Running order: api->user->admin
Create a new database afterlifedb
, and then import or execute the SQL in api/afterlifedb.sql
. After the execution is successful, the database import is completed.
Open api/link/config.js
and fill in the database link information
let config = {
host : 'localhost' , // 数据库地址,默认localhost
user : '' , // 数据库账号
password : '' , // 数据库密码
database : 'afterlifedb' , //数据库名,不建议更改
timezone : "SYSTEM" ,
connectionLimit : 10
}
Go back to the api
directory, open the command window here, and install the dependencies
npm i
Start a project
node index.js
When you see Service started successfully, running on http://localhost:3000
, it means that the project has started successfully. Try requesting (accessing) http://127.0.0.1:3000/api/user/gettempauth
to see if the authorization success message can be returned. If No, please check the database import
Open the user/src/main.js
file. There are three addresses to fill in here.
Vue . prototype . apiUrl = 'http://localhost:3000' //api接口地址,不携带/
Vue . prototype . adminUrl = 'http://localhost:8081' //后台管理系统地址
axios . defaults . baseURL = 'http://localhost:3000/' ; //api接口地址,注意末尾携带/
If it is running locally, just check that the port is correct and then default it. The background management system has not been set up at this time. If port 8081 is not occupied, then the background management system address is http://localhost:8081
. If port 8081 is occupied, then Run on http://localhost:8082
port, and so on to check whether a certain port is occupied. Execute the following command in cmd. If the returned content is empty, it means it is not occupied.
netstat -ano|findstr "8081"
Go back to the api
directory, open the command window here, and install the dependencies
npm i
Start the project. If it is just a local preview, execute the following command to run it directly. After the operation is completed, access the address in the output App running at:
npm run serve
If you need to package and publish, follow the following process to complete it. Otherwise, please skip this content directly to 3. Management background to build packaging.
npm run build
The generated file is in the userdist
folder, and the folder contains the packaged content.
Enable packaged content to run locally
(1) Create a basic structure according to express
mkdir myapp
cd myapp
npm init
package.json will be created
(2) Install express
npm install express --save
node_modules will be created
(3) Create the index.js
file and www folder in the same directory, and write in index.js
const express = require ( 'express' )
const app = express ( )
app . get ( '/' , ( req , res ) => res . send ( 'Hello World!' ) )
app . use ( express . static ( './www' ) )
app . listen ( 3010 , ( ) => console . log ( 'Example app listening on port 3010!' ) )
(4) After npm run build
, put the packaged file directory under the www
folder. For example, the packaged file directory is dist. There are index.html and page folders in dist. The page folder is all packaged. document
(5) Add a route to access localhost:3010/index.html
to access the page you packaged.
If other computers also need to access, replace localhost with the local IP address and it will be OK.
Open the admin/src/main.js
file. There are three addresses to fill in here.
Vue . prototype . apiUrl = 'http://localhost:3000' //api接口地址,不携带/
Vue . prototype . adminUrl = 'http://localhost:8080' //user用户端搭建得到的地址
axios . defaults . baseURL = 'http://localhost:3000/' ; //api接口地址,注意末尾携带/
If it is running locally, check that the port is correct and then default it.
Go back to the admin
directory, open a command window here, and install dependencies
npm i
Start the project. If it is just a local preview, execute the following command to run it directly. After running, access the output address in App running at:
npm run serve
If you need to package and publish, please refer to the packaging and running process above.
The default account and password of the top administrator in backend management is admin, 123456
At this point, the project construction is completed.