Style(首页):去掉定位授权服务

This commit is contained in:
lifizer
2023-12-25 16:35:55 +08:00
parent f9a364ace1
commit 847a80f251
3 changed files with 1 additions and 79 deletions
+1 -1
View File
@@ -16,6 +16,6 @@ export function fetchStore(page, cityName, name) {
* */
export function fetchCity(type) {
return request.get(`/wenwan/cityList/${type}`, {}, {
login: true
login: false
})
}
-71
View File
@@ -306,7 +306,6 @@
<script>
import {mapActions, mapGetters} from 'vuex';
import {formatDateTime} from "@/utils";
import config from '@/utils/mapConfig';
import PromotionGood from '@/components/PromotionGood';
import CouponWindow from '@/components/CouponWindow';
@@ -523,8 +522,6 @@ export default {
this.getUnreadMsgList();
}
//定位
this.getCurAddress();
this.init();
//获取团购商品
this.getGroupGoods();
@@ -671,74 +668,6 @@ export default {
msgConfirm: function () {
that.$refs.popup.close();
},
//获取当前定位地址
getCurAddress() {
let that = this;
uni.getLocation({
type: 'wgs84',
success: function (res) {
let latitude = res.latitude;
let longitude = res.longitude;
that.setLocation({
'latitude': latitude + '',
'longitude': longitude + ''
});
// #ifdef H5
Vue.jsonp(
'https://apis.map.qq.com/ws/geocoder/v1/?location=' + latitude + ',' +
longitude + '&key=' +
config.key, {
//callbackName: 'QQmap',
output: 'jsonp',
}).then(json => {
// Success.
// uni.hideLoading();
that.cityName = json.result.ad_info.city;
//定位成功刷新数据
//if (that.activeIndex==0) {
that.getHotelList();
that.getShopList();
that.getRestaurantList();
//}
}).catch(err => {
// Failed.
})
// #endif
// #ifndef H5
uni.request({
url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=' + latitude + ',' +
longitude +
'&key=' + config.key,
success: function (res) {
const address = res.data.result.ad_info
that.cityName = address.city;
let location = address.province + address.city + address.district;
uni.setStorageSync("location", location)
//定位成功刷新数据
//if (that.activeIndex==0) {
that.getHotelList();
that.getShopList();
that.getRestaurantList();
//}
},
fail: function (res) {
},
complete: function () {
}
});
// #endif
},
fail: function (err) {
console.log("home getCurAddress", err)
}
});
},
getHotelList: function () {
let that = this;
-7
View File
@@ -44,13 +44,6 @@ function baseRequest(options) {
Authorization: "Bearer " + token
}
// 如果需要登录才可访问的接口没有拿到 token 视为登录失效
if (options.login === true && !token) {
// 跳转到登录或授权页面
handleLoginFailure();
// 提示错误信息
return Promise.reject({ msg: "未登录", toLogin: true });
}
// 结构请求需要的参数
const { url, params, data, login, ...option } = options