diff --git a/server/conf.js b/server/conf.js
index 9b2d550b..f86e1f54 100644
--- a/server/conf.js
+++ b/server/conf.js
@@ -35,7 +35,6 @@ exports.publicValues = {
dropboxAppKey,
dropboxAppKeyFull,
githubClientId,
- giteeClientId,
googleClientId,
googleApiKey,
wordpressClientId,
diff --git a/server/index.js b/server/index.js
index 70071717..16ac2f00 100644
--- a/server/index.js
+++ b/server/index.js
@@ -34,7 +34,11 @@ module.exports = (app) => {
app.post('/paypalIpn', bodyParser.urlencoded({
extended: false,
}), user.paypalIpn);
-
+ app.get('/giteeClientId', (req, res) => {
+ const giteeClientIds = conf.values.giteeClientId.split(',');
+ const clientId = giteeClientIds[Math.floor((giteeClientIds.length * Math.random()))];
+ res.send(clientId);
+ });
// Serve landing.html
app.get('/', (req, res) => res.sendFile(resolvePath('static/landing/index.html')));
// Serve privacy_policy.html
diff --git a/src/components/Modal.vue b/src/components/Modal.vue
index 00d9a242..0574ba30 100644
--- a/src/components/Modal.vue
+++ b/src/components/Modal.vue
@@ -56,7 +56,6 @@ import GithubWorkspaceModal from './modals/providers/GithubWorkspaceModal';
import GithubPublishModal from './modals/providers/GithubPublishModal';
import GistSyncModal from './modals/providers/GistSyncModal';
import GistPublishModal from './modals/providers/GistPublishModal';
-import GiteeAccountModal from './modals/providers/GiteeAccountModal';
import GiteeOpenModal from './modals/providers/GiteeOpenModal';
import GiteeSaveModal from './modals/providers/GiteeSaveModal';
import GiteeWorkspaceModal from './modals/providers/GiteeWorkspaceModal';
@@ -120,7 +119,6 @@ export default {
GithubPublishModal,
GistSyncModal,
GistPublishModal,
- GiteeAccountModal,
GiteeOpenModal,
GiteeSaveModal,
GiteeWorkspaceModal,
diff --git a/src/components/menus/PublishMenu.vue b/src/components/menus/PublishMenu.vue
index b17ca1f7..653c9f69 100644
--- a/src/components/menus/PublishMenu.vue
+++ b/src/components/menus/PublishMenu.vue
@@ -252,7 +252,6 @@ export default {
},
async addGiteeAccount() {
try {
- await store.dispatch('modal/open', { type: 'giteeAccount' });
await giteeHelper.addAccount();
} catch (e) { /* cancel */ }
},
diff --git a/src/components/modals/providers/GiteeAccountModal.vue b/src/components/modals/providers/GiteeAccountModal.vue
deleted file mode 100644
index eabb3afb..00000000
--- a/src/components/modals/providers/GiteeAccountModal.vue
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
将您的Gitee账号链接到StackEdit。
-
-
-
-
-
-
-
-
-
-
diff --git a/src/services/providers/giteeWorkspaceProvider.js b/src/services/providers/giteeWorkspaceProvider.js
index 08a88d40..ab9c76fb 100644
--- a/src/services/providers/giteeWorkspaceProvider.js
+++ b/src/services/providers/giteeWorkspaceProvider.js
@@ -70,7 +70,6 @@ export default new Provider({
token = store.getters['data/giteeTokensBySub'][workspace.sub];
}
if (!token) {
- await store.dispatch('modal/open', { type: 'giteeAccount' });
token = await giteeHelper.addAccount();
}
diff --git a/src/services/providers/helpers/giteeHelper.js b/src/services/providers/helpers/giteeHelper.js
index 8b173dd0..70771f13 100644
--- a/src/services/providers/helpers/giteeHelper.js
+++ b/src/services/providers/helpers/giteeHelper.js
@@ -69,10 +69,12 @@ export default {
* https://developer.gitee.com/apps/building-oauth-apps/authorization-options-for-oauth-apps/
*/
async startOauth2(lastToken, silent = false, isMain) {
- const giteeClientIds = store.getters['data/serverConf'].giteeClientId.split(',');
- const clientId = giteeClientIds[Math.floor((giteeClientIds.length * Math.random()))];
let tokenBody;
if (!silent) {
+ const clientId = (await networkSvc.request({
+ method: 'GET',
+ url: 'giteeClientId',
+ })).body;
// Get an OAuth2 code
const { code } = await networkSvc.startOauth2(
'https://gitee.com/oauth/authorize',