Skip to content

Commit 24a0cbc

Browse files
committed
fix(view): 基础配置
1 parent a8c51ce commit 24a0cbc

File tree

6 files changed

+62
-27
lines changed

6 files changed

+62
-27
lines changed

admin/.env.development

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
ENV = 'development'
33

44
# base api
5-
VUE_APP_BASE_API = '/dev-api'
5+
VUE_APP_BASE_API = 'http://127.0.0.1:8000'
66

77
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
88
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
@@ -12,3 +12,4 @@ VUE_APP_BASE_API = '/dev-api'
1212
# Detail: https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js
1313

1414
VUE_CLI_BABEL_TRANSPILE_MODULES = true
15+
VUE_APP_WEBSOCKET: '"ws://127.0.0.1:5200"',

admin/.env.production

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
ENV = 'production'
33

44
# base api
5-
VUE_APP_BASE_API = '/prod-api'
5+
VUE_APP_BASE_API = 'https://www.guke1.com'
6+
VUE_APP_WEBSOCKET: '"wss://www.guke1.com/ws"',
67

admin/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ npm install --registry=https://registry.npm.taobao.org
4747
npm run dev
4848
```
4949

50-
浏览器访问 [http://localhost:9528](http://localhost:9528)
50+
浏览器访问 [http://localhost:/task9090](http://localhost:/task9090)
5151

5252
## 发布
5353

admin/src/api/user.js

Lines changed: 53 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,69 @@
11
import request from '@/utils/request'
22

3-
export function login(data) {
4-
return request({
5-
url: '/user/login',
6-
method: 'post',
7-
data
8-
})
3+
export function login(userInfo) {
4+
return request.post('/api/user/login', userInfo)
95
}
106

117
export function getInfo(token) {
128
return request({
13-
url: '/user/info',
9+
url: '/api/user/info',
1410
method: 'get',
1511
params: { token }
1612
})
1713
}
1814

1915
export function logout() {
2016
return request({
21-
url: '/user/logout',
17+
url: '/api/user/logout',
2218
method: 'post'
2319
})
2420
}
21+
22+
// import { getRoute, setRoute } from '@/utils/auth'
23+
export function route(token) {
24+
return request.get('/api/routes', token)
25+
}
26+
27+
export function getList(params) {
28+
return request({
29+
url: '/api/user',
30+
method: 'get',
31+
params
32+
})
33+
}
34+
35+
export function getRole() {
36+
return request.get('/api/permissions/create')
37+
}
38+
39+
export function postAdd(params) {
40+
return request.post('/api/user', params)
41+
}
42+
43+
export function edit(id) {
44+
return request.get('/api/user/' + id)
45+
}
46+
47+
export function postEdit(id, params) {
48+
return request.patch('/api/user/' + id, params)
49+
}
50+
51+
export function deleteAct(id) {
52+
return request.delete('/api/user/' + id)
53+
}
54+
55+
export function postEditPassword(params) {
56+
return request.post('/api/user_password', params)
57+
}
58+
59+
/**
60+
* 搜索 api_param
61+
* @param params
62+
*/
63+
export function search(params) {
64+
return request({
65+
url: '/api/api_user_search',
66+
method: 'get',
67+
params
68+
})
69+
}

admin/src/settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22

3-
title: 'Vue Admin Template',
3+
title: 'Laravel-vue-admin 后台管理系统',
44

55
/**
66
* @type {boolean} true | false

admin/vue.config.js

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ const name = defaultSettings.title || 'vue Admin Template' // page title
1212
// use administrator privileges to execute the command line.
1313
// For example, Mac: sudo npm run
1414
// You can change the port by the following methods:
15-
// port = 9528 npm run dev OR npm run dev --port = 9528
16-
const port = process.env.port || process.env.npm_config_port || 9528 // dev port
15+
// port = /task9090 npm run dev OR npm run dev --port = /task9090
16+
const port = process.env.port || process.env.npm_config_port || 9090 // dev port
1717

1818
// All configuration item explanations can be find in https://cli.vuejs.org/config/
1919
module.exports = {
@@ -35,19 +35,7 @@ module.exports = {
3535
overlay: {
3636
warnings: false,
3737
errors: true
38-
},
39-
proxy: {
40-
// change xxx-api/login => mock/login
41-
// detail: https://cli.vuejs.org/config/#devserver-proxy
42-
[process.env.VUE_APP_BASE_API]: {
43-
target: `http://127.0.0.1:${port}/mock`,
44-
changeOrigin: true,
45-
pathRewrite: {
46-
['^' + process.env.VUE_APP_BASE_API]: ''
47-
}
48-
}
49-
},
50-
after: require('./mock/mock-server.js')
38+
}
5139
},
5240
configureWebpack: {
5341
// provide the app's title in webpack's name field, so that

0 commit comments

Comments
 (0)