Commit bbe1ae77 authored by Qingyu Deng's avatar Qingyu Deng

fix: people with look authentication is auditable

parent f2f66762
import { render } from "@testing-library/vue";
import ExaminePage from "..";
import { getApplyList } from "@/service/Withdrawal/withdrawal";
import store from "@/store";
jest.mock("@/service/Withdrawal/withdrawal");
it("should not enable audition for people without such privilege", () => {
const $route = {
path: "/op/withdrawal/examine"
};
getApplyList.mockResolvedValue({
code: 0,
status: "success",
result: {
list: [
{
withdraw_apply_id: "21072711253403105009",
wallet_id: "21072214560673105003",
user_id: 510227177373,
amount: "6.00",
withdraw_apply_status: 0,
withdraw_audit_time: "2021-07-27 11:25:34",
refuse_reason: "",
audit_user_name: "",
create_time: "2021-07-27 11:25:34",
lately_amount: "0.00",
id: "21072711253403105009",
city_name: "简网员工",
lately_share: 0,
lately_download: 0,
history_share: 52,
history_download: 0,
history_download_keep: "0%",
status_text: "待审核"
}
],
count: 1
}
});
const { getByText } = render(ExaminePage, {
store,
global: {
mocks: {
$route,
$store: {
getters: {
moduleSubPermissions: jest.fn().mockReturnValue(true)
}
}
}
}
});
getByText("审核");
});
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
></el-table-column> ></el-table-column>
<!-- 操作快捷键 --> <!-- 操作快捷键 -->
<el-table-column label="操作" align="center" fixed="right" width="200"> <el-table-column label="操作" align="center" fixed="right" width="200">
<template #default="scope"> <template v-slot:default="scope">
<el-button <el-button
type="text" type="text"
@click="handleDetail('look', scope.row.id)" @click="handleDetail('look', scope.row.id)"
...@@ -221,8 +221,8 @@ ...@@ -221,8 +221,8 @@
label="分享用户量" label="分享用户量"
width="120" width="120"
> >
<template #default="scope"> <template v-slot:default="scope">
<span>{{ "+" + scope.row.amount }}</span> <span>{{ scope ? "+" + scope.row.amount : null }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -266,7 +266,7 @@ import { ...@@ -266,7 +266,7 @@ import {
getApplyDetail, getApplyDetail,
getFreezingFund, getFreezingFund,
getRolesForUser, getRolesForUser,
} from "../../../service/Withdrawal/withdrawal"; } from "@/service/Withdrawal/withdrawal";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { fetchCurrentUser } from "../../../service/user"; import { fetchCurrentUser } from "../../../service/user";
...@@ -332,7 +332,6 @@ export default { ...@@ -332,7 +332,6 @@ export default {
}, },
async mounted() { async mounted() {
const res = await this.getPermissionsAll(); const res = await this.getPermissionsAll();
console.log(res);
if (!res) { if (!res) {
this.$router.push({ name: "Forbidden" }); this.$router.push({ name: "Forbidden" });
...@@ -532,7 +531,7 @@ export default { ...@@ -532,7 +531,7 @@ export default {
(item) => item.id === AUDIT_PERMSSION_ID (item) => item.id === AUDIT_PERMSSION_ID
); );
return !!auditPermission; return auditPermission.length !== 0;
}, },
}, },
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment