合并master
This commit is contained in:
commit
b7461002dc
@ -5,8 +5,8 @@ VITE_APP_TITLE='uniapp-vue3-project'
|
|||||||
VITE_APP_ENV='development'
|
VITE_APP_ENV='development'
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
#VITE_APP_BASE_API='https://apidev.lakeapp.cn/'
|
VITE_APP_BASE_API='https://apidev.lakeapp.cn/'
|
||||||
VITE_APP_BASE_API='https://api.lakeapp.cn/'
|
#VITE_APP_BASE_API='https://api.lakeapp.cn/'
|
||||||
|
|
||||||
# 删除console
|
# 删除console
|
||||||
VITE_DROP_CONSOLE=false
|
VITE_DROP_CONSOLE=false
|
||||||
|
@ -5,7 +5,7 @@ VITE_APP_TITLE='uniapp-vue3-project'
|
|||||||
VITE_APP_ENV='production'
|
VITE_APP_ENV='production'
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
VITE_APP_BASE_API='http://api.lakeapp.cn/'
|
VITE_APP_BASE_API='https://api.lakeapp.cn/'
|
||||||
|
|
||||||
# 删除console
|
# 删除console
|
||||||
VITE_DROP_CONSOLE=true
|
VITE_DROP_CONSOLE=true
|
||||||
|
30
package.json
30
package.json
@ -22,10 +22,10 @@
|
|||||||
"dayjs": "^1.11.10",
|
"dayjs": "^1.11.10",
|
||||||
"pinia": "2.0.36",
|
"pinia": "2.0.36",
|
||||||
"pinia-plugin-persistedstate": "^3.2.1",
|
"pinia-plugin-persistedstate": "^3.2.1",
|
||||||
"uview-plus": "^3.1.38",
|
"uview-plus": "^3.1.41",
|
||||||
"vue": "3.4.21",
|
"vue": "3.4.21",
|
||||||
"vue-i18n": "^9.9.0",
|
"vue-i18n": "^9.9.0",
|
||||||
"z-paging": "^2.6.2"
|
"z-paging": "^2.6.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@antfu/eslint-config": "1.1.0",
|
"@antfu/eslint-config": "1.1.0",
|
||||||
@ -34,34 +34,34 @@
|
|||||||
"@dcloudio/uni-cli-shared": "3.0.0-4000820240401001",
|
"@dcloudio/uni-cli-shared": "3.0.0-4000820240401001",
|
||||||
"@dcloudio/uni-stacktracey": "3.0.0-4000820240401001",
|
"@dcloudio/uni-stacktracey": "3.0.0-4000820240401001",
|
||||||
"@dcloudio/vite-plugin-uni": "3.0.0-4000820240401001",
|
"@dcloudio/vite-plugin-uni": "3.0.0-4000820240401001",
|
||||||
"@types/node": "^20.8.10",
|
"@types/node": "^20.10.3",
|
||||||
"@typescript-eslint/parser": "^6.10.0",
|
"@typescript-eslint/parser": "^6.13.1",
|
||||||
"@uni-helper/uni-app-types": "^0.5.9",
|
"@uni-helper/uni-app-types": "^0.5.12",
|
||||||
"@unocss/eslint-plugin": "^0.57.2",
|
"@unocss/eslint-plugin": "^0.57.7",
|
||||||
"@vue/runtime-core": "^3.4.21",
|
"@vue/runtime-core": "^3.4.21",
|
||||||
"@vue/tsconfig": "^0.4.0",
|
"@vue/tsconfig": "^0.4.0",
|
||||||
"czg": "^1.7.1",
|
"czg": "^1.7.1",
|
||||||
"eslint": "^8.53.0",
|
"eslint": "^8.55.0",
|
||||||
"lint-staged": "^15.0.2",
|
"lint-staged": "^15.2.0",
|
||||||
"miniprogram-ci": "^1.9.8",
|
"miniprogram-ci": "^1.9.10",
|
||||||
"picocolors": "^1.0.0",
|
"picocolors": "^1.0.0",
|
||||||
"postcss-html": "^1.5.0",
|
"postcss-html": "^1.5.0",
|
||||||
"postcss-scss": "^4.0.9",
|
"postcss-scss": "^4.0.9",
|
||||||
"sass": "^1.69.5",
|
"sass": "^1.69.5",
|
||||||
"simple-git-hooks": "^2.9.0",
|
"simple-git-hooks": "^2.9.0",
|
||||||
"stylelint": "^15.11.0",
|
"stylelint": "^15.11.0",
|
||||||
"stylelint-config-recess-order": "^4.3.0",
|
"stylelint-config-recess-order": "^4.4.0",
|
||||||
"stylelint-config-standard": "^34.0.0",
|
"stylelint-config-standard": "^34.0.0",
|
||||||
"stylelint-config-standard-vue": "^1.0.0",
|
"stylelint-config-standard-vue": "^1.0.0",
|
||||||
"stylelint-order": "^6.0.3",
|
"stylelint-order": "^6.0.3",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.3.2",
|
||||||
"unocss": "^0.57.2",
|
"unocss": "^0.57.7",
|
||||||
"unocss-applet": "^0.7.7",
|
"unocss-applet": "^0.7.8",
|
||||||
"unplugin-auto-import": "^0.16.7",
|
"unplugin-auto-import": "^0.16.7",
|
||||||
"unplugin-vue-components": "^0.25.2",
|
"unplugin-vue-components": "^0.25.2",
|
||||||
"vite": "^4.5.2",
|
"vite": "^4.5.3",
|
||||||
"vite-plugin-imagemin": "^0.6.1",
|
"vite-plugin-imagemin": "^0.6.1",
|
||||||
"vue-tsc": "^1.8.22"
|
"vue-tsc": "^1.8.24"
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"src/**/*.{js,jsx,ts,tsx}": "eslint --fix",
|
"src/**/*.{js,jsx,ts,tsx}": "eslint --fix",
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<script lang='ts'>
|
<script lang='ts'>
|
||||||
import { mpUpdate, setCompanyId, setReferrerUserId, setRegisterStoreId } from '@/utils';
|
import { mpUpdate, setCompanyId, setReferrerUserId, setRegisterStoreId } from '@/utils';
|
||||||
|
import { Logger } from '@/utils/common/logger';
|
||||||
|
|
||||||
const logManager = uni.getRealtimeLogManager();
|
const logger = new Logger();
|
||||||
const logger = logManager.tag('suke-mp');
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
onLaunch: async (options: any) => {
|
onLaunch: async (options: any) => {
|
||||||
@ -11,9 +11,10 @@ export default {
|
|||||||
const miniProgram = uni.getAccountInfoSync().miniProgram;
|
const miniProgram = uni.getAccountInfoSync().miniProgram;
|
||||||
const env = miniProgram.envVersion;
|
const env = miniProgram.envVersion;
|
||||||
|
|
||||||
logger.info(`launch options ${env}: `, options);
|
|
||||||
//生产
|
//生产
|
||||||
if(env === 'release' || env === 'trial') {
|
if(env === 'release' || env === 'trial') {
|
||||||
|
logger.info(`launch options ${env}: `, options);
|
||||||
|
|
||||||
async function getVersionStatus() {
|
async function getVersionStatus() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
uni.request({
|
uni.request({
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
"name": "SUKE-MP",
|
"name": "SUKE-MP",
|
||||||
"appid": "",
|
"appid": "",
|
||||||
"description": "",
|
"description": "",
|
||||||
"versionName": "3.0.1",
|
"versionName": "3.0.2",
|
||||||
"versionCode": "300",
|
"versionCode": "302",
|
||||||
"transformPx": false,
|
"transformPx": false,
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
"usingComponents": true,
|
"usingComponents": true,
|
||||||
@ -24,7 +24,6 @@
|
|||||||
"urlCheck": false
|
"urlCheck": false
|
||||||
},
|
},
|
||||||
"usingComponents": true,
|
"usingComponents": true,
|
||||||
|
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"sqb-pay": {
|
"sqb-pay": {
|
||||||
"version": "1.3.0",
|
"version": "1.3.0",
|
||||||
|
@ -178,11 +178,13 @@ const useUserStore = defineStore('user', {
|
|||||||
}
|
}
|
||||||
resolve(res);
|
resolve(res);
|
||||||
} else {
|
} else {
|
||||||
|
getApp().globalData?.logger.error('login error: ', result.errMsg);
|
||||||
reject(new Error(result.errMsg));
|
reject(new Error(result.errMsg));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fail: (err: any) => {
|
fail: (err: any) => {
|
||||||
console.error(`login error: ${err}`);
|
console.error(`login error: ${err}`);
|
||||||
|
getApp().globalData?.logger.error('login error: ', err);
|
||||||
reject(err);
|
reject(err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
30
src/utils/common/logger.ts
Normal file
30
src/utils/common/logger.ts
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import RealtimeTagLogManager = UniNamespace.RealtimeTagLogManager;
|
||||||
|
|
||||||
|
export class Logger {
|
||||||
|
|
||||||
|
private env = uni.getAccountInfoSync().miniProgram.envVersion;
|
||||||
|
private readonly logger: RealtimeTagLogManager;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
const logManager = uni.getRealtimeLogManager();
|
||||||
|
this.logger = logManager.tag('suke-mp');
|
||||||
|
}
|
||||||
|
|
||||||
|
info(key: string, value: any) {
|
||||||
|
if(this.env === 'release' || this.env === 'trial') {
|
||||||
|
this.logger.info(key, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
warn(key: string, value: any) {
|
||||||
|
if(this.env === 'release' || this.env === 'trial') {
|
||||||
|
this.logger.warn(key, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
error(key: string, value: any) {
|
||||||
|
if(this.env === 'release' || this.env === 'trial') {
|
||||||
|
this.logger.error(key, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -26,6 +26,7 @@ function requestInterceptors() {
|
|||||||
|
|
||||||
// config.header.contentType = "x-www-form-urlencoded"
|
// config.header.contentType = "x-www-form-urlencoded"
|
||||||
}
|
}
|
||||||
|
getApp().globalData?.logger.info('request: ', config);
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
(
|
(
|
||||||
@ -52,6 +53,8 @@ function responseInterceptors() {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getApp().globalData?.logger.info('response: ', config);
|
||||||
|
|
||||||
// 请求成功则返回结果
|
// 请求成功则返回结果
|
||||||
if(data.code === 200 || data?.retcode == 0) {
|
if(data.code === 200 || data?.retcode == 0) {
|
||||||
return data || {};
|
return data || {};
|
||||||
|
Loading…
Reference in New Issue
Block a user