add start script
This commit is contained in:
parent
c8b8e1f0a8
commit
782ca48fe9
@ -2,7 +2,7 @@
|
|||||||
ENV = 'development'
|
ENV = 'development'
|
||||||
|
|
||||||
# base api
|
# base api
|
||||||
VUE_APP_BASE_API = 'http://192.168.100.90:2333'
|
VUE_APP_BASE_API = '/api'
|
||||||
|
|
||||||
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
|
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
|
||||||
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
|
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
|
||||||
|
@ -2,5 +2,5 @@
|
|||||||
ENV = 'production'
|
ENV = 'production'
|
||||||
|
|
||||||
# base api
|
# base api
|
||||||
VUE_APP_BASE_API = 'http://192.168.100.90:2333'
|
VUE_APP_BASE_API = '/api'
|
||||||
|
|
||||||
|
@ -4,5 +4,5 @@ NODE_ENV = production
|
|||||||
ENV = 'staging'
|
ENV = 'staging'
|
||||||
|
|
||||||
# base api
|
# base api
|
||||||
VUE_APP_BASE_API = 'http://192.168.100.90:2333'
|
VUE_APP_BASE_API = '/api'
|
||||||
|
|
||||||
|
13
boundle.sh
Normal file
13
boundle.sh
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
source /etc/profile
|
||||||
|
|
||||||
|
npm install --prefer-offline --loglevel info --unsafe-perm=true --allow-root >> boundle.log
|
||||||
|
echo 'copy node_modules to /data/publish/node_packages' >> boundle.log
|
||||||
|
|
||||||
|
vue-cli-service build
|
||||||
|
|
||||||
|
cd ./dist/ && tar -zcvf pikachu_fe.tar.gz ./
|
||||||
|
cd ..
|
||||||
|
mkdir target && mv ./dist/pikachu_fe.tar.gz ./target/pikachu_fe.tar.gz
|
||||||
|
echo 'all done' 2>&1 >> boundle.log
|
@ -2,7 +2,7 @@ import request from '@/utils/request'
|
|||||||
|
|
||||||
export function login(data) {
|
export function login(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/user/login',
|
url: '/user/login',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@ -10,7 +10,7 @@ export function login(data) {
|
|||||||
|
|
||||||
export function getInfo(token) {
|
export function getInfo(token) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/user/info',
|
url: '/user/info',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
// params: { token }
|
// params: { token }
|
||||||
})
|
})
|
||||||
@ -18,7 +18,7 @@ export function getInfo(token) {
|
|||||||
|
|
||||||
export function logout() {
|
export function logout() {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/user/logout',
|
url: '/user/logout',
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
getGameList() {
|
getGameList() {
|
||||||
request({
|
request({
|
||||||
url: '/api/games/list',
|
url: '/games/list',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
const { data } = res
|
const { data } = res
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<el-form-item label="游戏图标" prop="game_icon" class="uploader-box">
|
<el-form-item label="游戏图标" prop="game_icon" class="uploader-box">
|
||||||
<el-upload
|
<el-upload
|
||||||
class="uploader"
|
class="uploader"
|
||||||
action="/api/common/upload"
|
action="/common/upload"
|
||||||
:show-file-list="false"
|
:show-file-list="false"
|
||||||
:on-success="uploadSuccess"
|
:on-success="uploadSuccess"
|
||||||
:on-error="uploadErr"
|
:on-error="uploadErr"
|
||||||
@ -150,7 +150,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
getData() {
|
getData() {
|
||||||
request({
|
request({
|
||||||
url: '/api/games/list',
|
url: '/games/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: {
|
params: {
|
||||||
_id: this.uid
|
_id: this.uid
|
||||||
@ -170,7 +170,7 @@ export default {
|
|||||||
},
|
},
|
||||||
getPlatform() {
|
getPlatform() {
|
||||||
request({
|
request({
|
||||||
url: '/api/games/platform',
|
url: '/games/platform',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
const { data } = res
|
const { data } = res
|
||||||
@ -186,7 +186,7 @@ export default {
|
|||||||
},
|
},
|
||||||
getGameType() {
|
getGameType() {
|
||||||
request({
|
request({
|
||||||
url: '/api/games/type',
|
url: '/games/type',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
const { data } = res
|
const { data } = res
|
||||||
@ -202,7 +202,7 @@ export default {
|
|||||||
},
|
},
|
||||||
getStatusList() {
|
getStatusList() {
|
||||||
request({
|
request({
|
||||||
url: '/api/games/status',
|
url: '/games/status',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
const { data } = res
|
const { data } = res
|
||||||
@ -226,7 +226,7 @@ export default {
|
|||||||
saveEdit() {
|
saveEdit() {
|
||||||
if (this.uid === 'new') {
|
if (this.uid === 'new') {
|
||||||
request({
|
request({
|
||||||
url: '/api/games/add',
|
url: '/games/add',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: this.gameForm
|
data: this.gameForm
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
@ -242,7 +242,7 @@ export default {
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
request({
|
request({
|
||||||
url: '/api/games/edit',
|
url: '/games/edit',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: this.gameForm
|
data: this.gameForm
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
@ -94,7 +94,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
getData() {
|
getData() {
|
||||||
request({
|
request({
|
||||||
url: '/api/games/list',
|
url: '/games/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: {
|
params: {
|
||||||
_id: this.uid
|
_id: this.uid
|
||||||
@ -119,7 +119,7 @@ export default {
|
|||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
request({
|
request({
|
||||||
url: '/api/games/del',
|
url: '/games/del',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
gameList: [{ _id: this.uid }]
|
gameList: [{ _id: this.uid }]
|
||||||
|
@ -197,7 +197,7 @@ export default {
|
|||||||
// left
|
// left
|
||||||
getGameInfo(cb) {
|
getGameInfo(cb) {
|
||||||
request({
|
request({
|
||||||
url: '/api/games/list',
|
url: '/games/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: {
|
params: {
|
||||||
_id: this.uid
|
_id: this.uid
|
||||||
@ -218,7 +218,7 @@ export default {
|
|||||||
},
|
},
|
||||||
getGameSettings() {
|
getGameSettings() {
|
||||||
request({
|
request({
|
||||||
url: '/api/games/settings/one_game_cfg',
|
url: '/games/settings/one_game_cfg',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: {
|
params: {
|
||||||
type: this.type === 'normal' ? 0 : 1,
|
type: this.type === 'normal' ? 0 : 1,
|
||||||
@ -292,7 +292,7 @@ export default {
|
|||||||
this.saveSettings()
|
this.saveSettings()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
request({
|
request({
|
||||||
url: '/api/games/settings/publish_cfg',
|
url: '/games/settings/publish_cfg',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
cfgs: this.settingsForm.settings,
|
cfgs: this.settingsForm.settings,
|
||||||
@ -328,7 +328,7 @@ export default {
|
|||||||
saveSettings() {
|
saveSettings() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
request({
|
request({
|
||||||
url: '/api/games/settings/save_cfg',
|
url: '/games/settings/save_cfg',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
cfgs: this.settingsForm.settings,
|
cfgs: this.settingsForm.settings,
|
||||||
@ -358,7 +358,7 @@ export default {
|
|||||||
// right
|
// right
|
||||||
getSettingsList() {
|
getSettingsList() {
|
||||||
request({
|
request({
|
||||||
url: '/api/games/settings/sys_dics?type=game_cfg',
|
url: '/games/settings/sys_dics?type=game_cfg',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
const { data } = res
|
const { data } = res
|
||||||
@ -437,7 +437,7 @@ export default {
|
|||||||
this.$refs['newSettingForm'].validate(valid => {
|
this.$refs['newSettingForm'].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
request({
|
request({
|
||||||
url: '/api/games/settings/save_sys_dic',
|
url: '/games/settings/save_sys_dic',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
record: {
|
record: {
|
||||||
|
@ -180,7 +180,7 @@ export default {
|
|||||||
},
|
},
|
||||||
getGameType() {
|
getGameType() {
|
||||||
request({
|
request({
|
||||||
url: '/api/games/type',
|
url: '/games/type',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
const { data } = res
|
const { data } = res
|
||||||
@ -214,7 +214,7 @@ export default {
|
|||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
request({
|
request({
|
||||||
url: '/api/games/del',
|
url: '/games/del',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
gameList: this.multipleSelection
|
gameList: this.multipleSelection
|
||||||
@ -252,7 +252,7 @@ export default {
|
|||||||
getData(cb) {
|
getData(cb) {
|
||||||
console.log('get data')
|
console.log('get data')
|
||||||
request({
|
request({
|
||||||
url: '/api/games/list',
|
url: '/games/list',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
const { data } = res
|
const { data } = res
|
||||||
@ -306,7 +306,7 @@ export default {
|
|||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
request({
|
request({
|
||||||
url: '/api/games/del',
|
url: '/games/del',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
gameList: [{ _id: row._id }]
|
gameList: [{ _id: row._id }]
|
||||||
|
@ -84,6 +84,8 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
this.getData()
|
this.getData()
|
||||||
this.permissionWriteable = this.userInfo.permissions.includes(`settings-writeable`)
|
this.permissionWriteable = this.userInfo.permissions.includes(`settings-writeable`)
|
||||||
|
console.log(this.userInfo.permissions)
|
||||||
|
console.log(this.userInfo.permissions.includes(`settings-writeable`))
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// toolbar
|
// toolbar
|
||||||
@ -96,7 +98,7 @@ export default {
|
|||||||
// table
|
// table
|
||||||
getData() {
|
getData() {
|
||||||
request({
|
request({
|
||||||
url: '/api/games/settings/sys_dics?type=game_cfg',
|
url: '/games/settings/sys_dics?type=game_cfg',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
const { data } = res
|
const { data } = res
|
||||||
@ -142,7 +144,7 @@ export default {
|
|||||||
this.$refs['modalForm'].validate(valid => {
|
this.$refs['modalForm'].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
request({
|
request({
|
||||||
url: '/api/games/settings/save_sys_dic',
|
url: '/games/settings/save_sys_dic',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
record: {
|
record: {
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
<el-form-item label="头像" prop="avatar" class="uploader-box">
|
<el-form-item label="头像" prop="avatar" class="uploader-box">
|
||||||
<el-upload
|
<el-upload
|
||||||
class="uploader"
|
class="uploader"
|
||||||
action="/api/common/upload"
|
action="/common/upload"
|
||||||
:show-file-list="false"
|
:show-file-list="false"
|
||||||
:on-success="uploadSuccess"
|
:on-success="uploadSuccess"
|
||||||
:on-error="uploadErr"
|
:on-error="uploadErr"
|
||||||
@ -68,7 +68,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
saveEdit() {
|
saveEdit() {
|
||||||
request({
|
request({
|
||||||
url: '/api/user/edit',
|
url: '/user/edit',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
username: this.userForm.username,
|
username: this.userForm.username,
|
||||||
|
@ -197,7 +197,7 @@ export default {
|
|||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
request({
|
request({
|
||||||
url: '/api/sys/permission/del',
|
url: '/sys/permission/del',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
roleList: this.multipleSelection
|
roleList: this.multipleSelection
|
||||||
@ -236,7 +236,7 @@ export default {
|
|||||||
// table
|
// table
|
||||||
getData() {
|
getData() {
|
||||||
request({
|
request({
|
||||||
url: '/api/sys/permission/list',
|
url: '/sys/permission/list',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
const { data } = res
|
const { data } = res
|
||||||
@ -262,7 +262,7 @@ export default {
|
|||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
request({
|
request({
|
||||||
url: '/api/sys/permission/del',
|
url: '/sys/permission/del',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
rolename: row.rolename
|
rolename: row.rolename
|
||||||
@ -319,7 +319,7 @@ export default {
|
|||||||
},
|
},
|
||||||
getGameList() {
|
getGameList() {
|
||||||
request({
|
request({
|
||||||
url: '/api/games/list',
|
url: '/games/list',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
const { data } = res
|
const { data } = res
|
||||||
@ -377,7 +377,7 @@ export default {
|
|||||||
// 提交
|
// 提交
|
||||||
const method = this.isNew ? 'add' : 'edit'
|
const method = this.isNew ? 'add' : 'edit'
|
||||||
request({
|
request({
|
||||||
url: `/api/sys/permission/${method}`,
|
url: `/sys/permission/${method}`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: this.modalForm
|
data: this.modalForm
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
@ -168,7 +168,7 @@ export default {
|
|||||||
// table
|
// table
|
||||||
getData(cb) {
|
getData(cb) {
|
||||||
request({
|
request({
|
||||||
url: '/api/sys/users/list',
|
url: '/sys/users/list',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
@ -213,7 +213,7 @@ export default {
|
|||||||
// modal
|
// modal
|
||||||
getRoleList() {
|
getRoleList() {
|
||||||
request({
|
request({
|
||||||
url: '/api/sys/permission/list',
|
url: '/sys/permission/list',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
const { data } = res
|
const { data } = res
|
||||||
@ -241,7 +241,7 @@ export default {
|
|||||||
if (this.modalForm.roles.includes(role.name)) permissions.push(role._id)
|
if (this.modalForm.roles.includes(role.name)) permissions.push(role._id)
|
||||||
}
|
}
|
||||||
request({
|
request({
|
||||||
url: '/api/sys/users/edit',
|
url: '/sys/users/edit',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
username: this.modalForm.username,
|
username: this.modalForm.username,
|
||||||
|
0
start.json
Normal file
0
start.json
Normal file
@ -31,12 +31,13 @@ module.exports = {
|
|||||||
errors: true
|
errors: true
|
||||||
},
|
},
|
||||||
proxy: {
|
proxy: {
|
||||||
// proxy all requests starting with /api to jsonplaceholder
|
// change xxx-api/login => mock/login
|
||||||
'^/api': {
|
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||||
target: 'http://localhost:2333', // 代理接口
|
[process.env.VUE_APP_BASE_API]: {
|
||||||
|
target: `http://localhost:2333`,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
'^/api': '/' // 代理的路径
|
['^' + process.env.VUE_APP_BASE_API]: '/api'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user