@@ -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 | |||||
}) | |||||
} |
@@ -1,7 +1,6 @@ | |||||
import http from '@/http/api.js' | import http from '@/http/api.js' | ||||
// 获取token | // 获取token | ||||
const token = (tenantId, username, password, type) => { | |||||
export const token = (tenantId, username, password, type) => { | |||||
return http.request({ | return http.request({ | ||||
url: '/api/blade-auth/oauth/token', | url: '/api/blade-auth/oauth/token', | ||||
method: 'POST', | method: 'POST', | ||||
@@ -18,7 +17,7 @@ const token = (tenantId, username, password, type) => { | |||||
} | } | ||||
}) | }) | ||||
} | } | ||||
const getTenantId = (params) => { | |||||
export const getTenantId = (params) => { | |||||
return http.request({ | return http.request({ | ||||
url: '/api/blade-auth/oauth/getTenantId', | url: '/api/blade-auth/oauth/getTenantId', | ||||
method: 'get', | method: 'get', | ||||
@@ -28,7 +27,7 @@ const getTenantId = (params) => { | |||||
}) | }) | ||||
} | } | ||||
const refreshToken = (refresh_token, tenantId) => { | |||||
export const refreshToken = (refresh_token, tenantId) => { | |||||
return http.request({ | return http.request({ | ||||
url: '/api/blade-auth/oauth/token', | url: '/api/blade-auth/oauth/token', | ||||
method: 'post', | method: 'post', | ||||
@@ -45,7 +44,7 @@ const refreshToken = (refresh_token, tenantId) => { | |||||
} | } | ||||
// 获取用户信息 | // 获取用户信息 | ||||
const userInfo = () => { | |||||
export const userInfo = () => { | |||||
return http.request({ | return http.request({ | ||||
url: '/api/blade-user/info', | url: '/api/blade-user/info', | ||||
method: 'GET', | method: 'GET', | ||||
@@ -60,14 +59,8 @@ export const getUser = (id) => { | |||||
params: { 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({ | return http.request({ | ||||
url: '/api/blade-user/update-info', | url: '/api/blade-user/update-info', | ||||
method: 'post', | method: 'post', | ||||
@@ -75,7 +68,7 @@ const updateInfo = (row) => { | |||||
}) | }) | ||||
} | } | ||||
// 修改密码 | // 修改密码 | ||||
const updatePassword = (data) => { | |||||
export const updatePassword = (data) => { | |||||
return http.request({ | return http.request({ | ||||
url: '/api/blade-user/update-password', | url: '/api/blade-user/update-password', | ||||
method: 'post', | method: 'post', | ||||
@@ -83,20 +76,10 @@ const updatePassword = (data) => { | |||||
}) | }) | ||||
} | } | ||||
// 修改密码 | // 修改密码 | ||||
const passwordCheck = (data) => { | |||||
export const passwordCheck = (data) => { | |||||
return http.request({ | return http.request({ | ||||
url: '/api/blade-user/passwordCheck', | url: '/api/blade-user/passwordCheck', | ||||
method: 'post', | method: 'post', | ||||
params: data | params: data | ||||
}) | }) | ||||
} | } | ||||
export default { | |||||
token, | |||||
userInfo, | |||||
refreshToken, | |||||
getTenantId, | |||||
updatePassword, | |||||
updateInfo, | |||||
passwordCheck | |||||
} |
@@ -11,8 +11,7 @@ module.exports = { | |||||
// 应用logo,支持本地路径和网络路径 | // 应用logo,支持本地路径和网络路径 | ||||
logo: '/static/images/icon/logo.png', | logo: '/static/images/icon/logo.png', | ||||
// 版本号 | // 版本号 | ||||
version: '2.0.0', | |||||
version: '2.0.1', | |||||
version: '1.0.0', | |||||
@@ -5,7 +5,8 @@ | |||||
<u-popup :show="show" mode="center" :round="10" @close="close" @open="open"> | <u-popup :show="show" mode="center" :round="10" @close="close" @open="open"> | ||||
<view style="max-height: 800rpx;overflow-y: auto;"> | <view style="max-height: 800rpx;overflow-y: auto;"> | ||||
<u-radio-group v-model="value_" iconPlacement="right" placement="column" @change="change" borderBottom> | <u-radio-group v-model="value_" iconPlacement="right" placement="column" @change="change" borderBottom> | ||||
<u-radio v-for="(item,index) in options" :key="index" :label="item.label" :name="item.value"></u-radio> | |||||
<u-radio v-for="(item,index) in options" :key="index" :label="item.label" | |||||
:name="item.value"></u-radio> | |||||
</u-radio-group> | </u-radio-group> | ||||
</view> | </view> | ||||
</u-popup> | </u-popup> | ||||
@@ -48,9 +49,13 @@ | |||||
}; | }; | ||||
}, | }, | ||||
mounted() { | 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: { | methods: { | ||||
@@ -65,16 +70,14 @@ | |||||
this.show = false | this.show = false | ||||
}, | }, | ||||
open() { | 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 | this.show = true | ||||
}, | }, | ||||
change(e) { | change(e) { | ||||
this.$emit("input", e) | this.$emit("input", e) | ||||
this.$emit("change", e) | this.$emit("change", e) | ||||
let obj = this.options.find(e1 => e1.value == 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() | this.close() | ||||
}, | }, | ||||
} | } | ||||
@@ -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 | |||||
} |
@@ -34,10 +34,6 @@ export function createApp() { | |||||
} | } | ||||
// #endif | // #endif | ||||
// 接口集中管理 | |||||
import httpInstall from '@/http/install.js' | |||||
Vue.use(httpInstall, app) | |||||
import http from '@/http/api.js' | import http from '@/http/api.js' | ||||
Vue.prototype.$http = http | Vue.prototype.$http = http | ||||
@@ -37,6 +37,7 @@ | |||||
</template> | </template> | ||||
<script> | <script> | ||||
import {token} from '@/api/user.js' | |||||
export default { | export default { | ||||
data() { | data() { | ||||
return { | return { | ||||
@@ -70,6 +71,7 @@ | |||||
}, | }, | ||||
methods: { | methods: { | ||||
login() { | login() { | ||||
token() | |||||
this.$refs.uForm.validate(valid => { | this.$refs.uForm.validate(valid => { | ||||
if (!valid) return | if (!valid) return | ||||
this.isLoading = true | this.isLoading = true | ||||
@@ -45,8 +45,6 @@ const store = new Vuex.Store({ | |||||
}, | }, | ||||
accessToken: lifeData.accessToken ? lifeData.accessToken : '', | accessToken: lifeData.accessToken ? lifeData.accessToken : '', | ||||
isLogin: lifeData.isLogin ? lifeData.isLogin : false, | isLogin: lifeData.isLogin ? lifeData.isLogin : false, | ||||
// 如果version无需保存到本地永久存储,无需lifeData.version方式 | |||||
version: '1.0.0', | |||||
}, | }, | ||||
mutations: { | mutations: { | ||||
$uStore(state, payload) { | $uStore(state, payload) { | ||||