|
@@ -88,46 +88,49 @@ const mutations = {
|
|
|
const actions = {
|
|
|
login({ commit }) { //, dispatch
|
|
|
return new Promise((resolve, reject) => {
|
|
|
- eduGet()
|
|
|
- .then((response) => {
|
|
|
- console.log(response);
|
|
|
- var _user = response.data[0][0];
|
|
|
- // const allowedIds = [
|
|
|
- // "0abcb118-9110-11eb-80ad-005056b86db5",
|
|
|
- // "b7ccc834-aae5-11ea-a8d4-52540005ab01",
|
|
|
- // "a77e9404-efec-11e9-96f9-028edca3b798",
|
|
|
- // "0e8d50c3-50b5-2f1c-9f1a-bd346a0bf817",
|
|
|
- // "5943e08c-b7d4-11ed-8d51-005056b86db5"
|
|
|
- // ];
|
|
|
- // if (allowedIds.includes(_user.userid)) {
|
|
|
- commit("SET_ID", _user.userid);
|
|
|
- commit("SET_TOKEN", _user.userid);
|
|
|
- setToken(_user.userid);
|
|
|
- resolve(_user.userid);
|
|
|
-
|
|
|
- // } else if(_user.userid){
|
|
|
- // loginOut()
|
|
|
- // .then(async () => {
|
|
|
- // dispatch('user/logout', null, { root: true });
|
|
|
- // })
|
|
|
- // .catch(err => {
|
|
|
- // console.error(err);
|
|
|
- // });
|
|
|
- // Message({
|
|
|
- // message: "该用户ID不允许登录",
|
|
|
- // type: "error"
|
|
|
- // });
|
|
|
- // reject("该用户ID不允许登录");
|
|
|
- // }
|
|
|
- })
|
|
|
- .catch((error) => {
|
|
|
- // var _user = { userid: "6c56ec0e-2c74-11ef-bee5-005056b86db5" };
|
|
|
- // commit("SET_ID", _user.userid);
|
|
|
- // commit("SET_TOKEN", _user.userid);
|
|
|
- // setToken(_user.userid);
|
|
|
- // resolve(_user.userid);
|
|
|
- reject(error);
|
|
|
- });
|
|
|
+ let loginType = window.topU.U.UF.Cookie.get("cocoroboLoginType");
|
|
|
+ if(loginType != 1){
|
|
|
+ eduGet()
|
|
|
+ .then((response) => {
|
|
|
+ console.log(response);
|
|
|
+ var _user = response.data[0][0];
|
|
|
+ // const allowedIds = [
|
|
|
+ // "0abcb118-9110-11eb-80ad-005056b86db5",
|
|
|
+ // "b7ccc834-aae5-11ea-a8d4-52540005ab01",
|
|
|
+ // "a77e9404-efec-11e9-96f9-028edca3b798",
|
|
|
+ // "0e8d50c3-50b5-2f1c-9f1a-bd346a0bf817",
|
|
|
+ // "5943e08c-b7d4-11ed-8d51-005056b86db5"
|
|
|
+ // ];
|
|
|
+ // if (allowedIds.includes(_user.userid)) {
|
|
|
+ commit("SET_ID", _user.userid);
|
|
|
+ commit("SET_TOKEN", _user.userid);
|
|
|
+ setToken(_user.userid);
|
|
|
+ resolve(_user.userid);
|
|
|
+
|
|
|
+ // } else if(_user.userid){
|
|
|
+ // loginOut()
|
|
|
+ // .then(async () => {
|
|
|
+ // dispatch('user/logout', null, { root: true });
|
|
|
+ // })
|
|
|
+ // .catch(err => {
|
|
|
+ // console.error(err);
|
|
|
+ // });
|
|
|
+ // Message({
|
|
|
+ // message: "该用户ID不允许登录",
|
|
|
+ // type: "error"
|
|
|
+ // });
|
|
|
+ // reject("该用户ID不允许登录");
|
|
|
+ // }
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ // var _user = { userid: "6c56ec0e-2c74-11ef-bee5-005056b86db5" };
|
|
|
+ // commit("SET_ID", _user.userid);
|
|
|
+ // commit("SET_TOKEN", _user.userid);
|
|
|
+ // setToken(_user.userid);
|
|
|
+ // resolve(_user.userid);
|
|
|
+ reject(error);
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
getInfo({ commit, state }) {
|