lin
2024-03-27 5f0bb8ff3e1d84af08fc62b00244f9d9fe598b72
请求头设置判断是否居民
1 files modified
5 ■■■■■ changed files
http/api.js 5 ●●●●● patch | view | raw | blame | history
http/api.js
@@ -27,8 +27,13 @@
    if (accessToken) {
        config.header['Blade-Auth'] = 'bearer ' + accessToken;
        config.header['roleName'] = uni.getStorageSync("activeRole").roleAlias || "";
        let activeRole = uni.getStorageSync("activeRole")
        if (activeRole.roleAlias === 'inhabitant') {
            config.header['communityCode'] = uni.getStorageSync("siteInfo").neiCode || ""
        } else {
        config.header['communityCode'] = uni.getStorageSync("siteInfo").id || ""
    }
    }
    if (config.params.tenantId) {
        config.header['Tenant-Id'] = config.params.tenantId;
    }