提交
This commit is contained in:
parent
e48ead4474
commit
e1c07a1789
|
|
@ -54,6 +54,7 @@ class ConfigManager {
|
|||
|
||||
isLoading = true;
|
||||
loadPromise = new Promise((resolve, reject) => {
|
||||
|
||||
RequestManager.get('config')
|
||||
.then(res => {
|
||||
if (res.status === 1 && res.data) {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,24 @@ import EnvConfig from '@/common/env.js'
|
|||
import md5 from 'js-md5'
|
||||
|
||||
class RequestManager {
|
||||
/**
|
||||
* 判断URL是否在白名单中
|
||||
* @param {String} url 请求地址
|
||||
* @returns {Boolean} 是否在白名单中
|
||||
*/
|
||||
static isUrlInWhitelist(url) {
|
||||
// 白名单URL列表
|
||||
const whitelistUrls = [
|
||||
'login_record',
|
||||
'api/warehouse_index',
|
||||
'api/user',
|
||||
'api/warehouse_send_record'
|
||||
]
|
||||
|
||||
// 检查URL是否包含白名单中的任一项
|
||||
return whitelistUrls.some(whiteItem => url.indexOf(whiteItem) > -1)
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送网络请求
|
||||
* @param {Object} param 请求参数
|
||||
|
|
@ -21,7 +39,7 @@ class RequestManager {
|
|||
* @returns {Promise} 返回请求Promise
|
||||
*/
|
||||
static request(param, backpage, backtype) {
|
||||
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
// 参数检查
|
||||
if (!param || typeof param !== 'object') {
|
||||
|
|
@ -189,7 +207,8 @@ class RequestManager {
|
|||
}
|
||||
}
|
||||
console.log(requestUrl);
|
||||
if (requestUrl.indexOf('login_record') > -1) {
|
||||
if (RequestManager.isUrlInWhitelist(requestUrl)) {
|
||||
|
||||
reject(res.data)
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
</view>
|
||||
<!-- 赏品列表内容 -->
|
||||
<view class="res-list" v-else>
|
||||
<detail-list-item v-for="(item, i) in children" :key="item.id || i" :item="item" imageHeight="180rpx"
|
||||
<detail-list-item v-for="(item, i) in children" :key="i" :item="item" imageHeight="180rpx"
|
||||
@click="handleItemClick" />
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name" : "友达赏",
|
||||
"appid" : "__UNI__2E6CB39",
|
||||
"appid" : "__UNI__0BC0425",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.1",
|
||||
"versionCode" : 101,
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -7,7 +7,7 @@
|
|||
</view>
|
||||
<view class="content">
|
||||
<view>申请获取以下权限</view>
|
||||
<text style="color: #979797;">获得你的公开信息(昵称,头像、地区等)</text>
|
||||
<text style="color: #979797;">获得你的公开信息</text>
|
||||
</view>
|
||||
|
||||
<view @click="isAgree = !isAgree" class="agree">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user