添加用户token刷新功能
continuous-integration/drone/push Build is passing Details

pull/1/head
kelvin 3 years ago
parent 225e3ee40f
commit d8eb2d8c36

@ -42,3 +42,11 @@ export function delApiToken(id) {
method: 'delete' method: 'delete'
}) })
} }
// 刷新令牌管理
export function flushApiToken(id) {
return request({
url: '/cert/apiToken/flush/' + id,
method: 'get'
})
}

@ -90,6 +90,15 @@
v-hasPermi="['cert:apiToken:export']" v-hasPermi="['cert:apiToken:export']"
>导出</el-button> >导出</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
plain
icon="Refresh"
:disabled="multiple"
@click="handleFlush"
v-hasPermi="['cert:apiToken:remove']"
>刷新TOKEN</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@ -214,7 +223,7 @@
</template> </template>
<script setup name="ApiToken"> <script setup name="ApiToken">
import { listApiToken, getApiToken, delApiToken, addApiToken, updateApiToken } from "@/api/cert/apiToken"; import { listApiToken, getApiToken, delApiToken, addApiToken, updateApiToken, flushApiToken } from "@/api/cert/apiToken";
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const { sys_del_flag, sys_yes_no, sys_normal_disable } = proxy.useDict('sys_del_flag', 'sys_yes_no', 'sys_normal_disable'); const { sys_del_flag, sys_yes_no, sys_normal_disable } = proxy.useDict('sys_del_flag', 'sys_yes_no', 'sys_normal_disable');
@ -373,6 +382,16 @@ function handleDelete(row) {
}).catch(() => {}); }).catch(() => {});
} }
function handleFlush (row) {
const _ids = row.id || ids.value;
proxy.$modal.confirm('是否确认刷新令牌管理编号为"' + _ids + '"的数据项?').then(function() {
return flushApiToken(_ids);
}).then(() => {
getList();
proxy.$modal.msgSuccess("刷新成功");
}).catch(() => {});
}
/** 导出按钮操作 */ /** 导出按钮操作 */
function handleExport() { function handleExport() {
proxy.download('cert/apiToken/export', { proxy.download('cert/apiToken/export', {

Loading…
Cancel
Save