| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- export const ossUrl = process.env.OSS_URL;
- export const apiServer = process.env.API_BASE_URL;
- export const token = '';
- // export const token = '96ba3c924394934f7d30fa869a94ce0d';
- // export const token = '8f929ad2fcd37d2eff5c54967dd7c899';
- // 根据游戏id查询卡片信息
- export const apiCardUrlQuery = apiServer + 'CardUrlQuery';
- // 查询赛事结束显示信息
- export const apiMatchFininshInfoQuery = apiServer + 'MatchFininshInfoQuery';
- import tools from '/common/tools';
- // 检测request的返回值
- export function checkResCode(res) {
- if (res.data.code == 0) {
- return true;
- } else if (res.statusCode == 401) { // 未登录
- uni.showToast({
- title: `您尚未登录`,
- icon: 'none',
- duration: 3000
- });
-
- const url = `action://to_login/`;
- tools.appAction(url);
- 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
- });
-
- const url = `action://to_login/`;
- tools.appAction(url);
- return false;
- }
- };
|