单位二维码生成调整

This commit is contained in:
joylink_fanyuhong 2021-12-31 10:03:18 +08:00
parent a7c56b3592
commit 9dcb9669aa
3 changed files with 23 additions and 11 deletions

View File

@ -309,3 +309,10 @@ export function getUserDuration(params) {
params
});
}
/** 获取单位二维码 */
export function getCompanyQrCode(orgId) {
return request({
url: `/api/company/${orgId}/qrCode`,
method: 'get'
});
}

View File

@ -4,7 +4,7 @@ const publicPath = process.env.VUE_APP_PRO == 'local' ? '' : '/cbtc';
export const JL3D_LOCAL_STATIC = publicPath+"/static";
const BASE_UPLOAD_API = store.state.user.uploadUrl;
export const BASE_ASSET_API = this.$store.user.state.resourcesUrl;
// export const BASE_ASSET_API = this.$store.user.state.resourcesUrl;
// console.log(JL3D_LOCAL_STATIC);
// console.log(BASE_UPLOAD_API);
// console.log(BASE_ASSET_API);

View File

@ -7,7 +7,7 @@
</template>
<script>
import { getCompanyListPaging, deleteCompany } from '@/api/company';
import { getCompanyListPaging, deleteCompany, getCompanyQrCode } from '@/api/company';
import EditCompany from './add';
import QrCode from '@/components/QrCode';
import { ProjectList } from '@/scripts/ProjectConfig';
@ -126,15 +126,20 @@ export default {
this.$router.push({ path: `/system/companyManage/orgDetail`, query: { orgId: row.id } });
},
handleGenerateQrCode(index, row) {
let state = 2;
if (process.env.NODE_ENV === 'production') {
state = 3;
}
const param = {
url: `https://joylink.club/oss/joylink/company?state=${state}_${row.id}`,
title: '单位二维码'
};
this.$refs.qrCode.doShow(param);
// let state = 2;
// if (process.env.NODE_ENV === 'production') {
// state = 3;
// }
getCompanyQrCode(row.id).then(resp => {
const param = {
url: resp.data,
title: '单位二维码'
};
this.$refs.qrCode.doShow(param);
}).catch(() => {
this.$message.error('获取单位二维码失败!');
});
}
}
};