From eb7c6f77a781595590a2cd7396447c35550fb895 Mon Sep 17 00:00:00 2001 From: yxq Date: Mon, 2 Sep 2024 14:27:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E4=BB=B6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- monitorMobile/api/student/home/index.js | 10 -------- monitorMobile/api/user.js | 31 ++++++------------------ monitorMobile/common/setting.js | 3 +-- monitorMobile/components/selectRadio.vue | 19 +++++++++------ monitorMobile/http/install.js | 18 -------------- monitorMobile/main.js | 4 --- monitorMobile/pages/login.vue | 2 ++ monitorMobile/store/index.js | 2 -- 8 files changed, 21 insertions(+), 68 deletions(-) delete mode 100644 monitorMobile/api/student/home/index.js delete mode 100644 monitorMobile/http/install.js diff --git a/monitorMobile/api/student/home/index.js b/monitorMobile/api/student/home/index.js deleted file mode 100644 index 8214444..0000000 --- a/monitorMobile/api/student/home/index.js +++ /dev/null @@ -1,10 +0,0 @@ - -import http from '@/http/api.js' -// 获取校历事件数据 -export const getSchoolCalendarlist = (params) => { - return http.request({ - url: '/api/blade-basic-data/semester/schoolCalendarlist', - method: 'get', - params - }) -} \ No newline at end of file diff --git a/monitorMobile/api/user.js b/monitorMobile/api/user.js index 5b96804..f3df701 100644 --- a/monitorMobile/api/user.js +++ b/monitorMobile/api/user.js @@ -1,7 +1,6 @@ import http from '@/http/api.js' - // 获取token -const token = (tenantId, username, password, type) => { +export const token = (tenantId, username, password, type) => { return http.request({ url: '/api/blade-auth/oauth/token', method: 'POST', @@ -18,7 +17,7 @@ const token = (tenantId, username, password, type) => { } }) } -const getTenantId = (params) => { +export const getTenantId = (params) => { return http.request({ url: '/api/blade-auth/oauth/getTenantId', method: 'get', @@ -28,7 +27,7 @@ const getTenantId = (params) => { }) } -const refreshToken = (refresh_token, tenantId) => { +export const refreshToken = (refresh_token, tenantId) => { return http.request({ url: '/api/blade-auth/oauth/token', method: 'post', @@ -45,7 +44,7 @@ const refreshToken = (refresh_token, tenantId) => { } // 获取用户信息 -const userInfo = () => { +export const userInfo = () => { return http.request({ url: '/api/blade-user/info', method: 'GET', @@ -60,14 +59,8 @@ export const getUser = (id) => { params: { id } }) } -export const getUserInfo = () => { - return http.request({ - url: '/api/blade-user/info', - method: 'get', - }) -} /* 修改用户信息 */ -const updateInfo = (row) => { +export const updateInfo = (row) => { return http.request({ url: '/api/blade-user/update-info', method: 'post', @@ -75,7 +68,7 @@ const updateInfo = (row) => { }) } // 修改密码 -const updatePassword = (data) => { +export const updatePassword = (data) => { return http.request({ url: '/api/blade-user/update-password', method: 'post', @@ -83,20 +76,10 @@ const updatePassword = (data) => { }) } // 修改密码 -const passwordCheck = (data) => { +export const passwordCheck = (data) => { return http.request({ url: '/api/blade-user/passwordCheck', method: 'post', params: data }) } - -export default { - token, - userInfo, - refreshToken, - getTenantId, - updatePassword, - updateInfo, - passwordCheck -} diff --git a/monitorMobile/common/setting.js b/monitorMobile/common/setting.js index 0e8be9e..8db6a83 100644 --- a/monitorMobile/common/setting.js +++ b/monitorMobile/common/setting.js @@ -11,8 +11,7 @@ module.exports = { // 应用logo,支持本地路径和网络路径 logo: '/static/images/icon/logo.png', // 版本号 - version: '2.0.0', - version: '2.0.1', + version: '1.0.0', diff --git a/monitorMobile/components/selectRadio.vue b/monitorMobile/components/selectRadio.vue index ea8e33f..832f2fa 100644 --- a/monitorMobile/components/selectRadio.vue +++ b/monitorMobile/components/selectRadio.vue @@ -5,7 +5,8 @@ - + @@ -48,9 +49,13 @@ }; }, mounted() { - if (this.value) { - let obj = this.options.find(e1 => e1.value == this.value) - if (obj) this.title_ = obj.label + this.value_ = this.value + if (this.value_) { + let obj = this.options.find(e1 => e1.value == this.value_) + this.title_ = obj?obj.label:'' + this.$emit("update:title", this.title_) + }else{ + this.$emit("update:title", '') } }, methods: { @@ -65,16 +70,14 @@ this.show = false }, open() { - let obj = this.options.find(e1 => e1.value == this.value) - this.title_ = obj ? obj.label : this.placeholder - this.value_ = this.value this.show = true }, change(e) { this.$emit("input", e) this.$emit("change", e) let obj = this.options.find(e1 => e1.value == e) - this.title_ = obj ? obj.label : this.placeholder + this.title_ = obj.label + this.$emit("update:title", this.title_) this.close() }, } diff --git a/monitorMobile/http/install.js b/monitorMobile/http/install.js deleted file mode 100644 index 9deb318..0000000 --- a/monitorMobile/http/install.js +++ /dev/null @@ -1,18 +0,0 @@ -// 获取api目录所有js文件 -const files = require.context('@/api', false, /\.js$/) -// 此处第二个参数vm,就是我们在页面使用的this,可以通过vm获取vuex等操作 -const install = (Vue, vm) => { - // 将各个定义的接口名称,统一放进对象挂载到vm.$u.api下(因为vm就是this,也即this.$u.api) - // 自动将所有api挂载到vm.$u.api中 - vm.$u.api = {} - files.keys().forEach(key => { - const api = files(key).default - for (let item in api) { - vm.$u.api[item] = api[item] - } - }) -} - -export default { - install -} diff --git a/monitorMobile/main.js b/monitorMobile/main.js index 63afaab..587410e 100644 --- a/monitorMobile/main.js +++ b/monitorMobile/main.js @@ -34,10 +34,6 @@ export function createApp() { } // #endif -// 接口集中管理 -import httpInstall from '@/http/install.js' -Vue.use(httpInstall, app) - import http from '@/http/api.js' Vue.prototype.$http = http diff --git a/monitorMobile/pages/login.vue b/monitorMobile/pages/login.vue index 4d0dc1a..8f5b7ae 100644 --- a/monitorMobile/pages/login.vue +++ b/monitorMobile/pages/login.vue @@ -37,6 +37,7 @@