Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaviilee committed Jan 27, 2025
2 parents 4949bbd + c54f181 commit b370f25
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 13 deletions.
8 changes: 6 additions & 2 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
STATIC_PATH=/
STATIC_PATH=mirror
BASE_URL=/

VUE_APP_CMS_API=https://cms.jx3box.com
VUE_APP_CMS_API=https://dev.cms.jx3box.com
VUE_APP_NEXT_API=https://dev.next.jx3box.com
VUE_APP_PAY_API=https://pay.jx3box.com
VUE_APP_TEAM_API=https://team.jx3box.com
VUE_APP_LUA_API=https://lua.jx3box.com
4 changes: 4 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ STATIC_PATH=mirror
BASE_URL=/

VUE_APP_CMS_API=https://cms.jx3box.com
VUE_APP_NEXT_API=https://next.jx3box.com
VUE_APP_PAY_API=https://pay.jx3box.com
VUE_APP_TEAM_API=https://team.jx3box.com
VUE_APP_LUA_API=https://lua.jx3box.com
8 changes: 8 additions & 0 deletions .env.staging
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
STATIC_PATH=mirror
BASE_URL=/

VUE_APP_CMS_API=http://localhost:7100
VUE_APP_NEXT_API=https://next.jx3box.com
VUE_APP_PAY_API=https://pay.jx3box.com
VUE_APP_TEAM_API=https://team.jx3box.com
VUE_APP_LUA_API=https://lua.jx3box.com
2 changes: 1 addition & 1 deletion .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install && Build
run: |
npm install
npm run preview
npm run build-dev
## TODO:下方修改1处
- name: GrayEnv
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
"name": "account",
"private": true,
"scripts": {
"dev": "cross-env DEV_SERVER=true vue-cli-service serve",
"dev": "cross-env DEV_SERVER=true vue-cli-service serve --mode development",
"serve": "vue-cli-service serve",
"debug": "cross-env DEV_SERVER=true vue-cli-service serve --mode staging",
"build": "vue-cli-service build",
"preview": "cross-env BUILD_MODE=preview vue-cli-service build --mode development",
"build-dev": "cross-env BUILD_MODE=preview vue-cli-service build --mode development",
"lint": "vue-cli-service lint",
"inspect": "vue inspect > output.js",
"update": "npm --registry https://registry.npmjs.org install @jx3box/jx3box-common@latest"
},
"dependencies": {
"@jx3box/jx3box-common": "^8.3.3",
"@jx3box/jx3box-common": "^8.5.7",
"@jx3box/jx3box-common-ui": "^8.9.11",
"axios": "^0.19.2",
"core-js": "^3.4.3",
Expand Down
2 changes: 2 additions & 0 deletions src/core/login/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ export default {
if (~~alternate) {
this.isAlternate = true;
sessionStorage.setItem("alternate", 1);
}
},
checkDeviceID: function () {
Expand Down
9 changes: 9 additions & 0 deletions src/core/login_callback_wesite/Login_Callback.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ export default {
}
User.update(_data).then(() => {
if (this.isAlternate) {
localStorage.setItem(`jx3box-alternate-${_data.uid}`, JSON.stringify({
..._data,
created_at: Number(localStorage.getItem("created_at")),
}));
}
sessionStorage.removeItem("alternate");
this.skip();
});
}
Expand Down
3 changes: 3 additions & 0 deletions src/utils/direct_mixins.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const directMixins = {
redirect: "",
redirect_button: "",
homepage: "/",
isAlternate: false,
};
},
mounted() {
Expand All @@ -27,6 +28,8 @@ export const directMixins = {
this.redirect = this.homepage;
this.redirect_button = "返回首页";
}

this.isAlternate = sessionStorage.getItem("alternate") == 1;
},
skip: function () {
if (this.redirect) {
Expand Down
14 changes: 7 additions & 7 deletions vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ module.exports = {
},

//❤️ Porxy ~
devServer: {
proxy: {
"/api/cms": {
target: process.env["DEV_SERVER"] == "true" ? "http://localhost:7100" : "https://cms.jx3box.com",
},
}
},
// devServer: {
// proxy: {
// "/api/cms": {
// target: process.env["DEV_SERVER"] == "true" ? "http://localhost:7100" : "https://cms.jx3box.com",
// },
// }
// },

outputDir: process.env["BUILD_MODE"] == "preview" ? path.resolve(__dirname, pkg.name) : "dist", // 指定构建输出的目录

Expand Down

0 comments on commit b370f25

Please sign in to comment.