Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
op-web-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
op-web-service
Commits
f0407c55
Commit
f0407c55
authored
May 28, 2021
by
lvweichao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: proxy
parent
2b40d74f
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
72 additions
and
33 deletions
+72
-33
start.sh
deploy_ci/start_env/opservice.yidianzixun.com/start.sh
+8
-8
config.js
server/config.js
+4
-4
user.js
server/controllers/user.js
+8
-4
router.js
server/router.js
+4
-6
App.vue
src/App.vue
+16
-0
index.vue
src/components/PageHeader/index.vue
+1
-1
pm2.json
src/pm2.json
+19
-0
common.js
src/service/common.js
+1
-1
user.js
src/service/user.js
+1
-1
vue.config.js
vue.config.js
+10
-8
No files found.
deploy_ci/start_env/opservice.yidianzixun.com/start.sh
View file @
f0407c55
rm
/home/worker/
metro
.yidianzixun.com/logs/start_script.done
cd
/home/worker/
metro
.yidianzixun.com/htdocs/
mv
/opt/project_lib/node_modules /home/worker/
metro
.yidianzixun.com/htdocs/
rm
/home/worker/
opservice
.yidianzixun.com/logs/start_script.done
cd
/home/worker/
opservice
.yidianzixun.com/htdocs/
mv
/opt/project_lib/node_modules /home/worker/
opservice
.yidianzixun.com/htdocs/
env
=
$1
port
=
$2
...
...
@@ -12,17 +12,17 @@ if [ $env != "" ]; then
fi
if
[
X
"
$port
"
=
X]
;
then
$port
=
80
66
$port
=
80
55
fi
cd
/home/worker/
metro
.yidianzixun.com/htdocs/
cd
/home/worker/
opservice
.yidianzixun.com/htdocs/
if
[
X
"
$env
"
=
X
"prod"
]
;
then
echo
"{
\"
pm2-logrotate
\"
:{
\"
max_size
\"
:
\"
524288000
\"
,
\"
interval
\"
:
\"
7
\"
,
\"
retain
\"
:
\"
10
\"
},
\"
module-db
\"
:{
\"
pm2-logrotate
\"
:true}}"
>
/root/.pm2/module_conf.json
port
=
80
66
port
=
80
55
pm2 start pm2.json
else
PORT
=
$port
NODE_ENV
=
$env
pm2 start
index.js
--name
'metro
'
--watch
PORT
=
$port
NODE_ENV
=
$env
pm2 start
app.js
--name
'opwebservice
'
--watch
fi
while
true
;
do
...
...
@@ -34,6 +34,6 @@ while true; do
sleep
10
;
done
touch
/home/worker/
metro
.yidianzixun.com/logs/start_script.done
touch
/home/worker/
opservice
.yidianzixun.com/logs/start_script.done
while
true
;
do
sleep
30
;
done
server/config.js
View file @
f0407c55
const
env
=
process
.
env
.
NODE_ENV
||
'development'
;
const
port
=
process
.
env
.
PORT
||
80
66
;
const
port
=
process
.
env
.
PORT
||
80
55
;
const
LOGIN_URI
=
{
'development'
:
"http://web-rest.int.yidian-inc.com"
,
...
...
@@ -8,9 +8,9 @@ const LOGIN_URI = {
}
const
API_INTERNAL_URI
=
{
'development'
:
""
,
'test'
:
""
,
'production'
:
""
'development'
:
"
bp-test.ini.yidian-inc.com
"
,
'test'
:
"
bp-test.ini.yidian-inc.com
"
,
'production'
:
"
bp-test.go2yd.com
"
}
module
.
exports
=
{
...
...
server/controllers/user.js
View file @
f0407c55
...
...
@@ -2,13 +2,17 @@ const { API_INTERNAL_URI } = require('../config.js')
var
query
=
{
async
get_permissions
(
ctx
,
next
)
{
const
url
=
`
${
API_INTERNAL_URI
}
/api/v1/pandora/auth`
;
// http://bp-test.ini.yidian-inc.com/merchant/authority/get_role_list?user_email=jianghaiming@126.com
const
url
=
`
${
API_INTERNAL_URI
}
/merchant/authority/get_role_list`
;
const
{
email
}
=
ctx
.
request
.
query
;
const
opts
=
{
url
,
method
:
'POST'
,
json
:
true
,
body
:
ctx
.
request
.
body
method
:
'GET'
,
params
:
{
email
}
}
ctx
.
body
=
await
req
(
ctx
,
opts
)
}
}
...
...
server/router.js
View file @
f0407c55
const
Router
=
require
(
'koa-router'
);
const
system
=
require
(
'./controllers/system'
)
// const index = require('./controllers/index');
// const about = require('./controllers/about');
// const api = require('./controllers/api/index');
// const apiPosts = require('./controllers/api/posts');
const
user
=
require
(
'./controllers/user'
)
const
router
=
Router
();
const
API_VERSION
=
"/api/v1"
;
router
.
post
(
'/login'
,
system
.
login
);
router
.
post
(
`
${
API_VERSION
}
/login`
,
system
.
login
);
router
.
get
(
`
${
API_VERSION
}
/user/:type`
,
user
.
query
)
module
.
exports
=
router
;
src/App.vue
View file @
f0407c55
...
...
@@ -9,11 +9,27 @@
<
script
>
// Layout 为布局组件,控制页面基础布局,通过 slot 实现
// import Layout from '@/layouts';
// import { fetchCurrentUser } from './services/user';
// async function isUserLogged() {
// return (await fetchCurrentUser()).status === 'success';
// }
// function redirectToLogin() {
// const loginUrl = '//pandora.yidian-inc.com/tools/admin/login';
// const cbUrl = location.href;
// location.href = `${loginUrl}?callback=${cbUrl}`;
// }
export
default
{
// components: {
// Layout,
// },
// async mounted() {
// if (!(await isUserLogged())) {
// redirectToLogin();
// }
// },
};
</
script
>
...
...
src/components/PageHeader/index.vue
View file @
f0407c55
...
...
@@ -30,7 +30,7 @@ export default {
data
()
{
return
{
menuItems
,
basicPath
:
"/
app/op-management
"
,
basicPath
:
"/"
,
};
},
computed
:
{
...
...
src/pm2.json
0 → 100644
View file @
f0407c55
{
"apps"
:
[
{
"name"
:
"opwebservice"
,
"script"
:
"index.js"
,
"log_date_format"
:
"YYYY-MM-DD HH:mm Z"
,
"cwd"
:
"/home/worker/opservice.yidianzixun.com/htdocs"
,
"exec_mode"
:
"cluster"
,
"instances"
:
0
,
"error_file"
:
"/home/worker/opservice.yidianzixun.com/logs/opwebservice.err.log"
,
"out_file"
:
"/home/worker/opservice.yidianzixun.com/logs/opwebservice.out.log"
,
"max_memory_restart"
:
"1G"
,
"env"
:
{
"NODE_ENV"
:
"production"
,
"PORT"
:
"8055"
}
}
]
}
src/service/common.js
View file @
f0407c55
import
axios
from
'../utils/request'
;
export
async
function
userLogin
(
email
,
password
)
{
let
res
=
await
axios
.
post
(
`api/login`
,
{
let
res
=
await
axios
.
post
(
`api/
v1/
login`
,
{
email
,
password
,
authCode
:
''
});
return
res
.
data
;
...
...
src/service/user.js
View file @
f0407c55
import
axios
from
'../utils/request'
;
export
async
function
login
(
email
,
password
)
{
const
res
=
await
axios
.
post
(
`api/login`
,
{
const
res
=
await
axios
.
post
(
`api/
v1/
login`
,
{
email
,
password
,
authCode
:
''
});
return
res
.
data
;
...
...
vue.config.js
View file @
f0407c55
...
...
@@ -5,16 +5,18 @@ const isDev = process.env.NODE_ENV === 'development';
module
.
exports
=
{
outputDir
:
isDev
?
'./dist'
:
path
.
resolve
(
'../../../www/dist/
app/
'
),
publicPath
:
isDev
?
'
/
'
:
'/dist/'
,
:
path
.
resolve
(
'../../../www/dist/'
),
publicPath
:
isDev
?
''
:
'/dist/'
,
configureWebpack
:
{
devServer
:
{
proxy
:
{
'/api'
:
{
target
:
'http://localhost:8055'
,
changeOrigin
:
true
,
},
},
// proxy: {
// '/api': {
// target: 'http://localhost:8055',
// // pathRewrite: { '^/api': '/api/v1' },
// changeOrigin: true,
// },
// },
proxy
:
'http://localhost:8055'
},
},
chainWebpack
:
config
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment