加上access_expire
This commit is contained in:
parent
18f82ac984
commit
4212dbda9b
|
|
@ -9,6 +9,9 @@ export default {
|
|||
if (rule.dataRule && rule.dataRule.type == "integer") {
|
||||
data[rule.field] = parseInt(value);
|
||||
}
|
||||
if (rule.dataRule && rule.dataRule.type == "timestamp") {
|
||||
data[rule.field] = parseInt(new Date(data[rule.field]).getTime() / 1000);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -13,12 +13,14 @@
|
|||
</a-select>
|
||||
</template>
|
||||
<template #beid="{ data }">
|
||||
<a-select v-model="data.beid" :disabled="isEdit" style="width: 100%">
|
||||
<a-select v-model="data.beid" v-if="!isEdit" style="width: 100%">
|
||||
<a-select-option v-for=" item in config_list" :key="item.id" :value="item.id">
|
||||
{{ item.title }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
|
||||
<div v-else>
|
||||
{{ currentConfigName || "无" }}
|
||||
</div>
|
||||
</template>
|
||||
<template #logo="{}">
|
||||
<div class="imagePanel">
|
||||
|
|
@ -80,6 +82,7 @@ export default {
|
|||
|
||||
companyTypeData: ['日用陶瓷厂', '卫浴工厂', '公司企业', '贸易公司', '其他'],
|
||||
config_list: [],
|
||||
currentConfigName: "",
|
||||
currentBeid: 0,
|
||||
|
||||
uploadDefaultImg: null,
|
||||
|
|
@ -150,6 +153,9 @@ export default {
|
|||
password: [
|
||||
{ required: true, message: '请输入管理员密码' }
|
||||
],
|
||||
access_expire: [
|
||||
{ required: true, message: '请输入登录过期截止时间' }
|
||||
],
|
||||
},
|
||||
|
||||
items: [
|
||||
|
|
@ -164,6 +170,10 @@ export default {
|
|||
{ field: 'appid', title: 'AppID', span: 24, itemRender: { name: '$input' } },
|
||||
{ field: 'appsecret', title: 'AppSecret', span: 24, itemRender: { name: '$input' } },
|
||||
{ field: 'token', title: '企业Token', span: 24, itemRender: { name: '$textarea', props: { placeholder: '不用填写' } } },
|
||||
{ field: 'access_expire', dataRule: { type: "timestamp" }, title: '登录过期截止时间', span: 24, itemRender: { name: '$input', props: {type:"date", placeholder: '输入登录过期截止时间' } } },
|
||||
|
||||
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
|
|
@ -246,8 +256,12 @@ export default {
|
|||
id: parseInt(dataId)
|
||||
}
|
||||
}).then(a => {
|
||||
if(a.data.BaseCompany.access_expire){
|
||||
a.data.BaseCompany.access_expire = new Date(a.data.BaseCompany.access_expire * 1000);
|
||||
}
|
||||
this.formOptions.data = a.data.BaseCompany;
|
||||
this.currentBeid = this.formOptions.data.beid;
|
||||
this.updateCurrentConfigName();
|
||||
console.log(this.currentBeid)
|
||||
}).catch((a) => {
|
||||
this.$mk.error(a.data.msg);
|
||||
|
|
@ -275,6 +289,7 @@ export default {
|
|||
}
|
||||
}).then(r => {
|
||||
this.config_list = r.list;
|
||||
this.updateCurrentConfigName();
|
||||
|
||||
this.config_list.splice(0, 0, { id: 0, title: "请选择" })
|
||||
});
|
||||
|
|
@ -283,6 +298,14 @@ export default {
|
|||
// 函数
|
||||
methods: {
|
||||
|
||||
updateCurrentConfigName() {
|
||||
this.config_list.forEach(item => {
|
||||
if (item.id == this.currentBeid) {
|
||||
this.currentConfigName = item.title;
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
selectFile() {
|
||||
this.$refs.imageInput.click();
|
||||
|
|
@ -410,12 +433,12 @@ export default {
|
|||
pageOptions: {
|
||||
config_id: this.currentBeid
|
||||
},
|
||||
pageMode:"select",
|
||||
pageMode: "select",
|
||||
width: 1000,
|
||||
height: 870,
|
||||
dataId: 0,
|
||||
callback: ({ data }) => {
|
||||
if(!data || !data.length){
|
||||
if (!data || !data.length) {
|
||||
return;
|
||||
}
|
||||
let ids = [];
|
||||
|
|
|
|||
|
|
@ -74,10 +74,10 @@ async function request(url, method, params, config) { // 请求方法
|
|||
function setAuthorization(auth, authType = AUTH_TYPE.BEARER) { // 设置认证信息
|
||||
switch (authType) {
|
||||
case AUTH_TYPE.BEARER:
|
||||
|
||||
console.log(auth)
|
||||
Cookie.set(xsrfHeaderName, 'Bearer ' + auth.token, {expires: auth.expireAt}) // 设置cookie中的认证信息// 设置axios请求头
|
||||
// 如果 xsrfHeaderName 存在于 cookie 中,则设置到 axios 的请求头中
|
||||
|
||||
console.log(Cookie.get(xsrfHeaderName))
|
||||
axios.defaults.headers.common[xsrfHeaderName] = Cookie.get(xsrfHeaderName)
|
||||
|
||||
break
|
||||
|
|
|
|||
Loading…
Reference in New Issue