diff --git a/.env.development b/.env.development index 0b8ba65..52675fb 100644 --- a/.env.development +++ b/.env.development @@ -2,6 +2,6 @@ ENV = 'development' # base api -VUE_APP_BASE_API = 'http://localhost:7600' +VUE_APP_BASE_API = 'http://localhost:7600/thli/jyjc/api' port = 6100 diff --git a/.env.production b/.env.production index 80c8103..76dc499 100644 --- a/.env.production +++ b/.env.production @@ -2,5 +2,6 @@ ENV = 'production' # base api -VUE_APP_BASE_API = '/prod-api' +VUE_APP_BASE_API = 'api' +#VUE_APP_BASE_API = 'test.soul2.cn/thli/jyjc/api' diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index ee92f32..dce6207 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -5,28 +5,28 @@
- -
- - -
- - - - Home - - - - Github - - - Docs - - - Log Out - - -
+ + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/router/index.js b/src/router/index.js index 128be0f..df775d5 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -112,6 +112,7 @@ export const constantRoutes = [ const createRouter = () => new Router({ mode: 'history', // require service support + base: '/thli/jyjc/', scrollBehavior: () => ({ y: 0 }), routes: constantRoutes }) diff --git a/src/settings.js b/src/settings.js index 56951bc..3efc555 100644 --- a/src/settings.js +++ b/src/settings.js @@ -1,6 +1,6 @@ module.exports = { - title: 'Vue Demo For Soul2', + title: 'jyjc-admin', /** * @type {boolean} true | false diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index c9f9420..d512852 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -1,6 +1,6 @@ diff --git a/src/views/qr/edit.vue b/src/views/qr/edit.vue index 5faed7d..347dbb2 100644 --- a/src/views/qr/edit.vue +++ b/src/views/qr/edit.vue @@ -74,7 +74,7 @@ export default { // 关闭 }, beforeSave() { - if (this.row.qrUrl != null && this.row.qrUrl !== this.edit.qrUrl) { + if (this.row && this.row.qrUrl != null && this.row.qrUrl !== this.edit.qrUrl) { this.$confirm('你更改了二维码Url,这可能带来一些意外的结果, 是否继续?', '警告', { confirmButtonText: '确定', cancelButtonText: '取消(维持原值)', diff --git a/src/views/qr/index.vue b/src/views/qr/index.vue index f83758b..1097a09 100644 --- a/src/views/qr/index.vue +++ b/src/views/qr/index.vue @@ -191,6 +191,7 @@ export default { .catch(() => { loading.close() }) + }).catch(r => { }) }, /* Base */ diff --git a/src/views/subject/edit.vue b/src/views/subject/edit.vue index 7e24c35..c15b770 100644 --- a/src/views/subject/edit.vue +++ b/src/views/subject/edit.vue @@ -123,11 +123,11 @@ export default { if (this.row !== null) { this.edit = JSON.parse(JSON.stringify(this.row)) // console.log(this.edit) + items({ id: this.row.id }).then(r => { + this.edit.items = r.data.items + // console.log('edit.items -> ', this.edit.items) + }) } - items({ id: this.row.id }).then(r => { - this.edit.items = r.data.items - console.log('edit.items -> ', this.edit.items) - }) }, methods: { handleRemoveItem(i) { @@ -147,13 +147,14 @@ export default { background: this.$elementGlobal.loadingBackground }) // 避免保存到空的选项 - this.edit.items = this.edit.items.filter(e => { - let empty = true - for (let key in e) { - if (key !== 'isRight' && e[key] != null) empty = false - } - return empty - }) + if (this.edit.items != null) { + this.edit.items = this.edit.items.filter(e => { + return e.content != null || e.points != null || e.weights != null + }) + } else { + this.edit.items = [] + } + // console.log('edit -> ', this.edit) saveOrUpdate(this.edit) .then(r => { loading.close() diff --git a/vue.config.js b/vue.config.js index 16d12c6..e57d7da 100644 --- a/vue.config.js +++ b/vue.config.js @@ -24,7 +24,7 @@ module.exports = { * In most cases please use '/' !!! * Detail: https://cli.vuejs.org/config/#publicpath */ - publicPath: '/', + publicPath: '/thli/jyjc/', outputDir: 'dist', assetsDir: 'static', lintOnSave: process.env.NODE_ENV === 'development', @@ -36,7 +36,7 @@ module.exports = { warnings: false, errors: true }, - before: require('./mock/mock-server.js') + // before: require('./mock/mock-server.js') }, configureWebpack: { // provide the app's title in webpack's name field, so that