diff --git a/src/lib/services.js b/src/lib/services.js
index 1b4d6842..9f1e2f57 100644
--- a/src/lib/services.js
+++ b/src/lib/services.js
@@ -72,4 +72,11 @@ export default {
refreshToken: () => {
return axios.post('v1/tokens/refresh.json');
},
+ updateProfile: ({ email, nickname, password }) => {
+ return axios.post('v1/users/profile/update.json', {
+ email,
+ nickname,
+ password
+ });
+ },
};
diff --git a/src/lib/userstate.js b/src/lib/userstate.js
index 24c0c615..6396009f 100644
--- a/src/lib/userstate.js
+++ b/src/lib/userstate.js
@@ -32,6 +32,14 @@ function updateToken(item) {
}
}
+function updateUsername(value) {
+ localStorage.setItem(userNameLocalStorageKey, value);
+}
+
+function updateUserNickname(value) {
+ localStorage.setItem(userNickNameLocalStorageKey, value);
+}
+
function clearToken() {
localStorage.removeItem(tokenLocalStorageKey);
localStorage.removeItem(userNameLocalStorageKey);
@@ -46,5 +54,7 @@ export default {
getUserNickName,
isUserLogined,
updateToken,
+ updateUsername,
+ updateUserNickname,
clearToken
};
diff --git a/src/locales/en.js b/src/locales/en.js
index b225e1e6..26891945 100644
--- a/src/locales/en.js
+++ b/src/locales/en.js
@@ -54,6 +54,7 @@ export default {
},
'OK': 'OK',
'Cancel': 'Cancel',
+ 'Update': 'Update',
'Done': 'Done',
'User': 'User',
'Application': 'Application',
@@ -102,6 +103,9 @@ export default {
'You have been successfully registered': 'You have been successfully registered',
'Unable to sign up': 'Unable to sign up',
'User registration is disabled': 'User registration is disabled',
+ 'Nothing has been modified': 'Nothing has been modified',
+ 'Your profile has been successfully updated': 'Your profile has been successfully updated',
+ 'Unable to update user profile': 'Unable to update user profile',
'Log Out': 'Log Out',
'Are you sure you want to log out?': 'Are you sure you want to log out?',
'Unable to logout': 'Unable to logout',
diff --git a/src/locales/zh_Hans.js b/src/locales/zh_Hans.js
index f1cc9eb4..12999437 100644
--- a/src/locales/zh_Hans.js
+++ b/src/locales/zh_Hans.js
@@ -54,6 +54,7 @@ export default {
},
'OK': '确定',
'Cancel': '取消',
+ 'Update': '更新',
'Done': '完成',
'User': '用户',
'Application': '应用',
@@ -102,6 +103,9 @@ export default {
'You have been successfully registered': '注册成功',
'Unable to sign up': '无法注册',
'User registration is disabled': '用户注册已禁用',
+ 'Nothing has been modified': '没有修改的项目',
+ 'Your profile has been successfully updated': '您的用户信息更新成功',
+ 'Unable to update user profile': '无法更新用户信息',
'Log Out': '退出登录',
'Are you sure you want to log out?': '您确定是否要退出登录?',
'Unable to logout': '无法退出登录',
diff --git a/src/router/mobile.js b/src/router/mobile.js
index 656c0a51..611facf2 100644
--- a/src/router/mobile.js
+++ b/src/router/mobile.js
@@ -6,6 +6,7 @@ import MainPageHomeTab from '../views/mobile/main/Home.vue';
import LoginPage from '../views/mobile/Login.vue';
import SignUpPage from '../views/mobile/Signup.vue';
import SettingsPage from '../views/mobile/Settings.vue';
+import UserProfilePage from "../views/mobile/users/UserProfile.vue";
function checkLogin(to, from, resolve, reject) {
const router = this;
@@ -60,6 +61,11 @@ const routes = [
component: SettingsPage,
beforeEnter: checkLogin
},
+ {
+ path: '/user/profile',
+ component: UserProfilePage,
+ beforeEnter: checkLogin
+ },
{
path: '(.*)',
redirect: '/'
diff --git a/src/views/mobile/Settings.vue b/src/views/mobile/Settings.vue
index e46ca07c..65efe12c 100644
--- a/src/views/mobile/Settings.vue
+++ b/src/views/mobile/Settings.vue
@@ -3,7 +3,7 @@
{{ userNickName }}
-
+
{{ $t('Log Out') }}
{{ $t('Application') }}
diff --git a/src/views/mobile/users/UserProfile.vue b/src/views/mobile/users/UserProfile.vue
new file mode 100644
index 00000000..c3008b8b
--- /dev/null
+++ b/src/views/mobile/users/UserProfile.vue
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+