| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- export const ossUrl = 'http://oss-card.colormaprun.com/card/';
- // export const apiServer = 'https://colormaprun.com/api/card/'; // 正式版
- // export const token = '';
- export const apiServer = 'https://t-mapi.colormaprun.com/api/card/'; // 测试版
- export const token = '1ea8fb7c1eb3259a9b1055cc68c1d435';
- // export const token = '3ea08be20abc5f8dfee4a11b32606bc3';
- // export const token = '---';
- // 卡片基本信息查询
- export const apiCardBaseQuery = apiServer + 'CardBaseQuery';
- // 卡片对应活动或赛事详情查询
- export const apiCardDetailQuery = apiServer + 'CardDetailQuery';
- // 排名查询
- export const apiCardRankDetailQuery = apiServer + 'CardRankDetailQuery';
- // 用户是否已经报名卡片对应赛事查询
- export const apiUserJoinCardQuery = apiServer + 'UserJoinCardQuery';
- // 线上赛报名页面信息详情
- export const apiOnlineMcSignUpDetail = apiServer + 'OnlineMcSignUpDetail';
- // 线上赛报名(重新分组)
- export const apiOnlineMcSignUp = apiServer + 'OnlineMcSignUp';
- // 玩家当前月挑战记录查询
- export const apiCurrentMonthlyChallengeQuery = apiServer + 'CurrentMonthlyChallengeQuery';
- // 卡片配置信息查询
- export const apiCardConfigQuery = apiServer + 'CardConfigQuery';
- // 检测request的返回值
- export function checkResCode(res) {
- if (res.data.code == 0) {
- return true;
- } else if (res.statusCode == 401) { // 未登录
- uni.showToast({
- title: `您尚未登录`,
- icon: 'none',
- duration: 3000
- });
- window.location.href = `action://to_login/`;
- return false;
- } else {
- uni.showToast({
- title: `${res.data.message}`,
- icon: 'none',
- duration: 3000
- });
- return false;
- }
- };
- // 检测token
- export function checkToken(token) {
- const regex = /^[0-9A-Za-f]{32}$/;
- if (regex.test(token)) {
- return true;
- } else { // 未登录
- console.log('checkToken err: ', token);
- uni.showToast({
- title: `您尚未登录`,
- icon: 'none',
- duration: 3000
- });
- window.location.href = `action://to_login/`;
- return false;
- }
- };
|