mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-12 07:02:14 +08:00
1.7.2
This commit is contained in:
@@ -2,5 +2,5 @@
|
||||
ENV = 'production'
|
||||
|
||||
# base api
|
||||
VUE_APP_BASE_API = 'http://localhost:8082/api'
|
||||
VUE_APP_BASE_API = '/api'
|
||||
|
||||
|
@@ -15,10 +15,10 @@ npm install --registry=https://registry.npm.taobao.org
|
||||
npm run dev
|
||||
|
||||
# 打包发布
|
||||
npm run build
|
||||
npm run build:prod
|
||||
|
||||
# Build for production and view the bundle analyzer report
|
||||
npm run build --report
|
||||
npm run build:prod --report
|
||||
```
|
||||
|
||||
- 修改端口号:打开`vue.config.js`,找到`port`属性
|
||||
@@ -27,7 +27,5 @@ npm run build --report
|
||||
|
||||
如果想要把vue打包放到服务端,步骤如下:
|
||||
|
||||
- 打开`vue.config.js`,找到`build`下的`assetsPublicPath`参数,设置成'./'
|
||||
- 打开`.env.production`,配置`VUE_APP_BASE_API`参数,设置成'/api'
|
||||
- 执行`npm run build`进行打包,结果在dest下
|
||||
- 执行`npm run build:prod`进行打包,结果在dest下
|
||||
- 打包完成后,把dest中的所有文件,放到`sop-admin-server/src/main/resources/public`下
|
@@ -48,7 +48,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { validUsername } from '@/utils/validate'
|
||||
import md5 from 'js-md5'
|
||||
import { setToken } from '@/utils/auth'
|
||||
|
||||
@@ -56,8 +55,8 @@ export default {
|
||||
name: 'Login',
|
||||
data() {
|
||||
const validateUsername = (rule, value, callback) => {
|
||||
if (!validUsername(value)) {
|
||||
callback(new Error('请输入正确的用户名'))
|
||||
if (value.length === 0) {
|
||||
callback(new Error('请输入用户名'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ module.exports = {
|
||||
* In most cases please use '/' !!!
|
||||
* Detail: https://cli.vuejs.org/config/#publicpath
|
||||
*/
|
||||
publicPath: '/',
|
||||
publicPath: './',
|
||||
outputDir: 'dist',
|
||||
assetsDir: 'static',
|
||||
lintOnSave: process.env.NODE_ENV === 'development',
|
||||
|
Reference in New Issue
Block a user